Jump to: navigation, search

Changes


XAML Tips

738 bytes added, 5 September
/* Set a Binding as PropertyValue */ Added mobile syntax example
Luckily, there is a simple way to link this Binding to a context. Using the above example as a foundation, adapt the button as shown below:
<tabs>
<tab name="UWP">
<source lang = "xml">
<Button
</Button>
</source>
</tab>
 
<tab name="Xamarin / Maui">
<source lang = "xml">
<Button
x:Name="SetDynamicPropertyButton"
... >
<Button.CommandParameter>
<classes:KeyValueList>
...
<classes:KeyValueParameter Key="PropertyValue" Value="{Binding BindingContext.BindingPath, Source={x:Reference SetDynamicPropertyButton}}" />
...
</classes:KeyValueList>
</Button.CommandParameter>
</Button>
</source>
</tab>
 
{{Hint|Replace ''BindingPath'' with your desired binding, such as ''AppStatus.CurrentLogin.RawDetails[...]'' etc.}}
</tabs>
The above code uses the x:Name of the button to specify the viewmodel from which we wish to begin our binding path.<br>
You do not need to follow this exact syntax, all that is necessary is to provide a connection to the BindingContext of an observable any named controlobservable by this button.
[[Category:Client|XAML Tips]]
[[Category:WinX|XAML Tips]]
[[Category:XAML|XAML Tips]]
[[Category:Xamarin|XAML Tips]]
==== Set Current DateTime ====
696
edits