This commit is contained in:
neuecc 2024-02-15 17:21:09 +09:00
parent 17ae2c400a
commit f8379ac6d9
3 changed files with 3 additions and 5 deletions

View File

@ -18,8 +18,6 @@ list.Add(20);
list.AddRange(new[] { 10, 20, 30 }); list.AddRange(new[] { 10, 20, 30 });
return;

View File

@ -23,7 +23,7 @@ namespace WpfApp
public partial class MainWindow : Window public partial class MainWindow : Window
{ {
ObservableList<int> list; ObservableList<int> list;
public ISynchronizedView<int, int> ItemsView { get; set; } public INotifyCollectionChangedSynchronizedView<int> ItemsView { get; set; }
public MainWindow() public MainWindow()
{ {
@ -35,7 +35,7 @@ namespace WpfApp
list = new ObservableList<int>(); list = new ObservableList<int>();
list.AddRange(new[] { 1, 10, 188 }); list.AddRange(new[] { 1, 10, 188 });
ItemsView = list.CreateSortedView(x => x, x => x, comparer: Comparer<int>.Default).WithINotifyCollectionChanged(); ItemsView = list.CreateSortedView(x => x, x => x, comparer: Comparer<int>.Default).ToNotifyCollectionChanged();
BindingOperations.EnableCollectionSynchronization(ItemsView, new object()); BindingOperations.EnableCollectionSynchronization(ItemsView, new object());

View File

@ -45,7 +45,7 @@ namespace ObservableCollections
//{ //{
//} //}
public interface INotifyCollectionChangedSynchronizedView<out TView> : IReadOnlyCollection<TView>, INotifyCollectionChanged, INotifyPropertyChanged public interface INotifyCollectionChangedSynchronizedView<out TView> : IReadOnlyCollection<TView>, INotifyCollectionChanged, INotifyPropertyChanged, IDisposable
{ {
} }