Update StorageBar.xaml - Replace Storyboard with VisualState Setters#18531
Update StorageBar.xaml - Replace Storyboard with VisualState Setters#18531mdtauk wants to merge 1 commit into
Conversation
Based on what we are seeing with the WinUI Perf2026 changes, I thought I would start by updating our StorageBar to use VisualStateSetters, instead of Storyboards. I ran the UITests app and the control behaves the same as it did before. If possible, @0x5bfa could make some kind of test to ensure there is nothing that has been overlooked. It should just be 1:1 behaviour though, and I suppose if Microsoft felt moving from storyboards offered a performance improvement, there may be some gains from this change.
|
Does this have a noticeable impact on performance? Have you run any benchmarks? Fyi @marcelwgn |
I don't think we have enough testing in the app to benchmark it - but if Microsoft has decided it offers a performance improvement - and has no functional difference making the change - I see no reason not to make the change. There are other uses of Storyboard within the app, such as the Sidebar, etc - but I only felt comfortable touching the code I wrote, and the other uses would be others. |
VisualState Setters are easier to work with in general, but I don't see a reason to change something that's already working. That is unless we know that it makes a difference. |
Microsoft are making the changes to all their default WinUI control templates. and list the new xaml resource dictionaries as Perf2026, and its part of their effort to improve WinUI performance. The changes reduce lines of Xaml, and involve no behavioural changes. If it does boost performance as Microsoft seems to think, and reduces lines of code - it should be a no brainer to make these minimal changes. |
|
I did some naive benchmarking, there is a slight performance gain. Question is though, if that matters for us. Its not like we are going to show dozens or hundreds of storagebars is it? |
Thank you for checking. I don't expect this to have much impact in Files, but it's good to confirm that this does have a performance gain. It's also something we can keep in mind for future development. |
Screen.Recording.2026-05-30.162926.mp4
Based on what we are seeing with the WinUI Perf2026 changes, I thought I would start by updating our StorageBar to use VisualStateSetters, instead of Storyboards.
It does not resolve or close any existing issues
Steps used to test these changes
I ran the UITests app and the control behaves the same as it did before.
If possible, @0x5bfa could make some kind of test to ensure there is nothing that has been overlooked. It should just be 1:1 behaviour though, and I suppose if Microsoft felt moving from storyboards offered a performance improvement, there may be some gains from this change.