AdaptiveTriggerLibrary
AdaptiveTriggerLibrary copied to clipboard
How to use ConnectivityTrigger from AdaptiveTriggerLibrary?
Hi,
I need using ConnectivityTriggers. In view I wrote this code:
xmlns:connectivityTriggers="using:AdaptiveTriggerLibrary.Triggers.ConnectivityTriggers"
<VisualState x:Name="disconnect">
<VisualState.StateTriggers>
<connectivityTriggers:NetworkConnectionStateTrigger
Condition="ConstrainedInternetAccess"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter
Target="EditProfileButton.IsEnabled"
Value="False" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>```
And this code not work.
What I need write to ConditionModifier?
Hey @boodoolak , you should use the EqualsModifier for that purpose.
For the Condition, you might need to use the fully qualified name in XAML for the ConstrainedInternetAccess. If this doesn't work, try to set everything from code-behind and migrate to XAML afterwards. Let me know if you have any issues.
Thank you for answer @Herdo
How can i set EqualsModifier in xaml?

@boodoolak: The EqualsModfier is a generic class, therefore, you need to provide the type argument, even in XAML.
I'm sorry, i'm not understand how to write it. Can you show code example, please?
@boodoolak The official Microsoft docs might help you.
If you cannot follow that guide, or to make it easier for yourself, you might want to derive from NetworkConnectionStateTrigger in your own class, where you specify all generic constraints etc.
Don't understand how to apply the information from msdn to this case. Can you simply show how to correctly specify the ConditionModifier?