More renaming
This commit is contained in:
@@ -62,17 +62,28 @@ public class ContentDialogHandler(IDispatcher dispatcher) :
|
|||||||
contentDialog.Closing -= HandleClosing;
|
contentDialog.Closing -= HandleClosing;
|
||||||
if (contentDialog.DataContext is object content)
|
if (contentDialog.DataContext is object content)
|
||||||
{
|
{
|
||||||
|
bool cancelled = false;
|
||||||
if (content is IConfirmation confirmation)
|
if (content is IConfirmation confirmation)
|
||||||
{
|
{
|
||||||
Deferral deferral = args.GetDeferral();
|
Deferral deferral = args.GetDeferral();
|
||||||
if (!await confirmation.Confirm())
|
if (!await confirmation.Confirm())
|
||||||
{
|
{
|
||||||
args.Cancel = true;
|
args.Cancel = true;
|
||||||
|
cancelled = true;
|
||||||
|
|
||||||
contentDialog.Closing += HandleClosing;
|
contentDialog.Closing += HandleClosing;
|
||||||
}
|
}
|
||||||
|
|
||||||
deferral.Complete();
|
deferral.Complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!cancelled)
|
||||||
|
{
|
||||||
|
if (content is IDeactivating deactivating)
|
||||||
|
{
|
||||||
|
await deactivating.OnDeactivating();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,17 +94,6 @@ public class ContentDialogHandler(IDispatcher dispatcher) :
|
|||||||
contentDialog.Opened -= HandleOpened;
|
contentDialog.Opened -= HandleOpened;
|
||||||
if (contentDialog.DataContext is object content)
|
if (contentDialog.DataContext is object content)
|
||||||
{
|
{
|
||||||
if (content is IDeactivatable deactivatable)
|
|
||||||
{
|
|
||||||
async void DeactivateHandler(object? sender, EventArgs args)
|
|
||||||
{
|
|
||||||
deactivatable.DeactivateHandler -= DeactivateHandler;
|
|
||||||
await dispatcher.Invoke(contentDialog.Hide);
|
|
||||||
}
|
|
||||||
|
|
||||||
deactivatable.DeactivateHandler += DeactivateHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (content is IActivated activated)
|
if (content is IActivated activated)
|
||||||
{
|
{
|
||||||
await activated.OnActivated();
|
await activated.OnActivated();
|
||||||
@@ -101,8 +101,23 @@ public class ContentDialogHandler(IDispatcher dispatcher) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async void HandleClosed(FluentAvalonia.UI.Controls.ContentDialog sender,
|
||||||
|
FluentAvalonia.UI.Controls.ContentDialogClosedEventArgs args)
|
||||||
|
{
|
||||||
|
contentDialog.Closed -= HandleClosed;
|
||||||
|
if (contentDialog.DataContext is object content)
|
||||||
|
{
|
||||||
|
if (content is IDeactivated deactivated)
|
||||||
|
{
|
||||||
|
await deactivated.OnDeactivated();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
contentDialog.Opened += HandleOpened;
|
contentDialog.Opened += HandleOpened;
|
||||||
contentDialog.Closing += HandleClosing;
|
contentDialog.Closing += HandleClosing;
|
||||||
|
contentDialog.Closed += HandleClosed;
|
||||||
|
|
||||||
contentDialog.PrimaryButtonClick += HandlePrimaryButtonClick;
|
contentDialog.PrimaryButtonClick += HandlePrimaryButtonClick;
|
||||||
contentDialog.SecondaryButtonClick += HandleSecondaryButtonClick;
|
contentDialog.SecondaryButtonClick += HandleSecondaryButtonClick;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public class AppService(IEnumerable<IInitialization> initializers,
|
|||||||
{
|
{
|
||||||
foreach (IInitialization initializer in initializers)
|
foreach (IInitialization initializer in initializers)
|
||||||
{
|
{
|
||||||
await initializer.Initialize();
|
await initializer.OnInitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
publisher.Publish<StartedEventArgs>();
|
publisher.Publish<StartedEventArgs>();
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ public class ActivityLock(IActivityIndicator activityIndicator) : AsyncLock
|
|||||||
{
|
{
|
||||||
public override TaskAwaiter<AsyncLock> GetAwaiter()
|
public override TaskAwaiter<AsyncLock> GetAwaiter()
|
||||||
{
|
{
|
||||||
activityIndicator.Active = true;
|
activityIndicator.IsActive = true;
|
||||||
return base.GetAwaiter();
|
return base.GetAwaiter();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
activityIndicator.Active = false;
|
activityIndicator.IsActive = false;
|
||||||
base.Dispose();
|
base.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class ComponentHost(IServiceProvider services,
|
|||||||
{
|
{
|
||||||
foreach (IInitialization initializer in initializers)
|
foreach (IInitialization initializer in initializers)
|
||||||
{
|
{
|
||||||
await initializer.Initialize();
|
await initializer.OnInitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (IHostedService service in hostedServices)
|
foreach (IHostedService service in hostedServices)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ public class ComponentInitializer(IEnumerable<IComponent> components,
|
|||||||
IServiceProvider provider) :
|
IServiceProvider provider) :
|
||||||
IInitialization
|
IInitialization
|
||||||
{
|
{
|
||||||
public async Task Initialize()
|
public async Task OnInitialize()
|
||||||
{
|
{
|
||||||
foreach (IComponent component in components)
|
foreach (IComponent component in components)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ public class ConfigurationInitializer<TConfiguration>(IConfigurationReader<TConf
|
|||||||
where TConfiguration :
|
where TConfiguration :
|
||||||
class
|
class
|
||||||
{
|
{
|
||||||
public Task Initialize()
|
public Task OnInitialize()
|
||||||
{
|
{
|
||||||
if (!reader.TryRead(out TConfiguration? configuration))
|
if (!reader.TryRead(out TConfiguration? configuration))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,14 +20,14 @@ public class ContentFactory(IMediator mediator,
|
|||||||
{
|
{
|
||||||
if (args is IInitialization initialization)
|
if (args is IInitialization initialization)
|
||||||
{
|
{
|
||||||
initialization.Initialize();
|
initialization.OnInitialize();
|
||||||
}
|
}
|
||||||
}, parameters)
|
}, parameters)
|
||||||
: provider.GetRequiredKeyedService(descriptor.ContentType, args =>
|
: provider.GetRequiredKeyedService(descriptor.ContentType, args =>
|
||||||
{
|
{
|
||||||
if (args is IInitialization initialization)
|
if (args is IInitialization initialization)
|
||||||
{
|
{
|
||||||
initialization.Initialize();
|
initialization.OnInitialize();
|
||||||
}
|
}
|
||||||
}, descriptor.Key);
|
}, descriptor.Key);
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,3 @@ public interface IActivated
|
|||||||
{
|
{
|
||||||
Task OnActivated();
|
Task OnActivated();
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IActivated<TResult>
|
|
||||||
{
|
|
||||||
Task Activated(TResult result);
|
|
||||||
}
|
|
||||||
@@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
public interface IActivityIndicator
|
public interface IActivityIndicator
|
||||||
{
|
{
|
||||||
bool Active { get; set; }
|
bool IsActive { get; set; }
|
||||||
}
|
}
|
||||||
@@ -4,5 +4,5 @@ public interface IConfigurationInitializer<TConfiguration>
|
|||||||
where TConfiguration :
|
where TConfiguration :
|
||||||
class
|
class
|
||||||
{
|
{
|
||||||
Task Initialize();
|
Task OnInitialize();
|
||||||
}
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
namespace Toolkit.Foundation;
|
|
||||||
|
|
||||||
public interface IDeactivatable
|
|
||||||
{
|
|
||||||
public event EventHandler? DeactivateHandler;
|
|
||||||
|
|
||||||
public Task Deactivate();
|
|
||||||
}
|
|
||||||
@@ -4,8 +4,3 @@ public interface IDeactivating
|
|||||||
{
|
{
|
||||||
Task OnDeactivating();
|
Task OnDeactivating();
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IDeactivating<TResult>
|
|
||||||
{
|
|
||||||
Task<TResult> Deactivating();
|
|
||||||
}
|
|
||||||
@@ -2,10 +2,5 @@
|
|||||||
|
|
||||||
public interface IInitialization
|
public interface IInitialization
|
||||||
{
|
{
|
||||||
Task Initialize();
|
Task OnInitialize();
|
||||||
}
|
|
||||||
|
|
||||||
public interface IInitialization<T>
|
|
||||||
{
|
|
||||||
Task<T> Initialize();
|
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,6 @@ public partial class Observable(IServiceProvider provider,
|
|||||||
IActivated,
|
IActivated,
|
||||||
IDeactivating,
|
IDeactivating,
|
||||||
IDeactivated,
|
IDeactivated,
|
||||||
IDeactivatable,
|
|
||||||
IDisposable,
|
IDisposable,
|
||||||
IServiceProviderRequired,
|
IServiceProviderRequired,
|
||||||
IServiceFactoryRequired,
|
IServiceFactoryRequired,
|
||||||
@@ -26,12 +25,10 @@ public partial class Observable(IServiceProvider provider,
|
|||||||
private readonly Dictionary<string, object> trackedProperties = [];
|
private readonly Dictionary<string, object> trackedProperties = [];
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool active;
|
private bool isActive;
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool initialized;
|
private bool isInitialized;
|
||||||
|
|
||||||
public event EventHandler? DeactivateHandler;
|
|
||||||
|
|
||||||
public IDisposer Disposer { get; } = disposer;
|
public IDisposer Disposer { get; } = disposer;
|
||||||
|
|
||||||
@@ -42,6 +39,7 @@ public partial class Observable(IServiceProvider provider,
|
|||||||
public IServiceProvider Provider { get; } = provider;
|
public IServiceProvider Provider { get; } = provider;
|
||||||
|
|
||||||
public IPublisher Publisher { get; } = publisher;
|
public IPublisher Publisher { get; } = publisher;
|
||||||
|
|
||||||
public ISubscriber Subscriber { get; } = subscriber;
|
public ISubscriber Subscriber { get; } = subscriber;
|
||||||
|
|
||||||
public void Commit()
|
public void Commit()
|
||||||
@@ -52,36 +50,40 @@ public partial class Observable(IServiceProvider provider,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task Deactivate()
|
|
||||||
{
|
|
||||||
DeactivateHandler?.Invoke(this, new EventArgs());
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void Dispose()
|
public virtual void Dispose()
|
||||||
{
|
{
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
Disposer.Dispose(this);
|
Disposer.Dispose(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual Task Initialize()
|
public virtual Task OnInitialize()
|
||||||
{
|
{
|
||||||
if (Initialized)
|
if (IsInitialized)
|
||||||
{
|
{
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
Initialized = true;
|
IsInitialized = true;
|
||||||
|
|
||||||
Subscriber.Subscribe(this);
|
Subscriber.Subscribe(this);
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual Task OnActivated() =>
|
[ObservableProperty]
|
||||||
Task.CompletedTask;
|
private bool isActivated;
|
||||||
|
|
||||||
public virtual Task OnDeactivated() =>
|
public virtual Task OnActivated()
|
||||||
Task.CompletedTask;
|
{
|
||||||
|
IsActivated = true;
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public virtual Task OnDeactivated()
|
||||||
|
{
|
||||||
|
IsActivated = false;
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
public virtual Task OnDeactivating() =>
|
public virtual Task OnDeactivating() =>
|
||||||
Task.CompletedTask;
|
Task.CompletedTask;
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ public partial class ObservableCollection<TItem> :
|
|||||||
IActivated,
|
IActivated,
|
||||||
IDeactivating,
|
IDeactivating,
|
||||||
IDeactivated,
|
IDeactivated,
|
||||||
IDeactivatable,
|
|
||||||
IList<TItem>,
|
IList<TItem>,
|
||||||
IList,
|
IList,
|
||||||
IReadOnlyList<TItem>,
|
IReadOnlyList<TItem>,
|
||||||
@@ -42,16 +41,16 @@ public partial class ObservableCollection<TItem> :
|
|||||||
|
|
||||||
private readonly Dictionary<string, object> trackedProperties = [];
|
private readonly Dictionary<string, object> trackedProperties = [];
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
private bool activated;
|
|
||||||
|
|
||||||
private bool clearing;
|
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private int count;
|
private int count;
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool initialized;
|
private bool isActivated;
|
||||||
|
|
||||||
|
private bool isClearing;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private bool isInitialized;
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private TItem? selectedItem;
|
private TItem? selectedItem;
|
||||||
@@ -97,8 +96,6 @@ public partial class ObservableCollection<TItem> :
|
|||||||
|
|
||||||
public event NotifyCollectionChangedEventHandler? CollectionChanged;
|
public event NotifyCollectionChangedEventHandler? CollectionChanged;
|
||||||
|
|
||||||
public event EventHandler? DeactivateHandler;
|
|
||||||
|
|
||||||
public IDisposer Disposer { get; private set; }
|
public IDisposer Disposer { get; private set; }
|
||||||
|
|
||||||
public IServiceFactory Factory { get; private set; }
|
public IServiceFactory Factory { get; private set; }
|
||||||
@@ -154,7 +151,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
{
|
{
|
||||||
if (args is IInitialization initialization)
|
if (args is IInitialization initialization)
|
||||||
{
|
{
|
||||||
initialization.Initialize();
|
initialization.OnInitialize();
|
||||||
}
|
}
|
||||||
}, parameters);
|
}, parameters);
|
||||||
|
|
||||||
@@ -210,7 +207,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
|
|
||||||
public void Clear()
|
public void Clear()
|
||||||
{
|
{
|
||||||
clearing = true;
|
isClearing = true;
|
||||||
|
|
||||||
foreach (TItem item in this.ToList())
|
foreach (TItem item in this.ToList())
|
||||||
{
|
{
|
||||||
@@ -219,7 +216,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
}
|
}
|
||||||
|
|
||||||
ClearItems();
|
ClearItems();
|
||||||
clearing = false;
|
isClearing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Commit()
|
public void Commit()
|
||||||
@@ -242,12 +239,6 @@ public partial class ObservableCollection<TItem> :
|
|||||||
void ICollection.CopyTo(Array array, int index) =>
|
void ICollection.CopyTo(Array array, int index) =>
|
||||||
collection.CopyTo((TItem[])array, index);
|
collection.CopyTo((TItem[])array, index);
|
||||||
|
|
||||||
public Task Deactivate()
|
|
||||||
{
|
|
||||||
DeactivateHandler?.Invoke(this, new EventArgs());
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void Dispose()
|
public virtual void Dispose()
|
||||||
{
|
{
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
@@ -274,7 +265,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
|
|
||||||
public Task Handle(RemoveEventArgs<TItem> args)
|
public Task Handle(RemoveEventArgs<TItem> args)
|
||||||
{
|
{
|
||||||
if (Activated)
|
if (IsActivated)
|
||||||
{
|
{
|
||||||
foreach (TItem item in this.ToList())
|
foreach (TItem item in this.ToList())
|
||||||
{
|
{
|
||||||
@@ -294,7 +285,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
|
|
||||||
public Task Handle(CreateEventArgs<TItem> args)
|
public Task Handle(CreateEventArgs<TItem> args)
|
||||||
{
|
{
|
||||||
if (Activated)
|
if (IsActivated)
|
||||||
{
|
{
|
||||||
if (args.Sender is TItem item)
|
if (args.Sender is TItem item)
|
||||||
{
|
{
|
||||||
@@ -311,7 +302,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
|
|
||||||
public Task Handle(InsertEventArgs<TItem> args)
|
public Task Handle(InsertEventArgs<TItem> args)
|
||||||
{
|
{
|
||||||
if (Activated)
|
if (IsActivated)
|
||||||
{
|
{
|
||||||
if (args.Sender is TItem item)
|
if (args.Sender is TItem item)
|
||||||
{
|
{
|
||||||
@@ -328,7 +319,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
|
|
||||||
public Task Handle(MoveToEventArgs<TItem> args)
|
public Task Handle(MoveToEventArgs<TItem> args)
|
||||||
{
|
{
|
||||||
if (Activated)
|
if (IsActivated)
|
||||||
{
|
{
|
||||||
Move(args.OldIndex, args.NewIndex);
|
Move(args.OldIndex, args.NewIndex);
|
||||||
}
|
}
|
||||||
@@ -342,7 +333,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
|
|
||||||
public Task Handle(MoveEventArgs<TItem> args)
|
public Task Handle(MoveEventArgs<TItem> args)
|
||||||
{
|
{
|
||||||
if (Activated)
|
if (IsActivated)
|
||||||
{
|
{
|
||||||
if (args.Sender is TItem item)
|
if (args.Sender is TItem item)
|
||||||
{
|
{
|
||||||
@@ -359,7 +350,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
|
|
||||||
public Task Handle(ReplaceEventArgs<TItem> args)
|
public Task Handle(ReplaceEventArgs<TItem> args)
|
||||||
{
|
{
|
||||||
if (Activated)
|
if (IsActivated)
|
||||||
{
|
{
|
||||||
if (args.Sender is TItem item)
|
if (args.Sender is TItem item)
|
||||||
{
|
{
|
||||||
@@ -376,7 +367,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
|
|
||||||
public Task Handle(RemoveAtEventArgs<TItem> args)
|
public Task Handle(RemoveAtEventArgs<TItem> args)
|
||||||
{
|
{
|
||||||
if (Activated)
|
if (IsActivated)
|
||||||
{
|
{
|
||||||
int index = args.Index;
|
int index = args.Index;
|
||||||
if (index >= 0 && index <= Count - 1)
|
if (index >= 0 && index <= Count - 1)
|
||||||
@@ -403,21 +394,6 @@ public partial class ObservableCollection<TItem> :
|
|||||||
IsCompatibleObject(value) ?
|
IsCompatibleObject(value) ?
|
||||||
IndexOf((TItem)value!) : -1;
|
IndexOf((TItem)value!) : -1;
|
||||||
|
|
||||||
public virtual Task Initialize()
|
|
||||||
{
|
|
||||||
if (Initialized)
|
|
||||||
{
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
Initialized = true;
|
|
||||||
|
|
||||||
Subscriber.Subscribe(this);
|
|
||||||
Synchronize();
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TItem Insert<T>(int index = 0,
|
public TItem Insert<T>(int index = 0,
|
||||||
params object?[] parameters)
|
params object?[] parameters)
|
||||||
where T :
|
where T :
|
||||||
@@ -427,7 +403,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
{
|
{
|
||||||
if (args is IInitialization initialization)
|
if (args is IInitialization initialization)
|
||||||
{
|
{
|
||||||
initialization.Initialize();
|
initialization.OnInitialize();
|
||||||
}
|
}
|
||||||
}, parameters);
|
}, parameters);
|
||||||
|
|
||||||
@@ -504,7 +480,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
|
|
||||||
public virtual Task OnActivated()
|
public virtual Task OnActivated()
|
||||||
{
|
{
|
||||||
Activated = true;
|
IsActivated = true;
|
||||||
while (pendingEvents.Count > 0)
|
while (pendingEvents.Count > 0)
|
||||||
{
|
{
|
||||||
object current = pendingEvents.Dequeue();
|
object current = pendingEvents.Dequeue();
|
||||||
@@ -516,13 +492,27 @@ public partial class ObservableCollection<TItem> :
|
|||||||
|
|
||||||
public virtual Task OnDeactivated()
|
public virtual Task OnDeactivated()
|
||||||
{
|
{
|
||||||
Activated = false;
|
IsActivated = false;
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual Task OnDeactivating() =>
|
public virtual Task OnDeactivating() =>
|
||||||
Task.CompletedTask;
|
Task.CompletedTask;
|
||||||
|
|
||||||
|
public virtual Task OnInitialize()
|
||||||
|
{
|
||||||
|
if (IsInitialized)
|
||||||
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
IsInitialized = true;
|
||||||
|
|
||||||
|
Subscriber.Subscribe(this);
|
||||||
|
Synchronize();
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
public bool Remove(TItem item)
|
public bool Remove(TItem item)
|
||||||
{
|
{
|
||||||
int index = collection.IndexOf(item);
|
int index = collection.IndexOf(item);
|
||||||
@@ -612,7 +602,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
Disposer.Add(this, item);
|
Disposer.Add(this, item);
|
||||||
Disposer.Add(item, Disposable.Create(() =>
|
Disposer.Add(item, Disposable.Create(() =>
|
||||||
{
|
{
|
||||||
if (item is IRemovable && !clearing)
|
if (item is IRemovable && !isClearing)
|
||||||
{
|
{
|
||||||
if (item is IList collection)
|
if (item is IList collection)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user