示例#1
0
 private void UsernameTextBox_GotFocus(object sender, RoutedEventArgs e)
 {
     UsernameTextBox.SelectAll();
     ErrorUsernameTextBlock.Visibility = Visibility.Collapsed;
     ErrorProviderTextBlock.Visibility = Visibility.Collapsed;
     //SetTextBlockVisibilityCollapsed();
 }
示例#2
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            this.viewModel = (MainViewModel)this.DataContext;

            UsernameTextBox.Text = "Wizard " + new Random().Next(0, 100);
            UsernameTextBox.Focus();
            UsernameTextBox.SelectAll();
        }
        private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            UsernameTextBox.Focus();
            UsernameTextBox.SelectAll();

            IRequestFocus focus = (IRequestFocus)DataContext;

            focus.FocusRequested += OnFocusRequested;
        }
示例#4
0
        public UserCreationView()
        {
            InitializeComponent();
            Loaded += OnLoaded;

            UsernameTextBox.GotFocus += (_, __) => UsernameTextBox.SelectAll();
            PasswordBox1.GotFocus    += (_, __) => PasswordBox1.SelectAll();
            PasswordBox2.GotFocus    += (_, __) => PasswordBox2.SelectAll();
        }
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            Loaded -= OnLoaded;

            // Immediately focus the username textbox
            // when the settings window is opened.
            UsernameTextBox?.Focus();
            UsernameTextBox?.SelectAll();

            // Subscribe to the ICloseable.RequestedClose event
            // to close this view when requested to by the ViewModel.
            this.MakeCloseable();
        }
示例#6
0
 private void UsernameTextBox_GotFocus(object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     UsernameTextBox.SelectAll();
     UsernamePath.Fill = new SolidColorBrush(Colors.Teal);
     ErrorProviderTextBlock.Visibility = Visibility.Collapsed;
 }