/// <summary> /// Resets controls after loading data. /// </summary> private void CompleteScanning() { ProgressBar.Style = ProgressBarStyle.Blocks; LblProgress.Text = string.Empty; LblProgress.Visible = false; BtnClose.Text = Language.T("Close"); Cursor = Cursors.Default; _isLoadingNow = false; BtnClose.Focus(); }
public void Show() { StartShowAnimation(); this.Visibility = Visibility.Visible; // Focus the close button to ensure keyboard focus is retained inside the panel BtnClose.Focus(FocusState.Programmatic); ViewModel.PropertyChanged -= ViewModel_PropertyChanged; ViewModel.PropertyChanged += ViewModel_PropertyChanged; TitleBarHelper.SetTranisentTitleBar(TitleBackground); }
/// <summary> /// Loads data and recalculates. /// </summary> protected override void OnShown(EventArgs e) { base.OnShown(e); if (CompactMode) { return; } if (!Data.IsIntrabarData) { StartLoading(); } else { Backtester.Scan(); ShowScanningResult(); ProgressBar.Value = 100; BtnClose.Focus(); } }
public Waiter() { InitializeComponent(); BtnClose.Focus(); }
/// <summary> /// used for handling key down event for focusing elements in serial /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Elements_KeyDown(object sender, KeyEventArgs e) { if (sender is TextBox) { if (IsTabKeyDown(e)) { if (IsShiftKeyDown()) { BtnClose.Focus(); } else if (GlobalPasswordTextBox != null) { GlobalPasswordTextBox.Focus(); } } } else if (sender is PasswordBox) { if (IsTabKeyDown(e)) { if (IsShiftKeyDown()) { EmailTextBox.Focus(); } else { SignInButton.Focus(); } } } else if (sender is Button) { var button = sender as Button; if (button.Name == "SignInButton") { if (IsTabKeyDown(e)) { if (IsShiftKeyDown()) { if (GlobalPasswordTextBox != null) { GlobalPasswordTextBox.Focus(); } else { hyperlinkSignUp.Focus(); } } } } else { if (IsTabKeyDown(e)) { if (IsShiftKeyDown()) { hyperlinkSignUp.Focus(); } else { EmailTextBox.Focus(); } } } } else if (sender is System.Windows.Documents.Hyperlink) { if (IsTabKeyDown(e)) { if (IsShiftKeyDown()) { SignInButton.Focus(); } else { BtnClose.Focus(); } } } }