Changes

XAML

14 bytes added, 2 March
/* Custom VisualState Trigger {{Version/WinXSince|5.1.1}} */
{{UnderConstructionStart}}
The '''UBIKStateObserverUBIKStateObserverTrigger''' (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.
<VisualState x:Name="CustomState">
<VisualState.StateTriggers>
<trigger:UBIKStateObserver UBIKStateObserverTrigger StateObserver="{Binding ValueItem.PropertyValue.IsSuggestedValue}" ExpectedValue="True" />
</VisualState.StateTriggers>
<VisualState.Setters>
710
edits