Changes

XAML

2,044 bytes added, 26 February
/* Miscellaneous */
</tabs>
<br>
 
=== Custom VisualState Trigger {{Version/WinXSince|5.1.1}} ===
{{UnderConstructionStart}}
The UBIKStateObserver (UWP only) is a custom State trigger that allows activating a Visual State based on a value. The trigger compares the '''StateObserver''' value with the specified '''ExpectedValue'''. If both values are equal, the corresponding VisualState becomes active. This enables clean, template-based UI state changes without attaching behaviors directly to controls. It is especially useful in scenarios where behaviors cannot be reused in styles due to framework limitations.
 
Custom states should be placed in a separate VisualStateGroup. States within the same group are mutually exclusive. If combined with standard groups such as CommonStates (Normal, Focused, PointerOver, etc.), the custom state may be overridden.
 
<source lang = "xml">
xmlns:trigger="using:UBIK.WinX.Trigger"
 
<Style ...>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid x:Name="ExampleGrid" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CustomStates">
<VisualState x:Name="CustomState">
<VisualState.StateTriggers>
<trigger:UBIKStateObserver StateObserver="{Binding ValueItem.PropertyValue.IsSuggestedValue}" ExpectedValue="True" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="ExampleGrid.Foreground" Value="Red" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</source>
 
{{UnderConstructionEnd}}
=== UBIKContentControl ===
</tabs>
<br>
 
[[Category:Mobile|XAML]]
[[Category:WinX|XAML]]
[[Category:XAML|XAML]]
== Custom Icons ==
710
edits