Changes

Active List Client

2,721 bytes added, Yesterday at 13:32
/* XAML */
=== XAML ===
A new SelectiveItems property was added to the PropertyViewModel to enable access to an ActiveList via XAML. No DataTriggers or additional checks are required, as the correct list selection is handled automatically. As also mentioned [[UBIK_WinX_Client_Basics#Selective_List_Properties|here]], the following XAML changes are necessary: '''Required adaptions of the ''ItemsSource'' binding:'''If you have old customizings, the '''ItemsSource''' binding needs to be adapted. Instead of binding to the ''PropertyViewModel'' and using the ''SelectiveListToItemsConverter'', you should now directly bind to ''PropertyViewModel.SelectiveItems'' without the use of a SelectiveListToItemsConverter. In the case of previously binding to ''MetaProperty.SelectiveList.Items'' (or ''MetaProperty.SelectiveList'' plus using the ''SelectiveListToItemsConverter''), the binding should be changed to ''SelectiveItems'' only.Depending on whether a SelectiveList or an ActiveList is configured, the proper list will be chosen automatically. '''Optional refactoring of the ''SelectedItem ConverterParameter'' binding (Mobile only):'''Instead of binding to the ContentView x:Name (e.g. ''ConverterParameter={Binding Source={x:Reference YourContentView}}''), it is now possible to bind to the x:Name of the SfListViewExt control and adding the ItemsSource as Path (e.g. ''ConverterParameter={Binding Source={x:Reference SelectiveList}, Path=ItemsSource}'').
<tabs>
DisplayMemberPath="DisplayText"
ItemsSource="{Binding PropertyViewModel.SelectiveItems}"
PlaceholderText="{Binding PropertyEdit_PickerPlaceholder, Source={StaticResource AppResources}}"
SelectedValue="{Binding PropertyValue, Mode=TwoWay}"
SelectedValuePath="Value"
Visibility="{Binding PropertyViewModel.ShowComboBox, Converter={StaticResource BoolToVisConverter}}" />
</source>
</tab>
 
<tab name="Mobile (MAUI) before change">
<source lang = "xml">
xmlns:controls="clr-namespace:UBIK.MAUI.Controls"
 
<ContentView x:Name="YourContentView" ...>
<controls:SfListViewExt
x:Name="SelectiveList"
BindingContext="{TemplateBinding BindingContext}"
ItemSize="40"
ItemTemplate="{StaticResource PopupSelectiveListItemTemplate}"
ItemsSource="{Binding PropertyViewModel, Converter={StaticResource SelectiveListToItemsConverter}}"
SelectedItem="{Binding ValueItem.PropertyValue, Mode=OneWay, Converter={StaticResource PropertyValueToSelectiveItem}, ConverterParameter={Binding Source={x:Reference YourContentView}}}"
SelectionBackground="{DynamicResource UBIKAccentColor}"
SelectionMode="Single"
Style="{DynamicResource UBIKListView}" />
...
</ContentView>
</source>
</tab>
<tab name="UWP before change">
<source lang = "xml">
xmlns:controls="using:UBIK.WinX.Controls"
 
<controls:ComboBoxExt
x:Name="ComboBox"
Grid.ColumnSpan="2"
HorizontalAlignment="Stretch"
DisplayMemberPath="DisplayText"
ItemsSource="{Binding PropertyViewModel, Converter={StaticResource SelectiveListToItemsConverter}}"
PlaceholderText="{Binding PropertyEdit_PickerPlaceholder, Source={StaticResource AppResources}}"
SelectedValue="{Binding PropertyValue, Mode=TwoWay}"
710
edits