Screenbox icon indicating copy to clipboard operation
Screenbox copied to clipboard

refactor: chapter control progress bar bindings

Open United600 opened this issue 3 months ago • 1 comments

United600 avatar Nov 07 '25 18:11 United600

If I remember correctly, I used Bindings here for a reason. When I last tested this, there were some edge cases where ItemRepeater and x:Bind don't play nice together. Did you encounter any issues in your testing?

No, but I haven't tested it extensively. Just a couple of files with chapters. But now that I know you've run into issues, I'll test it with a few more.

United600 avatar Nov 09 '25 19:11 United600

If I remember correctly, I used Bindings here for a reason. When I last tested this, there were some edge cases where ItemRepeater and x:Bind don't play nice together. Did you encounter any issues in your testing?

Can confirm. Works correctly for the first file in a session, but subsequent files incorrectly applies the Value to some chapters.

The ItemsRepeater also isn't properly clearing the list. While replacing it with an ItemsControl would resolve both this issue and the previous one, it introduces a regression (increasing the Spacing will cause value misalignment in some files).

<ItemsControl ItemTemplate="{StaticResource ItemTemplate}" ItemsSource="{x:Bind ProgressItems}">
    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel Orientation="Horizontal" Spacing="1" />
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
</ItemsControl>

United600 avatar Nov 13 '25 17:11 United600