Jump to: navigation, search

Changes


XAML Tips

714 bytes added, 7 September
/* Default Tab Selection */
</tab>
<tab name="Mobile(Maui)">
tbd!Since {{Version/MobileSince|5.3}}, adding the classification to a metaclass is enough for Mobile. Prior this version, it is additionally necessary to bind the TabSelector to the SelectedIndex as follows:<source lang = "xml"><controls:UBIKTabView ... SelectedIndex="{Binding TabSelector}"> ...</controls:UBIKTabView></source> 
</tab>
<tab name="Mobile(Xamarin)">
<br>
<br>
 
{{Attention|The default tab preselection with the TabSelector and the Classifications only works with the default tab set (Children, Properties, Documents - in this order). If a tab is added, removed, or reordered, there need to be some Xaml adaptations in order to work, see [[XAML_Tips#Preselection_of_customized_Tabs|Preselection of customized Tabs]].}}
==== Preselection of customized Tabs ====
The TabSelector approach shown above only works with the default tab set (Children, Properties, Documents- in this order). If a tab is added, removed, or reordered, this default mechanism can no longer be relied on. The example below shows how a customized tab can be preselected in such cases, without losing the functionality of the TabSelector.
{{Hint|TabSelector is an enum (index 0 -> ChildrenTab, index 1 -> PropertiesTab, index 2 -> DocumentsTab). In the Mobile Client, tabs are selected by their position in the list (0, 1, 2, ...), which only matches the enum index in the default tab set. Once tabs are added, removed, or reordered, the Expression needs to translate each TabSelector value into the tab's actual position in the current layout, as shown in the example below. UWP matches tabs by name instead, so no such mapping is needed there.}}
791
edits