using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
namespace Artemis.UI.Shared.Routing;
///
/// Represents a view model to which routing with parameters can take place.
///
/// The type of parameters the screen expects. It must have a parameterless constructor.
public abstract class RoutableScreen : RoutableScreen, IRoutableScreen where TParam : new()
{
///
/// Gets or sets the parameter source of the screen.
///
protected ParameterSource ParameterSource { get; set; } = ParameterSource.Segment;
///
/// Called while navigating to this screen.
///
/// An object containing the parameters of the navigation action.
/// Navigation arguments containing information about the navigation action.
///
/// A cancellation token that can be used by other objects or threads to receive notice of
/// cancellation.
///
public virtual Task OnNavigating(TParam parameters, NavigationArguments args, CancellationToken cancellationToken)
{
return Task.CompletedTask;
}
async Task IRoutableScreen.InternalOnNavigating(NavigationArguments args, CancellationToken cancellationToken)
{
Func