Changes

Multi Select (UBIK Client)

4,335 bytes added, 12 June
/* Multi select for filtered lists */ Added more clear note to the final Hint
</tab>
</tabs>
 
In XAML code, you can use <code>ListViewModel.BulkOperation.ToggleMultiSelectCommand</code> to (de)activate the multi select mode.
{{Hint|If the property being edited has various values, a default value (instead of the actual ones) is shown in the editor. E.g. empty for string type, false for boolean type, etc.}}
 
Further editing of Link properties is currently not supported for multiple objects. Although the related button in the Guid editor dialog is clickable, it is currently inoperable. Also the ''Skipping the dialog'' feature (see [https://wiki.augmensys.com/index.php?title=Editors#Guid_editor| Guid Editor Wiki]) is currently not supported in Multi Select mode.
 
 
 
 
The multi select related XAML code (essentially <code>ListViewModel.BulkOperation</code>) in the standard UI can not be used directly in such scenarios. Because all filtered lists share the same original source list (<code>ListViewModel</code>). If the multi select feature is turned on from the original source list, all filtered lists will be affected.
For example, a source list can be divided into two filtered lists, one for finished tasks and the other for the unfinished ones. If you use the <code>ListViewModel.BulkOperation.SelectAllCommand</code>, it will select all tasks even though in the UI it will appear as if only those finished/unfinished are selected. To avoid such a situation, the multi select feature should be turned on from the filtered lists instead. This means the following types:* UWP: ListCollectionView;* Xamarin: SfDataSourceExt. Here's also an example of multi select related XAML code adapted for a filtered list.
'''UNDER CONSTRUCTION'''
<tabs>
<tab name="UWP">
<source lang = "xml">
<StackPanel Grid xmlns:cv="using:UBIK.WinX.UI.CollectionView" xmlns:ctrlscontrols="using:UBIK.WinX.Controls" xmlns:interactivity="using:Microsoft.Xaml.Interactivity" xmlns:core="using:Microsoft.Xaml.Interactions.Core"> <ctrls:EvalExpressionGrid.Resources> <x:String x:NameKey="EvaluatorFilterExpression">Item.Header.ToLower().Contains(&quot;1&quot;)==true</x:String> Context <cv:ListCollectionView x:Key="FilteredList" Expression="{StaticResource FilterExpression}" ItemsSource="{BindingChildren.Items}"/> </Grid.Resources>  ... <!-- Multi Select Panel --> <ContentControl Expression... ContentTemplate="Context.Values{Binding TemplateService[&quot;LK_OFFLINE&quot;UBIKMultiSelectPanel]!}" DataContext=null || Context"{StaticResource FilteredList}" Visibility="{Binding BulkOperation.Values[&quot;GUIDREF&quot;]!ItemSelectionMode, Source=null{StaticResource FilteredList}, Converter={StaticResource EqualToVisConverter}, ConverterParameter=Multiple, FallbackValue=Collapsed, TargetNullValue=Collapsed}" > </ContentControl ... <TextBlock!-- Filtered List --> <controls:SelectionBoundListView ForegroundIsItemClickEnabled="WhiteFalse" TextItemsSource="Some Text{StaticResource FilteredList}" VisibilitySelectionMode="{Binding ElementNameBulkOperation.ItemSelectionMode, Source=Evaluator{StaticResource FilteredList}, PathConverter=Result{StaticResource ChildItemSelectionModeToListViewSelectionModeConverter}}"> <interactivity:Interaction.Behaviors> <core:EventTriggerBehavior EventName="SelectionChanged"> <core:InvokeCommandAction Command="{Binding BulkOperation.ItemSelectionChangedCommand, Source={StaticResource FilteredList}}" InputConverter="{StaticResource SelectionChangedEventArgsConverter}" /> </core:EventTriggerBehavior> </interactivity:Interaction.Behaviors> </controls:SelectionBoundListView>  ... <!-- Multi Select Toggle Button --> <Button ... Command="{Binding BulkOperation.ToggleMultiSelectCommand, Source={StaticResource FilteredList}}" Visibility="{Binding BulkOperation.ItemSelectionMode, Source={StaticResource FilteredList}, Converter={StaticResource BoolToVisConverterEqualToVisConverter}, ConverterParameter=None}" /> </StackPanelGrid>
</source>
The TextBlock should be visible as long as at least one of the context object's two named properties has a value.
</tab>
<tab name="Xamarin">
<source lang = "xml">
<StackLayout Grid xmlns:ctrlscontrols="clr-namespace:UBIK.CPL.Controls;assembly=UBIK.CPL" xmlns:behaviors="clr-namespace:UBIK.CPL.Behaviors;assembly=UBIK.CPL"> <ctrls:EvalExpressionContentView.Resources> <ResourceDictionary> <x:NameString x:Key="EvaluatorExpresssion">Item.Header.ToLower().Contains(&quot;1&quot;)==false</x:String> <controls:SfDataSourceExt x:Key="FilteredList" Expression="{StaticResource Expresssion}" ItemsSource="{Binding Children.Items}" Unloaded="{Binding SkipFiltering}" /> </ResourceDictionary> </ContentView.Resources>  ... <!-- Filtered List --> <controls:SfListViewExt ... ContextItemsSource="{BindingDisplayItems, Source={StaticResource FilteredList}}" ExpressionSelectionGesture="ContextTap" SelectionMode="{Binding BulkOperation.Values[&quot;LK_EXAMPLE&quot;]!ItemSelectionMode, Source=null || Context{StaticResource FilteredList}, Converter={StaticResource SelectionModeConverter}}"> <controls:SfListViewExt.Values[&quot;GUIDREF&quot;]!Behaviors> <behaviors:EventHandlerBehavior EventName=null"SelectionChanged"> <behaviors:InvokeCommandAction Command="{Binding BulkOperation.ItemSelectionChangedCommand, Source={StaticResource FilteredList}}" Converter="{StaticResource SelectionChangedEventArgsConverter}" /> <Label/behaviors:EventHandlerBehavior> TextColor ... <behaviors:EventHandlerBehavior EventName="#00000ItemHolding"> IsVisible <behaviors:InvokeCommandAction Command="{Binding Path=ResultBulkOperation.ToggleMultiSelectCommand, Source={xStaticResource FilteredList}}" /> </behaviors:Reference EvaluatorEventHandlerBehavior> </controls:SfListViewExt.Behaviors> </controls:SfListViewExt>  ... <!-- Multi Select Panel --> <ContentView ... BindingContext="{StaticResource FilteredList}" ControlTemplate="{StaticResource UBIKMultiSelectTemplate}" IsVisible="{Binding BulkOperation.ItemSelectionMode, Converter={StaticResource BoolToBoolEqualityToBool}, ConverterParameter=Multiple, FallbackValue=false, TargetNullValue=false}" /> </StackLayoutGrid>
</source>
The Label should be visible as long as at least one of the context object's two named properties has a value.
</tab>
</tabs>
{{Hint|The critical part is that wherever the <code>BulkOperation</code> property is accessed, it must be accessed from the <code>FilteredList</code>, not the original unfiltered <code>Children.Items</code> collection. When all references have been updated, the only remaining reference to 'Children''UNDER CONSTRUCTION'''should be in FilteredList, as the ItemsSource attribute.}}
[[Category:Client|Multi Select (UBIK Client)]]
[[Category:Version 4.3|Multi Select (UBIK Client)]]
[[Category:WinX|Mass Edit (UBIK WinX)]]
[[Category:XAML|Multi Select (UBIK Client)]]
[[Category:Xamarin|Multi Select (UBIK Client)]]
650
edits

Help improve this page!