Changes

Xamarin XAML

1,273 bytes added, 14:41, 4 December 2020
/* Custom Templates */
{{Attention|Templates defined in separate files will override templates defined in the ''UBIKThemes.xamlx''!}}
 
=== Bindings in resources ===
When using bindings such as [[Xamarin_XAML#Content_filtering|this]] in a resource located in a custom template, it is necessary to place the template in a UBIKContentView.
 
{{Hint|Technically speaking, this is because bindable objects in the ResourceDictionary of a ContentView (the custom template) don't automatically inherit the BindingContext from the container/parent view. UBIKContentView is created to additionally do that.}}
 
<source lang = "xml">
<!-- UBIKCustomView -->
<ContentView...
xmlns:controls="clr-namespace:UBIK.CPL.Controls;assembly=UBIK.CPL">
<ContentView.Resources>
<ResourceDictionary>
<controls:SfDataSourceExt... ItemsSource="{Binding Children.Items}" />
</ResourceDictionary>
</ContentView.Resources>
...
</ContentView>
 
<!-- Container where UBIKCustomView is placed -->
<ContentView...
xmlns:controls="clr-namespace:UBIK.CPL.Controls;assembly=UBIK.CPL">
...
<controls:UBIKContentView Content="{Binding [UBIKCustomView], Source={x:Static services:TemplateService.Instance}}" />
</ContentView>
</source>
 
[[Category:Client|Xamarin XAML]]
[[Category:Pages with broken file links|Xamarin XAML]]
[[Category:Styling|Xamarin XAML]]
[[Category:Xamarin|Xamarin XAML]]
== Adding Images ==