protected override void OnLoaded() { var settings = this.DialogSettings as LoginDialogSettings; if (settings != null && settings.EnablePasswordPreview) { var win8MetroPasswordStyle = this.FindResource("Win8MetroPasswordBox") as Style; if (win8MetroPasswordStyle != null) { PART_TextBox2.Style = win8MetroPasswordStyle; } } this.AffirmativeButtonText = this.DialogSettings.AffirmativeButtonText; this.NegativeButtonText = this.DialogSettings.NegativeButtonText; this.RegistrationButtonText = this.DialogSettings.RegistrationButtonText; switch (this.DialogSettings.ColorScheme) { case MetroDialogColorScheme.Accented: this.PART_NegativeButton.Style = this.FindResource("AccentedDialogHighlightedSquareButton") as Style; PART_TextBox.SetResourceReference(ForegroundProperty, "BlackColorBrush"); PART_TextBox2.SetResourceReference(ForegroundProperty, "BlackColorBrush"); break; } }
private void Dialog_Loaded(object sender, RoutedEventArgs e) { this.AffirmativeButtonText = this.DialogSettings.AffirmativeButtonText; this.NegativeButtonText = this.DialogSettings.NegativeButtonText; switch (this.DialogSettings.ColorScheme) { case TMPDialogColorScheme.Accented: this.PART_NegativeButton.Style = this.FindResource("AccentedDialogHighlightedButton") as Style; PART_TextBox.SetResourceReference(ForegroundProperty, "BlackColorBrush"); PART_TextBox2.SetResourceReference(ForegroundProperty, "BlackColorBrush"); break; } }
protected override void OnLoaded() { var settings = DialogSettings as SigninDialogSettings; if (settings != null && settings.EnablePasswordPreview) { var win8MetroPasswordStyle = FindResource("Win8MetroPasswordBox") as Style; if (win8MetroPasswordStyle != null) { PART_TextBox2.Style = win8MetroPasswordStyle; } } switch (DialogSettings.ColorScheme) { case MetroDialogColorScheme.Accented: PART_SignupButton.Style = FindResource("AccentedDialogHighlightedSquareButton") as Style; PART_TextBox.SetResourceReference(ForegroundProperty, "BlackColorBrush"); PART_TextBox2.SetResourceReference(ForegroundProperty, "BlackColorBrush"); break; } }