As you can see from the image, the TogglePaneButton
has a distinct color from the remaining.
That's because I set it manually to WhiteSmoke
(actually in my pushed code it's already gray) when it is in the LeftMinimal
mode in its source code of VisualState
Compact.
I thought I could change it back when pane is open by modifying its visual state like this:
<VisualState x:Name="Expanded">
<VisualState.Setters>
<Setter Target="RootSplitView.PaneBackground" Value="{ThemeResource MainNavigationViewBackground}" />
<Setter Target="TogglePaneButton.Background" Value="{ThemeResource MainNavigationViewBackground}" />
</VisualState.Setters>
</VisualState>
But it is not working. How can I achieve that?
The code has exceeded 30000 characters so I can only post the link:
https://github.com/SeakyLuo/SMPlayer/blob/master/SMPlayer/Dictionaries/MainNavigationView.xaml
I have found a very simple solution:
Just make another TogglePaneButton
and put it over the original one. Then let it work as the real one. Set its visibility to Collapsed
when needed.