Jump to: navigation, search

Changes


XAML Tips

1,055 bytes added, 17 January
{{Attention|The binding <code>ListViewModel.InvokeOnItemsCommand</code> should be updated to <code>BulkOperation.InvokeOnItemsCommand</code> starting from version 4.3.}}
[[Category:Client|XAML Tips]][[Category:WinX|XAML Tips]][[Category:XAML|XAML Tips]][[Category:Xamarin|XAML Tips]]
==== Support for old styled commands ====
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}} ===
This command existed before but was implemented differently. In the newer version(s), it is improved to provide customizers more control over the things that happen during/after the property value changes.
The available commnad command parameters are:
* PropertyName: the name of the property to set a new value to;
* PropertyValue: the value to be set to the above mentioned property;
** True: The change is saved.
<br/> {{hint| Make sure you use the correct binding path for your command depending on your current context view model. E.g., if the context view model is already the ContentViewModel then your binding path should simply be TeachInCommand. You can use the [[Developer_Mode|developer mode]] to find out the current view model in a view.}}
 
 
===UpdateArbitraryObjectCommand {{Version/WinXSince|4.6}}===
The "UpdateArbitraryObjectCommand" is responsible for updating an arbitrary object based on a set of provided parameters.
<br />
The available command parameters are:
* Uid (Mandatory): UID of the object to be updated;
* UpdateChildDepth (Optional): Child depth/level to update (defaults to 1);
* UpdateParentDepth (Optional): Parent depth/level to update (defaults to 0);
* UpdateIgnoreExpiry (Optional): Ignore update expiry (defaults to false);
 
{{Hint|Note that if you set the UpdateChildDepth property to "-1" you are also able to update a whole branch with this command.}}
 
Here is an example of the command usage:
<br />
<source lang = "xml">
<Button ...
xmlns:uc="using:UBIK.WinX.Controls"
Command="{Binding UpdateArbitraryObjectCommand}"
Content="Update Arbitrary Object">
<Button.CommandParameter>
<uc:KeyValueList>
<uc:KeyValueParameter Key="Uid" Value="...valid UID..." />
<uc:KeyValueParameter Key="UpdateChildDepth" Value="2" />
<uc:KeyValueParameter Key="UpdateParentDepth" Value="0" />
<uc:KeyValueParameter Key="UpdateIgnoreExpiry" Value="true" />
</uc:KeyValueList>
</Button.CommandParameter>
</Button>
</source>
60
edits