Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ChangePasswordPage.xaml.cs
1using CommunityToolkit.Mvvm.Messaging;
2using Microsoft.Maui.Controls.PlatformConfiguration;
3using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;
4
6{
10 public partial class ChangePasswordPage
11 {
17 : base()
18 {
19 this.InitializeComponent();
20 this.ContentPageModel = ViewModel;
21 }
22
24 protected override void OnLoaded()
25 {
26 this.OldPasswordEntry.Focus();
27 base.OnLoaded();
28 }
29
31 protected override async Task OnAppearingAsync()
32 {
33 await base.OnAppearingAsync();
34 WeakReferenceMessenger.Default.Register<KeyboardSizeMessage>(this, this.HandleKeyboardSizeMessage);
35 }
36
38 protected override async Task OnDisappearingAsync()
39 {
40 WeakReferenceMessenger.Default.Unregister<KeyboardSizeMessage>(this);
41 await base.OnDisappearingAsync();
42 }
43
44 private async void HandleKeyboardSizeMessage(object Recipient, KeyboardSizeMessage Message)
45 {
46 await this.Dispatcher.DispatchAsync(() =>
47 {
48 double Bottom = 0;
49 if (DeviceInfo.Platform == DevicePlatform.iOS)
50 {
51 Thickness SafeInsets = this.On<iOS>().SafeAreaInsets();
52 Bottom = SafeInsets.Bottom;
53 Thickness Margin = new(0, 0, 0, Message.KeyboardSize - Bottom);
54 this.TheMainGrid.Margin = Margin;
55 }
56
57
58 });
59 }
60 }
61}
ChangePasswordPage(ChangePasswordViewModel ViewModel)
Initializes a new instance of the ChangePasswordPage class.
class KeyboardSizeMessage(float KeyboardSize)
Keyboard size change message
Definition: Messages.cs:19