code sweep
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Toolkit.Foundation.Avalonia
|
||||
namespace Toolkit.Foundation.Avalonia;
|
||||
|
||||
public record ContentControlNavigation : Navigation<ContentControl>
|
||||
{
|
||||
public record ContentControlNavigation : Navigation<ContentControl>
|
||||
public ContentControlNavigation(ContentControl route,
|
||||
object? content,
|
||||
object? template,
|
||||
IDictionary<string, object>? parameters) : base(route, content, template, parameters)
|
||||
{
|
||||
public ContentControlNavigation(ContentControl route,
|
||||
object? content,
|
||||
object? template,
|
||||
IDictionary<string, object>? parameters) : base(route, content, template, parameters)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,18 @@
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Mediator;
|
||||
|
||||
namespace Toolkit.Foundation.Avalonia
|
||||
{
|
||||
public class ContentControlNavigationHandler : IRequestHandler<ContentControlNavigation, bool>
|
||||
{
|
||||
public async ValueTask<bool> Handle(ContentControlNavigation request, CancellationToken cancellationToken)
|
||||
{
|
||||
if (request.Template is TemplatedControl control)
|
||||
{
|
||||
control.DataContext = request.Content;
|
||||
request.Route.Content = control;
|
||||
}
|
||||
namespace Toolkit.Foundation.Avalonia;
|
||||
|
||||
return await Task.FromResult(true);
|
||||
public class ContentControlNavigationHandler : IRequestHandler<ContentControlNavigation, bool>
|
||||
{
|
||||
public async ValueTask<bool> Handle(ContentControlNavigation request, CancellationToken cancellationToken)
|
||||
{
|
||||
if (request.Template is TemplatedControl control)
|
||||
{
|
||||
control.DataContext = request.Content;
|
||||
request.Route.Content = control;
|
||||
}
|
||||
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,13 @@
|
||||
using FluentAvalonia.UI.Controls;
|
||||
|
||||
namespace Toolkit.Foundation.Avalonia
|
||||
{
|
||||
public record ContentDialogNavigation : Navigation<ContentDialog>
|
||||
{
|
||||
public ContentDialogNavigation(ContentDialog route,
|
||||
object? content,
|
||||
object? template,
|
||||
IDictionary<string, object>? parameters) : base(route, content, template, parameters)
|
||||
{
|
||||
namespace Toolkit.Foundation.Avalonia;
|
||||
|
||||
}
|
||||
public record ContentDialogNavigation : Navigation<ContentDialog>
|
||||
{
|
||||
public ContentDialogNavigation(ContentDialog route,
|
||||
object? content,
|
||||
object? template,
|
||||
IDictionary<string, object>? parameters) : base(route, content, template, parameters)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,43 @@
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using Mediator;
|
||||
|
||||
namespace Toolkit.Foundation.Avalonia
|
||||
namespace Toolkit.Foundation.Avalonia;
|
||||
|
||||
public class ContentDialogNavigationHandler : IRequestHandler<ContentDialogNavigation, bool>
|
||||
{
|
||||
public class ContentDialogNavigationHandler : IRequestHandler<ContentDialogNavigation, bool>
|
||||
public async ValueTask<bool> Handle(ContentDialogNavigation request, CancellationToken cancellationToken)
|
||||
{
|
||||
public async ValueTask<bool> Handle(ContentDialogNavigation request, CancellationToken cancellationToken)
|
||||
if (request.Template is ContentDialog contentDialog)
|
||||
{
|
||||
if (request.Template is ContentDialog contentDialog)
|
||||
async void HandleButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
async void HandleButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
ContentDialogButtonClickDeferral defferal = args.GetDeferral();
|
||||
if (sender.DataContext is INavigationConfirmation confirmation)
|
||||
{
|
||||
ContentDialogButtonClickDeferral defferal = args.GetDeferral();
|
||||
if (sender.DataContext is INavigationConfirmation confirmation)
|
||||
if (!await confirmation.CanConfirm())
|
||||
{
|
||||
if (!await confirmation.CanConfirm())
|
||||
{
|
||||
args.Cancel = true;
|
||||
}
|
||||
args.Cancel = true;
|
||||
}
|
||||
|
||||
if (!args.Cancel)
|
||||
{
|
||||
contentDialog.SecondaryButtonClick -= HandleButtonClick;
|
||||
contentDialog.PrimaryButtonClick -= HandleButtonClick;
|
||||
contentDialog.CloseButtonClick -= HandleButtonClick;
|
||||
}
|
||||
|
||||
defferal.Complete();
|
||||
}
|
||||
|
||||
contentDialog.SecondaryButtonClick += HandleButtonClick;
|
||||
contentDialog.PrimaryButtonClick += HandleButtonClick;
|
||||
contentDialog.CloseButtonClick += HandleButtonClick;
|
||||
if (!args.Cancel)
|
||||
{
|
||||
contentDialog.SecondaryButtonClick -= HandleButtonClick;
|
||||
contentDialog.PrimaryButtonClick -= HandleButtonClick;
|
||||
contentDialog.CloseButtonClick -= HandleButtonClick;
|
||||
}
|
||||
|
||||
contentDialog.DataContext = request.Content;
|
||||
await contentDialog.ShowAsync();
|
||||
defferal.Complete();
|
||||
}
|
||||
|
||||
return await Task.FromResult(true);
|
||||
contentDialog.SecondaryButtonClick += HandleButtonClick;
|
||||
contentDialog.PrimaryButtonClick += HandleButtonClick;
|
||||
contentDialog.CloseButtonClick += HandleButtonClick;
|
||||
|
||||
contentDialog.DataContext = request.Content;
|
||||
await contentDialog.ShowAsync();
|
||||
}
|
||||
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,14 @@
|
||||
using FluentAvalonia.UI.Controls;
|
||||
|
||||
namespace Toolkit.Foundation.Avalonia
|
||||
namespace Toolkit.Foundation.Avalonia;
|
||||
|
||||
public record FrameNavigation : Navigation<Frame>
|
||||
{
|
||||
public record FrameNavigation : Navigation<Frame>
|
||||
public FrameNavigation(Frame route,
|
||||
object? content,
|
||||
object? template,
|
||||
IDictionary<string, object>?
|
||||
parameters) : base(route, content, template, parameters)
|
||||
{
|
||||
public FrameNavigation(Frame route,
|
||||
object? content,
|
||||
object? template,
|
||||
IDictionary<string, object>?
|
||||
parameters) : base(route, content, template, parameters)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,32 +2,31 @@
|
||||
using FluentAvalonia.UI.Navigation;
|
||||
using Mediator;
|
||||
|
||||
namespace Toolkit.Foundation.Avalonia
|
||||
namespace Toolkit.Foundation.Avalonia;
|
||||
|
||||
public class FrameNavigationHandler : IRequestHandler<FrameNavigation, bool>
|
||||
{
|
||||
public class FrameNavigationHandler : IRequestHandler<FrameNavigation, bool>
|
||||
public async ValueTask<bool> Handle(FrameNavigation request, CancellationToken cancellationToken)
|
||||
{
|
||||
public async ValueTask<bool> Handle(FrameNavigation request, CancellationToken cancellationToken)
|
||||
request.Route.NavigationPageFactory = new NavigationPageFactory();
|
||||
|
||||
TaskCompletionSource<bool> completionSource = new();
|
||||
if (request.Template is TemplatedControl content)
|
||||
{
|
||||
request.Route.NavigationPageFactory = new NavigationPageFactory();
|
||||
|
||||
TaskCompletionSource<bool> completionSource = new();
|
||||
if (request.Template is TemplatedControl content)
|
||||
void HandleNavigated(object sender, NavigationEventArgs args)
|
||||
{
|
||||
void HandleNavigated(object sender, NavigationEventArgs args)
|
||||
request.Route.Navigated -= HandleNavigated;
|
||||
if (request.Route.Content is TemplatedControl control)
|
||||
{
|
||||
request.Route.Navigated -= HandleNavigated;
|
||||
if (request.Route.Content is TemplatedControl control)
|
||||
{
|
||||
control.DataContext = request.Content;
|
||||
completionSource.SetResult(true);
|
||||
}
|
||||
control.DataContext = request.Content;
|
||||
completionSource.SetResult(true);
|
||||
}
|
||||
|
||||
request.Route.Navigated += HandleNavigated;
|
||||
request.Route.NavigateFromObject(content);
|
||||
}
|
||||
|
||||
return await completionSource.Task;
|
||||
request.Route.Navigated += HandleNavigated;
|
||||
request.Route.NavigateFromObject(content);
|
||||
}
|
||||
|
||||
return await completionSource.Task;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,37 +2,37 @@
|
||||
using Avalonia.Controls.Primitives;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using Mediator;
|
||||
using Toolkit.Framework.Foundation;
|
||||
|
||||
namespace Toolkit.Foundation.Avalonia
|
||||
namespace Toolkit.Foundation.Avalonia;
|
||||
|
||||
public class NavigateBackHandler : IRequestHandler<NavigateBack>
|
||||
{
|
||||
public class NavigateBackHandler : IRequestHandler<NavigateBack>
|
||||
private readonly INavigationRouteDescriptorCollection descriptors;
|
||||
|
||||
public NavigateBackHandler(INavigationRouteDescriptorCollection descriptors)
|
||||
{
|
||||
private readonly INavigationRouteDescriptorCollection descriptors;
|
||||
this.descriptors = descriptors;
|
||||
}
|
||||
|
||||
public NavigateBackHandler(INavigationRouteDescriptorCollection descriptors)
|
||||
public ValueTask<Unit> Handle(NavigateBack request, CancellationToken cancellationToken)
|
||||
{
|
||||
if (descriptors.FirstOrDefault(x => request.Route is string { } name && name == x.Name) is NavigationRouteDescriptor descriptor)
|
||||
{
|
||||
this.descriptors = descriptors;
|
||||
}
|
||||
|
||||
public ValueTask<Unit> Handle(NavigateBack request, CancellationToken cancellationToken)
|
||||
{
|
||||
if (descriptors.FirstOrDefault(x => request.Route is string { } name && name == x.Name) is NavigationRouteDescriptor descriptor)
|
||||
if (descriptor.Route is ContentControl { Content: TemplatedControl content })
|
||||
{
|
||||
if (descriptor.Route is ContentControl { Content: TemplatedControl content })
|
||||
if (content.DataContext is IDisposable disposable)
|
||||
{
|
||||
if (content.DataContext is IDisposable disposable)
|
||||
{
|
||||
disposable.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
if (descriptor.Route is Frame frame)
|
||||
{
|
||||
frame.GoBack();
|
||||
disposable.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
return default;
|
||||
if (descriptor.Route is Frame frame)
|
||||
{
|
||||
frame.GoBack();
|
||||
}
|
||||
}
|
||||
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,116 +1,116 @@
|
||||
using Avalonia.Controls;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using Mediator;
|
||||
using Toolkit.Framework.Foundation;
|
||||
|
||||
namespace Toolkit.Foundation.Avalonia
|
||||
namespace Toolkit.Foundation.Avalonia;
|
||||
|
||||
public class NavigateHandler : IRequestHandler<Navigate>
|
||||
{
|
||||
public class NavigateHandler : IRequestHandler<Navigate>
|
||||
private readonly INavigationRouteDescriptorCollection descriptors;
|
||||
private readonly IMediator mediator;
|
||||
private readonly INamedDataTemplateFactory namedDataTemplateFactory;
|
||||
private readonly INamedTemplateFactory namedTemplateFactory;
|
||||
private readonly ITemplateFactory templateFactory;
|
||||
private readonly ITypedDataTemplateFactory typedDataTemplateFactory;
|
||||
|
||||
public NavigateHandler(IMediator mediator,
|
||||
ITemplateFactory templateFactory,
|
||||
INamedTemplateFactory namedTemplateFactory,
|
||||
INamedDataTemplateFactory namedDataTemplateFactory,
|
||||
ITypedDataTemplateFactory typedDataTemplateFactory,
|
||||
INavigationRouteDescriptorCollection descriptors)
|
||||
{
|
||||
private readonly INavigationRouteDescriptorCollection descriptors;
|
||||
private readonly IMediator mediator;
|
||||
private readonly INamedDataTemplateFactory namedDataTemplateFactory;
|
||||
private readonly INamedTemplateFactory namedTemplateFactory;
|
||||
private readonly ITemplateFactory templateFactory;
|
||||
private readonly ITypedDataTemplateFactory typedDataTemplateFactory;
|
||||
this.mediator = mediator;
|
||||
this.templateFactory = templateFactory;
|
||||
this.namedTemplateFactory = namedTemplateFactory;
|
||||
this.namedDataTemplateFactory = namedDataTemplateFactory;
|
||||
this.typedDataTemplateFactory = typedDataTemplateFactory;
|
||||
this.descriptors = descriptors;
|
||||
}
|
||||
|
||||
public NavigateHandler(IMediator mediator,
|
||||
ITemplateFactory templateFactory,
|
||||
INamedTemplateFactory namedTemplateFactory,
|
||||
INamedDataTemplateFactory namedDataTemplateFactory,
|
||||
ITypedDataTemplateFactory typedDataTemplateFactory,
|
||||
INavigationRouteDescriptorCollection descriptors)
|
||||
public async ValueTask<Unit> Handle(Navigate request, CancellationToken cancellationToken)
|
||||
{
|
||||
object? content = null;
|
||||
object? template = null;
|
||||
|
||||
Dictionary<string, object> keyedParameters = new();
|
||||
List<object> parameters = new();
|
||||
|
||||
foreach (object? parameter in request.Parameters)
|
||||
{
|
||||
this.mediator = mediator;
|
||||
this.templateFactory = templateFactory;
|
||||
this.namedTemplateFactory = namedTemplateFactory;
|
||||
this.namedDataTemplateFactory = namedDataTemplateFactory;
|
||||
this.typedDataTemplateFactory = typedDataTemplateFactory;
|
||||
this.descriptors = descriptors;
|
||||
}
|
||||
|
||||
public async ValueTask<Unit> Handle(Navigate request, CancellationToken cancellationToken)
|
||||
{
|
||||
object? content = null;
|
||||
object? template = null;
|
||||
|
||||
Dictionary<string, object> keyedParameters = new();
|
||||
List<object> parameters = new();
|
||||
|
||||
foreach (object? parameter in request.Parameters)
|
||||
if (parameter is not null)
|
||||
{
|
||||
if (parameter is not null)
|
||||
if (parameter is KeyValuePair<string, object> keyed)
|
||||
{
|
||||
if (parameter is KeyValuePair<string, object> keyed)
|
||||
{
|
||||
keyedParameters.Add(keyed.Key, keyed.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
parameters.Add(parameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (request.Name is { Length: > 0 } name)
|
||||
{
|
||||
content = namedDataTemplateFactory.Create(name, parameters.ToArray());
|
||||
template = namedTemplateFactory.Create(name);
|
||||
}
|
||||
|
||||
if (request.Type is Type type)
|
||||
{
|
||||
content = typedDataTemplateFactory.Create(type, parameters.ToArray());
|
||||
template = templateFactory.Create(content);
|
||||
}
|
||||
|
||||
if (template is not null)
|
||||
{
|
||||
object? target = null;
|
||||
if (descriptors.FirstOrDefault(x => request.Route is string { } name && name == x.Name) is NavigationRouteDescriptor descriptor)
|
||||
{
|
||||
target = descriptor.Route;
|
||||
keyedParameters.Add(keyed.Key, keyed.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
target = template;
|
||||
parameters.Add(parameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool hasNavigated = false;
|
||||
if (target is Frame frame)
|
||||
{
|
||||
hasNavigated = await mediator.Send(new FrameNavigation(frame, content, template, keyedParameters));
|
||||
}
|
||||
if (request.Name is { Length: > 0 } name)
|
||||
{
|
||||
content = namedDataTemplateFactory.Create(name, parameters.ToArray());
|
||||
template = namedTemplateFactory.Create(name);
|
||||
}
|
||||
|
||||
if (target is ContentDialog dialog)
|
||||
{
|
||||
hasNavigated = await mediator.Send(new ContentDialogNavigation(dialog, content, template, keyedParameters));
|
||||
}
|
||||
if (request.Type is Type type)
|
||||
{
|
||||
content = typedDataTemplateFactory.Create(type, parameters.ToArray());
|
||||
template = templateFactory.Create(content);
|
||||
}
|
||||
|
||||
if (target is ContentControl contentControl)
|
||||
{
|
||||
hasNavigated = await mediator.Send(new ContentControlNavigation(contentControl, content, template, keyedParameters));
|
||||
}
|
||||
|
||||
if (hasNavigated)
|
||||
{
|
||||
if (content is INavigated navigated)
|
||||
{
|
||||
await navigated.Navigated();
|
||||
}
|
||||
}
|
||||
if (template is not null)
|
||||
{
|
||||
object? target = null;
|
||||
if (descriptors.FirstOrDefault(x => request.Route is string { } name && name == x.Name) is NavigationRouteDescriptor descriptor)
|
||||
{
|
||||
target = descriptor.Route;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (descriptors.FirstOrDefault(x => request.Route is string { } name && name == x.Name) is NavigationRouteDescriptor descriptor)
|
||||
{
|
||||
if (descriptor.Route is ContentControl contentControl)
|
||||
{
|
||||
contentControl.Content = null;
|
||||
}
|
||||
}
|
||||
target = template;
|
||||
}
|
||||
|
||||
return default;
|
||||
bool hasNavigated = false;
|
||||
if (target is Frame frame)
|
||||
{
|
||||
hasNavigated = await mediator.Send(new FrameNavigation(frame, content, template, keyedParameters));
|
||||
}
|
||||
|
||||
if (target is ContentDialog dialog)
|
||||
{
|
||||
hasNavigated = await mediator.Send(new ContentDialogNavigation(dialog, content, template, keyedParameters));
|
||||
}
|
||||
|
||||
if (target is ContentControl contentControl)
|
||||
{
|
||||
hasNavigated = await mediator.Send(new ContentControlNavigation(contentControl, content, template, keyedParameters));
|
||||
}
|
||||
|
||||
if (hasNavigated)
|
||||
{
|
||||
if (content is INavigated navigated)
|
||||
{
|
||||
await navigated.Navigated();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (descriptors.FirstOrDefault(x => request.Route is string { } name && name == x.Name) is NavigationRouteDescriptor descriptor)
|
||||
{
|
||||
if (descriptor.Route is ContentControl contentControl)
|
||||
{
|
||||
contentControl.Content = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,26 @@
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Mediator;
|
||||
|
||||
namespace Toolkit.Foundation.Avalonia
|
||||
namespace Toolkit.Foundation.Avalonia;
|
||||
|
||||
public record Navigation<TRoute> : IRequest<bool> where TRoute : TemplatedControl
|
||||
{
|
||||
public record Navigation<TRoute> : IRequest<bool> where TRoute : TemplatedControl
|
||||
public TRoute Route { get; }
|
||||
|
||||
public Navigation(TRoute route,
|
||||
object? content,
|
||||
object? template,
|
||||
IDictionary<string, object>? parameters)
|
||||
{
|
||||
public TRoute Route { get; }
|
||||
|
||||
public Navigation(TRoute route,
|
||||
object? content,
|
||||
object? template,
|
||||
IDictionary<string, object>? parameters)
|
||||
{
|
||||
Route = route;
|
||||
Content = content;
|
||||
Template = template;
|
||||
Parameters = parameters;
|
||||
}
|
||||
|
||||
public object? Content { get; }
|
||||
|
||||
public object? Template { get; }
|
||||
|
||||
public IDictionary<string, object>? Parameters { get; }
|
||||
Route = route;
|
||||
Content = content;
|
||||
Template = template;
|
||||
Parameters = parameters;
|
||||
}
|
||||
}
|
||||
|
||||
public object? Content { get; }
|
||||
|
||||
public object? Template { get; }
|
||||
|
||||
public IDictionary<string, object>? Parameters { get; }
|
||||
}
|
||||
@@ -1,18 +1,17 @@
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Toolkit.Foundation.Avalonia
|
||||
{
|
||||
internal class NavigationPageFactory : INavigationPageFactory
|
||||
{
|
||||
public IControl? GetPage(Type srcType)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
namespace Toolkit.Foundation.Avalonia;
|
||||
|
||||
public IControl GetPageFromObject(object target)
|
||||
{
|
||||
return (IControl)target;
|
||||
}
|
||||
internal class NavigationPageFactory : INavigationPageFactory
|
||||
{
|
||||
public IControl? GetPage(Type srcType)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
public IControl GetPageFromObject(object target)
|
||||
{
|
||||
return (IControl)target;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Interactivity;
|
||||
using Mediator;
|
||||
using Toolkit.Framework.Foundation;
|
||||
|
||||
namespace Toolkit.Foundation.Avalonia
|
||||
namespace Toolkit.Foundation.Avalonia;
|
||||
|
||||
public class NavigationRouteHandler : IRequestHandler<NavigationRoute>
|
||||
{
|
||||
public class NavigationRouteHandler : IRequestHandler<NavigationRoute>
|
||||
private readonly INavigationRouteDescriptorCollection descriptors;
|
||||
|
||||
public NavigationRouteHandler(INavigationRouteDescriptorCollection descriptors)
|
||||
{
|
||||
private readonly INavigationRouteDescriptorCollection descriptors;
|
||||
this.descriptors = descriptors;
|
||||
}
|
||||
|
||||
public NavigationRouteHandler(INavigationRouteDescriptorCollection descriptors)
|
||||
public ValueTask<Unit> Handle(NavigationRoute request, CancellationToken cancellationToken)
|
||||
{
|
||||
if (request.Route is TemplatedControl control)
|
||||
{
|
||||
this.descriptors = descriptors;
|
||||
}
|
||||
|
||||
public ValueTask<Unit> Handle(NavigationRoute request, CancellationToken cancellationToken)
|
||||
{
|
||||
if (request.Route is TemplatedControl control)
|
||||
void HandleUnloaded(object? sender, RoutedEventArgs args)
|
||||
{
|
||||
void HandleUnloaded(object? sender, RoutedEventArgs args)
|
||||
if (descriptors.FirstOrDefault(x => x.Route == sender) is INavigationRouteDescriptor descriptor)
|
||||
{
|
||||
if (descriptors.FirstOrDefault(x => x.Route == sender) is INavigationRouteDescriptor descriptor)
|
||||
{
|
||||
descriptors.Remove(descriptor);
|
||||
}
|
||||
descriptors.Remove(descriptor);
|
||||
}
|
||||
control.Unloaded += HandleUnloaded;
|
||||
}
|
||||
|
||||
if (descriptors.FirstOrDefault(x => x.Name == request.Name) is INavigationRouteDescriptor descriptor)
|
||||
{
|
||||
descriptors.Remove(descriptor);
|
||||
}
|
||||
|
||||
descriptors.Add(new NavigationRouteDescriptor(request.Name, request.Route));
|
||||
return default;
|
||||
control.Unloaded += HandleUnloaded;
|
||||
}
|
||||
|
||||
if (descriptors.FirstOrDefault(x => x.Name == request.Name) is INavigationRouteDescriptor descriptor)
|
||||
{
|
||||
descriptors.Remove(descriptor);
|
||||
}
|
||||
|
||||
descriptors.Add(new NavigationRouteDescriptor(request.Name, request.Route));
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user