public LoginWindow(APIControl apiControl) { InitializeComponent(); this.apiControl = apiControl; if (Properties.Settings.Default.username != "" && Properties.Settings.Default.password != "") { emailTextBox.Text = Properties.Settings.Default.username; passwordBox.Password = DPAPIInterface.Unprotect(Properties.Settings.Default.password, null, System.Security.Cryptography.DataProtectionScope.CurrentUser); passwordConfirmHide(true); signInButton.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); } else if (Properties.Settings.Default.username != "") { emailTextBox.Text = Properties.Settings.Default.username; passwordConfirmHide(true); signInButton.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); } else { passwordConfirmHide(false); signUpButton.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); } initialClick = true; submitButton.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); }