Changes
/* Context Switching And Templates */ restructured and added UWP example
==== Context Switching And Templates ====
As described in the previous section, DataTemplates are designed to be used as templates for data contexts, therefore the content control used to render them, controls:ContentControl, has the TemplateContext property which allows you to set the binding context '''for the template'''. The important difference to note is that the controls:ContentControl itself will not use the TemplateContext, but rather the inherited context from its hosting xaml.
Because they are independent of each other, it allows more sophisticated usage of binding contexts, for example, when ''Object A'' has ''Status B'', show ''Property C''.
<tabs>
<tab name="UWP">
<source lang = "xml">
<ContentControl (displayed on child area of Object A)
Visibility="{Binding Values[STATUS], Converter={StaticResource EqualToVisConverter}, ConverterParameter=B}"
Content="{Binding PropertyItems[PROPERTYC]}"
ContentTemplate="{StaticResource MyPropertyTemplate}" />
</source>
</tab>
<tab name="Xamarin">
<source lang = "xml">
<controls:ContentControl (displayed on child area of Object A)
IsVisible="{Binding Values[STATUS], Converter={StaticResource EqualityToBool}, ConverterParameter=B}"
</source>
</tab>
</tabs>
<source lang = "xml">
<ContentView (displayed on child area of Object A)
BindingContext="{Binding PropertyItems[PROPERTYC]}"
ControlTemplate="{StaticResource MyOtherPropertyTemplate}" />
</source>
</tab>
</tabs>
{{Hint|CallingViewModel (as used on the IsVisible attribute) can be added to a metaproperty's binding path to bind to its context object.}}
{{UnderConstructionEndAttention|Remember that Styling in Xaml is type-based, so you cannot use the same template with controls:ContentControl (ContentTemplate attribute) and ContentView (ControlTemplate attribute), as DataTemplate and ControlTemplate are technically different types.}}
{{UnderConstructionEnd}}
[[Category:Pages with broken file links|XAML Best practices]]
[[Category:XAML|XAML Best practices]]
== Performance ==
