Changes

XAML Tips

15 bytes added, 13:34, 28 February 2020
/* InvokeOnItemsCommand {{Version/WinXSince|3.6}} */
==== Invoke on selected items ====
This example demonstrates how you can use the mass editing feature to select certain objects from the child list and then execute the SetPropertyValueAndValidateCommand SetPropertyValueCommand for those selected.
* The example code assumes that the child objects have an editable property called "VALUE" and tries to set 50 as their value;
* You should insert the following code snippet into the default UBIKChildArea template;
<AppBarButton.CommandParameter>
<example:KeyValueList>
<example:KeyValueParameter Key="Command" Value="SetPropertyValueAndValidateCommandSetPropertyValueCommand" />
<example:KeyValueParameter Key="SelectedItemsOnly" Value="True" />
<example:KeyValueParameter Key="PropertyName" Value="VALUE" />
</source>
<br />
With the filtered list configured, you can then insert the following code snippet to execute the SetPropertyValueAndValidateCommand SetPropertyValueCommand for the filtered result items.
* The example code assumes that the child objects have an editable property called "VALUE" and tries to set 50 as their value;
* The "Filtered" refers to the ListCollectionView configured above.
<AppBarButton.CommandParameter>
<example:KeyValueList>
<example:KeyValueParameter Key="Command" Value="SetPropertyValueAndValidateCommandSetPropertyValueCommand" />
<example:KeyValueParameter Key="PropertyName" Value="VALUE" />
<example:KeyValueParameter Key="PropertyValue" Value="50" />
<source lang = "xml"><example:KeyValueParameter Key="CommandParameter" Value="some string value for example" /></source>.
This single value is then passed as the command parameter instead of the entire KeyValueList.
 
[[Category:Client|XAML Tips]]
[[Category:WinX|XAML Tips]]
=== SetPropertyValueCommand {{Version/WinXSince|3.6}} ===