<DataTemplate
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:cimalinoBehaviorsbehaviors="using:CimbalinoUBIK.ToolkitWinX.BehaviorsBehaviours">
...
<Grid>
<Interactivity:Interaction.Behaviors>
<cimalinoBehaviorsbehaviors:MultiBindingBehavior Converter="{StaticResource VisLogicAndConverter}" PropertyName="Visibility"> <cimalinoBehaviorsbehaviors:MultiBindingItem Value="{Binding MassEditViewModel, Converter={StaticResource NullToVisConverter}}" /> <cimalinoBehaviorsbehaviors:MultiBindingItem Value="{Binding Documents.Items.Count, Converter={StaticResource ItemCountToVisConverter}}" /> </cimalinoBehaviorsbehaviors:MultiBindingBehavior>
</Interactivity:Interaction.Behaviors>
</Grid>
</source>
The behavior makes sure the container Grid is set to Visibile only if the mass editing mode is not turned on (MassEditViewModel is null) and the context object has child document(s) (Documents.Items.Count is greater than 0. You can combine any number of binding results (MultiBindingItem) using the VisLogicAndConverter (the name should be self explanatory).
== Performance related ==