Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
HomePage.xaml.cs
1using System.ComponentModel;
3
5{
6 public partial class HomePage
7 {
8 public HomePage(HomeViewModel ViewModel)
9 {
10 this.InitializeComponent();
11 this.ContentPageModel = ViewModel;
12
13 if (this.BindingContext is HomeViewModel Model)
14 Model.PropertyChanged += this.Vm_PropertyChanged;
15 }
16
17 public override async Task OnAppearingAsync()
18 {
19 await base.OnAppearingAsync();
20 }
21
22 private async void SwipeGestureRecognizer_Swiped(object sender, SwipedEventArgs e)
23 {
24 try
25 {
26 if(this.ContentPageModel is HomeViewModel ViewModel)
27 await ViewModel.ViewId();
28 }
29 catch (Exception Ex)
30 {
31 ServiceRef.LogService.LogException(Ex);
32 }
33 }
34
35 private async void Vm_PropertyChanged(object? sender, PropertyChangedEventArgs e)
36 {
37 if (e.PropertyName == nameof(HomeViewModel.ShowingNoWalletPopup))
38 {
39 if (this.BindingContext is HomeViewModel Vm)
40 {
41 this.NoWalletPopup.CancelAnimations();
42 this.NoIDPopup.CancelAnimations();
43
44 if (Vm.ShowingNoWalletPopup)
45 {
46 this.NoWalletPopup.Opacity = 0;
47 this.NoWalletPopup.Scale = 0.8;
48 this.NoWalletPopup.IsVisible = true;
49
50 this.NoIDPopup.Opacity = 1;
51 this.NoIDPopup.Scale = 1;
52 this.NoIDPopup.IsVisible = !Vm.HasPersonalIdentity;
53
54 _ = this.NoWalletPopup.FadeToAsync(1, 500, Easing.CubicIn);
55 _ = this.NoWalletPopup.ScaleToAsync(1, 500, Easing.CubicIn);
56
57 _ = this.NoIDPopup.FadeToAsync(0.8, 500, Easing.CubicOut);
58 await this.NoIDPopup.ScaleToAsync(0.8, 500, Easing.CubicOut);
59
60 this.NoIDPopup.IsVisible = false;
61 }
62 else
63 {
64 this.NoIDPopup.Opacity = 0;
65 this.NoIDPopup.Scale = 0.8;
66 this.NoIDPopup.IsVisible = !Vm.HasPersonalIdentity;
67
68 this.NoWalletPopup.Opacity = 1;
69 this.NoWalletPopup.Scale = 1;
70 this.NoWalletPopup.IsVisible = true;
71
72 _ = this.NoIDPopup.FadeToAsync(1, 1000, Easing.CubicIn);
73 _ = this.NoIDPopup.ScaleToAsync(1, 1000, Easing.CubicIn);
74
75 _ = this.NoWalletPopup.FadeToAsync(0, 1000, Easing.CubicOut);
76 await this.NoWalletPopup.ScaleToAsync(0.8, 1000, Easing.CubicOut);
77
78 this.NoWalletPopup.IsVisible = false;
79 }
80 }
81 }
82 }
83 }
84}
Base class that references services in the app.
Definition: ServiceRef.cs:43
static ILogService LogService
Log service.
Definition: ServiceRef.cs:214
Definition: ImplTypes.g.cs:58