Jump to: navigation, search

Changes


XAML Tips

1,073 bytes added, 10:28, 6 November 2023
/* Functionality related */
[[Category:Client|XAML Tips]][[Category:WinX|XAML Tips]][[Category:XAML|XAML Tips]][[Category:Xamarin|XAML Tips]]
=== Content creation ===
{{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 ====
** 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.}}
 
 
=== Object by UID ===
With the ObjectByUID feature it is possible to access any local arbitrary object by its UID and display a value of it.
It can be accessed from ContentViewModel, AuthenticationViewModel, and RootPageViewModel levels.
 
To display a string of e.g. a property of an arbitrary object from ContentViewModel, AuthenticationViewModel & RootPageViewModel, the following syntax can be used in related XAMLs:
<tabs>
<tab name="UWP">
<source lang = "xml">
<TextBlock Text="{Binding ObjectByUID[5343cb08-e296-4a22-bd4d-d4fe3f18823d].Properties.VisibleItems[Name].DisplayValue}" />
</source>
</tab>
 
<tab name="Xamarin">
<source lang = "xml">
<Label Text="{Binding ObjectByUID[5343cb08-e296-4a22-bd4d-d4fe3f18823d].Properties.VisibleItems[Name].DisplayValue}" />
</source>
</tab>
</tabs>
 
For Property Dialogs the CallingViewModel prefix is needed to access an arbitrary object:
<tabs>
<tab name="UWP">
<source lang = "xml">
<TextBlock Text="{Binding CallingViewModel.ObjectByUID[5343cb08-e296-4a22-bd4d-d4fe3f18823d].Properties.VisibleItems[Name].DisplayValue}" />
</source>
</tab>
 
<tab name="Xamarin">
<source lang = "xml">
<Label Text="{Binding CallingViewModel.ObjectByUID[5343cb08-e296-4a22-bd4d-d4fe3f18823d].Properties.VisibleItems[Name].DisplayValue}" />
</source>
</tab>
</tabs>
[[Category:Client|XAML Tips]]
337
edits