I'm trying to set a VisualState style for Pressed/PointerOver/MouseOver etc. for the ToolbarItemView or ButtonToolbarItemView.
But somehow that doesn't seem to work. Definitely not Pressed for iOS and Android
Is there an example here, or could it be that this doesn't work?
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="Opacity" Value="0.5" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource ButtonPointerOverColorLight}, Dark={StaticResource ButtonPointerOverColorDark}}" />
<Setter Property="BorderColor" Value="{AppThemeBinding Dark={StaticResource ButtonBorderColorDark}, Light={StaticResource ButtonBorderColorLight}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource ButtonPointerOverColorLight}, Dark={StaticResource ButtonPointerOverColorDark}}" />
<Setter Property="BorderColor" Value="{AppThemeBinding Dark={StaticResource ButtonBorderColorDark}, Light={StaticResource ButtonBorderColorLight}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="MouseOver">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource ButtonPointerOverColorLight}, Dark={StaticResource ButtonPointerOverColorDark}}" />
<Setter Property="BorderColor" Value="{AppThemeBinding Dark={StaticResource ButtonBorderColorDark}, Light={StaticResource ButtonBorderColorLight}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
But somehow that doesn't seem to work. Definitely not Pressed for iOS and Android
Is there an example here, or could it be that this doesn't work?
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="Opacity" Value="0.5" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource ButtonPointerOverColorLight}, Dark={StaticResource ButtonPointerOverColorDark}}" />
<Setter Property="BorderColor" Value="{AppThemeBinding Dark={StaticResource ButtonBorderColorDark}, Light={StaticResource ButtonBorderColorLight}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource ButtonPointerOverColorLight}, Dark={StaticResource ButtonPointerOverColorDark}}" />
<Setter Property="BorderColor" Value="{AppThemeBinding Dark={StaticResource ButtonBorderColorDark}, Light={StaticResource ButtonBorderColorLight}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="MouseOver">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource ButtonPointerOverColorLight}, Dark={StaticResource ButtonPointerOverColorDark}}" />
<Setter Property="BorderColor" Value="{AppThemeBinding Dark={StaticResource ButtonBorderColorDark}, Light={StaticResource ButtonBorderColorLight}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
Hello Nico,
Thank you for the provided Toolbar definition.
I have reviewed the case and reproduced the behavior. On android the visual states do not apply. On WinUI the pressed state does not apply only point over. Point over applies as when you hover the toolbar item there is a style on point over.
I have forwarded the case to the development team. They will review it and when more information is available, I or someone else from the team will get back to you with more details (next week).
Regards,
Didi
Progress Telerik