Changes

XAML Tips

339 bytes added, 12:11, 28 November 2019
{{Attention|The command specified through the "Command" parameter is executed on list items and, therefore, must be available in the list item contexts (view models). If in doubt, the [[Developer_Mode|developer mode]] can be used to inspect if a command is available in a certain context.}}
 
{{Hint|Parameter "Command" and "SelectedItemsOnly" are specific to the InvokeForAllItemsCommand. What other parameters to define or whether to define them at all depends on the type of command to be executed on the items.}}
==== Invoke on selected items ====
<br />
With the filtered list configured, you can then insert the following code snippet to execute the SetPropertyValueAndValidateCommand 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.
<br />
<source lang = "xml">
<example:KeyValueList>
<example:KeyValueParameter Key="Command" Value="SetPropertyValueAndValidateCommand" />
<example:KeyValueParameter Key="SelectedItemsOnly" Value="True" />
<example:KeyValueParameter Key="PropertyName" Value="VALUE" />
<example:KeyValueParameter Key="PropertyValue" Value="50" />