2
votes

I'm doing an UWP project and I wan't to display different type of informations depending on how many Items I have selected in a listview.

I wan't to display a different message in my TextBlock in these cases : - No item selected - One item selected - Number of items selected

I found in WPF that there is something called : DataTrigger used like this :

<Style.Triggers>
   <DataTrigger Binding="{Binding MyList.Count}" Value="0">
       <Setter Property="Visibility" Value="Visible" />
   </DataTrigger>
</Style.Triggers>

What is the equivalent syntaxe in UWP using <VisualState.StateTriggers> ?

Thanks

1

1 Answers

1
votes

The closest you get to be able to use a DataTrigger in UWP is to use a DataTriggerBehavior with a ChangePropertyAction: https://github.com/Microsoft/XamlBehaviors/wiki/DataTriggerBehavior

You will need to install this official NuGet package.