Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
NavigationArgs.cs
2{
6 public class NavigationArgs
7 {
8 private NavigationArgs? parentArgs = null;
9 private BackMethod backMethod = BackMethod.Inherited;
10 private string? uniqueId = null;
11
16 public readonly TaskCompletionSource<bool> NavigationCompletionSource = new ();
17
22 {
23 return this.NavigationCompletionSource.Task;
24 }
25
29 public void SetBackArguments(NavigationArgs? ParentArgs, BackMethod BackMethod = BackMethod.Inherited, string? UniqueId = null)
30 {
31 this.backMethod = BackMethod;
32 this.parentArgs = ParentArgs;
33 this.uniqueId = UniqueId;
34 }
35
39 public string GetBackRoute()
40 {
41 BackMethod BackMethod = this.backMethod;
42 string BackRoute = "..";
43 NavigationArgs? ParentArgs = this.parentArgs;
44
45 if (BackMethod == BackMethod.Inherited)
46 {
47 while (ParentArgs is not null && ParentArgs.backMethod == BackMethod.Inherited)
48 {
49 ParentArgs = ParentArgs.parentArgs;
50 BackRoute += "/..";
51 }
52
53 if (ParentArgs is null)
54 return ".."; // Pop is inherited by default
55
56 BackMethod = ParentArgs.backMethod;
57 }
58
59 switch (BackMethod)
60 {
61 case BackMethod.Pop:
62 default:
63 return "..";
64
65 case BackMethod.Pop2:
66 return "../..";
67
68 case BackMethod.CurrentPage:
69 if (BackMethod == BackMethod.Inherited)
70 return BackRoute + "/..";
71 else
72 return "..";
73 }
74 }
75
79 public string? UniqueId => this.uniqueId;
80
84 public bool Animated { get; set; } = true;
85 }
86}
An base class holding page specific navigation parameters.
Task GetNavigationCompletionTask()
Returns the task for NavigationCompletionSource
string? UniqueId
An unique view identifier used to search the args of similar view types.
readonly TaskCompletionSource< bool > NavigationCompletionSource
The completion source for the navigation task. Will return true when the navigation and transitions a...
void SetBackArguments(NavigationArgs? ParentArgs, BackMethod BackMethod=BackMethod.Inherited, string? UniqueId=null)
Sets the reference to the main parent's NavigationArgs.
string GetBackRoute()
Get the route used for the IUiService.GoBackAsync method.
bool Animated
Is the navigation animated
BackMethod
Navigation Back Method
Definition: BackMethod.cs:7