Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
PetitionPeerReviewPage.xaml.cs
1using CommunityToolkit.Maui.Layouts;
3
5{
9 public partial class PetitionPeerReviewPage
10 {
15 {
16 this.InitializeComponent();
17
18 PetitionPeerReviewViewModel ViewModel = new(ServiceRef.UiService.PopLatestArgs<PetitionPeerReviewNavigationArgs>());
19
20 ViewModel.AddView(ReviewStep.Photo, this.PhotoView);
21 ViewModel.AddView(ReviewStep.Name, this.NameView);
22 ViewModel.AddView(ReviewStep.Pnr, this.PnrView);
23 ViewModel.AddView(ReviewStep.Nationality, this.NationalityView);
24 ViewModel.AddView(ReviewStep.BirthDate, this.BirthDateView);
25 ViewModel.AddView(ReviewStep.Gender, this.GenderView);
26 ViewModel.AddView(ReviewStep.PersonalAddressInfo, this.PersonalAddressInfoView);
27 ViewModel.AddView(ReviewStep.OrganizationalInfo, this.OrganizationalInfoView);
28 ViewModel.AddView(ReviewStep.Consent, this.ConsentView);
29 ViewModel.AddView(ReviewStep.Authenticate, this.AuthenticateView);
30 ViewModel.AddView(ReviewStep.Approved, this.ApprovedView);
31
32
33 this.ContentPageModel = ViewModel;
34
35 StateContainer.SetCurrentState(this.GridWithAnimation, nameof(ReviewStep.Photo));
36
37 ViewModel.PropertyChanged += this.ViewModel_PropertyChanged;
38 }
39
44 {
45 this.ContentPageModel.PropertyChanged -= this.ViewModel_PropertyChanged;
46 }
47
48 private async void ViewModel_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
49 {
50 try
51 {
52 switch (e.PropertyName)
53 {
54 case nameof(PetitionPeerReviewViewModel.CurrentStep):
55 DateTime Start = DateTime.Now;
56
57 while (!StateContainer.GetCanStateChange(this.GridWithAnimation) && DateTime.Now.Subtract(Start).TotalSeconds < 2)
58 await Task.Delay(100);
59
60 await StateContainer.ChangeStateWithAnimation(this.GridWithAnimation,
61 (this.ContentPageModel as PetitionPeerReviewViewModel)?.CurrentStep.ToString(),
62 new Animation()
63 {
64 {
65 0,
66 1,
67 new Animation((p)=>
68 {
69 this.GridWithAnimation.Scale = p / 5 + 0.8;
70 this.GridWithAnimation.Opacity = p;
71 }, 1, 0, Easing.CubicIn)
72 }
73 },
74 new Animation()
75 {
76 {
77 0,
78 1,
79 new Animation((p)=>
80 {
81 this.GridWithAnimation.Scale = p / 5 + 0.8;
82 this.GridWithAnimation.Opacity = p;
83 }, 0, 1, Easing.CubicInOut)
84 }
85 },
86 CancellationToken.None);
87 break;
88 }
89 }
90 catch (Exception ex)
91 {
92 ServiceRef.LogService.LogException(ex);
93 }
94 }
95 }
96}
Base class that references services in the app.
Definition: ServiceRef.cs:31
static ILogService LogService
Log service.
Definition: ServiceRef.cs:91
static IUiService UiService
Service serializing and managing UI-related tasks.
Definition: ServiceRef.cs:55
A page to display when the user is asked to review an identity application.
PetitionPeerReviewPage()
Creates a new instance of the PetitionPeerReviewPage class.
The view model to bind to when displaying petitioning of an identity in a view or page.
void AddView(ReviewStep Step, BaseContentView View)
Adds a view to the wizard dialog.
ReviewStep
Steps in the peer-review process
Definition: ReviewStep.cs:7