protected void OnLoaded(object sender, RoutedEventArgs args) { var style = Resources["FadedLabelStyle"] as Style; if (style != null) { _textboxAdorner = new PasswordBoxHintAdorner(PassphrasePasswordBox, HintText, style, IsAdornerVisible); } }
protected void OnLoaded(object sender, RoutedEventArgs args) { string hintText = null; Title = _title; switch (_kind) { case UserPromptKind.AuthenticateHost: PositiveButton.Content = "_Yes"; NegativeButton.Content = "_No"; AdditionalInfoLabel.Visibility = Visibility.Visible; break; case UserPromptKind.CredentialsPassword: hintText = HintTextPassword; break; case UserPromptKind.CredentialsUsername: hintText = HintTextUsername; break; case UserPromptKind.SshPassphrase: hintText = HintTextPassphrase; break; } LearnMoreLink.Visibility = _kind == UserPromptKind.SshPassphrase ? Visibility.Visible : Visibility.Collapsed; Topmost = true; BringIntoView(); Activate(); if (hintText != null) { UserInput.Visibility = Visibility.Visible; var style = Resources[AdornerStyleName] as Style; if (style != null) { _textboxAdorner = new PasswordBoxHintAdorner(PassphrasePasswordBox, hintText, style, IsAdornerVisible); } PassphrasePasswordBox.Focus(); } else { UserInput.Visibility = Visibility.Collapsed; } }
internal PassphraseWindow(string resource) { InitializeComponent(); _resource = resource; Loaded += (sender, args) => { var style = Resources["FadedLabelStyle"] as Style; _textboxAdorner = new PasswordBoxHintAdorner(PassphrasePasswordBox, HintText, style, IsAdornerVisible); }; DataContext = this; }