Rock.Apps.CheckScannerUtility.LoginPage.Page_Loaded C# (CSharp) Méthode

Page_Loaded() private méthode

Handles the Loaded event of the Page control.
private Page_Loaded ( object sender, RoutedEventArgs e ) : void
sender object The source of the event.
e System.Windows.RoutedEventArgs The instance containing the event data.
Résultat void
        private void Page_Loaded( object sender, RoutedEventArgs e )
        {
            HideLoginWarning( null, null );
            RockConfig rockConfig = RockConfig.Load();

            bool promptForUrl = string.IsNullOrWhiteSpace( rockConfig.RockBaseUrl ) || ForceRockURLVisible;

            lblRockUrl.Visibility = promptForUrl ? Visibility.Visible : Visibility.Collapsed;
            txtRockUrl.Visibility = promptForUrl ? Visibility.Visible : Visibility.Collapsed;

            txtRockUrl.Text = rockConfig.RockBaseUrl;
            txtUsername.Text = rockConfig.Username;
            txtPassword.Password = rockConfig.Password;

            // set keyboard focus to the first input that needs a value
            if ( string.IsNullOrEmpty( txtRockUrl.Text ) )
            {
                Keyboard.Focus( txtRockUrl );
            }
            else if ( string.IsNullOrEmpty( txtUsername.Text ) )
            {
                Keyboard.Focus( txtUsername );
            }
            else
            {
                Keyboard.Focus( txtPassword );
            }
        }