Changes
/* InvokeOnItemsCommand */ provided Xamarin examples
* To enable selection, click on the "Mass Edit" button below the property list.
<br />
<tabs>
<tab name="UWP">
<source lang = "xml">
<Button
</Button>
</source>
</tab>
<tab name="Xamarin">
<source lang = "xml">
<Button
xmlns:example="clr-namespace:UBIK.CPL.Classes;assembly=UBIK.CPL"
Command="{Binding Children.InvokeOnItemsCommand}"
Text="Set to 50%">
<Button.CommandParameter>
<example:KeyValueList>
<example:KeyValueParameter Key="Command" Value="SetPropertyValueCommand" />
<example:KeyValueParameter Key="SelectedItemsOnly" Value="False" />
<example:KeyValueParameter Key="PropertyName" Value="VALUE" />
<example:KeyValueParameter Key="PropertyValue">
<example:KeyValueParameter.Value>
<x:Double>50</x:Double>
</example:KeyValueParameter.Value>
</example:KeyValueParameter>
</example:KeyValueList>
</Button.CommandParameter>
</Button>
</source>
</tab>
</tabs>
==== Invoke on filtered results ====
* The example expression filters for any items that don't contain the text "EXAMPLE" in their Title texts. You can filter differently by altering the expression.
<br />
<tabs>
<tab name="UWP">
<source lang = "xml">
<Grid xmlns:CV="using:UBIK.WinX.UI.CollectionView">
</Grid>
</source>
</tab>
<tab name="Xamarin">
<source lang = "xml">
<ContentView
xmlns:controls="clr-namespace:UBIK.CPL.Controls;assembly=UBIK.CPL"
...>
<ContentView.Resources>
<ResourceDictionary>
<x:String x:Key="Expresssion">!Item.Title.Contains("EXAMLPLE")</x:String>
<controls:SfDataSourceExt x:Key="Filtered" Expression="{StaticResource Expresssion}" ItemsSource="{Binding Children.Items}" />
</ResourceDictionary>
</ContentView.Resources>
</ContentView>
</source>
</tab>
</tabs>
<br />
With the filtered list configured, you can then insert the following code snippet to execute the SetPropertyValueCommand for the filtered result items.
* The "Filtered" refers to the ListCollectionView configured above.
<br />
<tabs>
<tab name="UWP">
<source lang = "xml">
<AppBarButton
</AppBarButton>
</source>
</tab>
<tab name="Xamarin">
<source lang = "xml">
<Button
xmlns:example="clr-namespace:UBIK.CPL.Classes;assembly=UBIK.CPL"
Command="{Binding Source={StaticResource Filtered}, Path=ListViewModel.InvokeOnItemsCommand}"
Text="Set to 50">
<Button.CommandParameter>
<example:KeyValueList>
<example:KeyValueParameter Key="Command" Value="SetPropertyValueCommand" />
<example:KeyValueParameter Key="PropertyName" Value="VALUE" />
<example:KeyValueParameter Key="PropertyValue" Value="50" />
</example:KeyValueList>
</Button.CommandParameter>
</Button>
</source>
</tab>
</tabs>
{{Attention|The binding <code>ListViewModel.InvokeOnItemsCommand</code> should be updated to <code>BulkOperation.InvokeOnItemsCommand</code> starting from version 4.3.}}
This single value is then passed as the command parameter instead of the entire KeyValueList.
[[Category:Client|XAML Tips]][[Category:WinX|XAML Tips]][[Category:XAML|XAML Tips]][[Category:Xamarin|XAML Tips]]
=== SetPropertyValueCommand {{Version/WinXSince|3.6}} ===