ignore changes while executing event

This commit is contained in:
Schedel Pascal
2024-07-15 14:23:24 +02:00
parent 636e80f54b
commit 6a16010d17

View File

@@ -22,8 +22,8 @@ partial class RadFlyoutBase
remove => flyoutCloseHandlers.Remove(value); remove => flyoutCloseHandlers.Remove(value);
} }
private static readonly List<FlyoutCreatedEventHandler> flyoutCreatedHandlers = new(); private static readonly List<FlyoutCreatedEventHandler> flyoutCreatedHandlers = [];
private static readonly List<FlyoutClosedEventHandler> flyoutCloseHandlers = new(); private static readonly List<FlyoutClosedEventHandler> flyoutCloseHandlers = [];
private static object? tagToAssign = null; private static object? tagToAssign = null;
private static string? titleToAssing = null; private static string? titleToAssing = null;
@@ -55,7 +55,7 @@ partial class RadFlyoutBase
if (dialogBase is ILoadContent iLoadContent) if (dialogBase is ILoadContent iLoadContent)
iLoadContent.LoadContent(); iLoadContent.LoadContent();
foreach (var args in flyoutCreatedHandlers) foreach (var args in flyoutCreatedHandlers.ToArray())
{ {
if (ParentContext != null) if (ParentContext != null)
ParentContext?.Invoke(args, eventArgs); ParentContext?.Invoke(args, eventArgs);
@@ -71,7 +71,7 @@ partial class RadFlyoutBase
{ {
var eventArgs = new FlyoutClosedEventArgs((RadFlyoutBase)e.Content); var eventArgs = new FlyoutClosedEventArgs((RadFlyoutBase)e.Content);
foreach (var args in flyoutCloseHandlers) foreach (var args in flyoutCloseHandlers.ToArray())
{ {
if (ParentContext != null) if (ParentContext != null)
ParentContext?.Invoke(args, eventArgs); ParentContext?.Invoke(args, eventArgs);