feat: 1. update container state from selection collection change.
2. Add popup slot. 3. fix various binding relative resource issue. 4. update empty pseudo-class handing, simplify watermark visibility.
This commit is contained in:
@@ -1,12 +1,44 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Input;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace Ursa.Demo.ViewModels;
|
||||
|
||||
public class MultiComboBoxDemoViewModel: ObservableObject
|
||||
{
|
||||
public ObservableCollection<string> Items { get; set; }
|
||||
|
||||
public ObservableCollection<string> SelectedItems { get; set; }
|
||||
|
||||
public ICommand SelectAllCommand => new RelayCommand(() =>
|
||||
{
|
||||
SelectedItems.Clear();
|
||||
foreach (var item in Items)
|
||||
{
|
||||
SelectedItems.Add(item);
|
||||
}
|
||||
});
|
||||
|
||||
public ICommand ClearAllCommand => new RelayCommand(() =>
|
||||
{
|
||||
SelectedItems.Clear();
|
||||
});
|
||||
|
||||
public ICommand InvertSelectionCommand => new RelayCommand(() =>
|
||||
{
|
||||
var selectedItems = new List<string>(SelectedItems);
|
||||
SelectedItems.Clear();
|
||||
foreach (var item in Items)
|
||||
{
|
||||
if (!selectedItems.Contains(item))
|
||||
{
|
||||
SelectedItems.Add(item);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
public MultiComboBoxDemoViewModel()
|
||||
{
|
||||
Items = new ObservableCollection<string>()
|
||||
@@ -47,5 +79,6 @@ public class MultiComboBoxDemoViewModel: ObservableObject
|
||||
"Pennsylvania",
|
||||
"Rhode Island",
|
||||
};
|
||||
SelectedItems = new ObservableCollection<string>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user