public ChangePasswordView() { InitializeComponent(); Loaded += (sender, args) => { Telegram.Api.Helpers.Execute.BeginOnUIThread(() => PasscodeBox.Focus()); }; }
public EnterPasscodeView() { InitializeComponent(); _doneButton.Click += (sender, args) => ViewModel.Done(); _cancelButton.Click += (sender, args) => ViewModel.Cancel(); Loaded += (sender, args) => { Telegram.Api.Helpers.Execute.BeginOnUIThread(() => PasscodeBox.Focus()); }; BuildLocalizedAppBar(); }
private void Passcode_OnKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { ConfirmOrCompletePasscode(); } else if (e.Key == Key.Back) { if (ConfirmPasscodeBox.IsFocused && ConfirmPasscodeBox.Length == 0) { PasscodeBox.Focus(); } } }
private void Passcode_OnKeyDown(object sender, KeyEventArgs e) { if (ViewModel.SelectedPasscodeType != null) { if (ViewModel.SelectedPasscodeType.Type == PasscodeType.Pin) { if (e.Key >= Key.D0 && e.Key <= Key.D9 || e.Key == Key.Back || e.Key == Key.Enter) { if (e.Key >= Key.D0 && e.Key <= Key.D9) { if (PasscodeBox.IsFocused && PasscodeBox.Length == 4 && ConfirmPasscodeBox.Length < 4) { ConfirmPasscodeBox.Focus(); } } } else { e.Handled = true; return; } } if (e.Key == Key.Enter) { ConfirmOrCompletePasscode(); } else if (e.Key == Key.Back) { if (ConfirmPasscodeBox.IsFocused && ConfirmPasscodeBox.Length == 0) { PasscodeBox.Focus(); } } } }
public EnterPasswordView() { InitializeComponent(); Loaded += (sender, args) => PasscodeBox.Focus(); }