|
@@ -10,6 +10,7 @@ using InABox.Avalonia.Converters;
|
|
|
using InABox.Core;
|
|
|
using System;
|
|
|
using System.Globalization;
|
|
|
+using System.Linq;
|
|
|
using System.Threading.Tasks;
|
|
|
using System.Windows.Input;
|
|
|
|
|
@@ -64,6 +65,9 @@ public partial class FormsList : UserControl
|
|
|
public static readonly StyledProperty<bool> SeparateHistoryProperty =
|
|
|
AvaloniaProperty.Register<FormsList, bool>(nameof(SeparateHistory), true);
|
|
|
|
|
|
+ public static readonly StyledProperty<bool> SelectionMenuVisibleProperty =
|
|
|
+ AvaloniaProperty.Register<FormsList, bool>(nameof(SelectionMenuVisible), true);
|
|
|
+
|
|
|
public string SearchText { get; set; }
|
|
|
|
|
|
public bool SeparateHistory
|
|
@@ -72,6 +76,12 @@ public partial class FormsList : UserControl
|
|
|
set => SetValue(SeparateHistoryProperty, value);
|
|
|
}
|
|
|
|
|
|
+ public bool SelectionMenuVisible
|
|
|
+ {
|
|
|
+ get => GetValue(SelectionMenuVisibleProperty);
|
|
|
+ set => SetValue(SelectionMenuVisibleProperty, value);
|
|
|
+ }
|
|
|
+
|
|
|
public static readonly StyledProperty<ICoreRepository?> ModelProperty =
|
|
|
AvaloniaProperty.Register<FormsList, ICoreRepository?>(nameof(Model));
|
|
|
|
|
@@ -97,6 +107,13 @@ public partial class FormsList : UserControl
|
|
|
{
|
|
|
}
|
|
|
|
|
|
+ [RelayCommand]
|
|
|
+ private void FormChecked(IDigitalFormInstanceShell form)
|
|
|
+ {
|
|
|
+ Model?.ToggleSelection(form);
|
|
|
+ SelectionMenuVisible = Model?.SelectedItems.OfType<IShell>().Any() == true;
|
|
|
+ }
|
|
|
+
|
|
|
[RelayCommand]
|
|
|
private void SelectionMenu(IDigitalFormInstanceShell form)
|
|
|
{
|