문제

inside my wpf application i have a dialog(Mahapp control) and i need to add a passwordbox to this dialog instead of the textinput.Any ideas of how to do that.

 private async void ShowModalDialog_Click(object sender, RoutedEventArgs e)
{
    popup.IsEnabled = false;
     this.MetroDialogOptions.ColorScheme = UseAccentForDialog.IsEnabled ? MetroDialogColorScheme.Accented : MetroDialogColorScheme.Theme;
     var result = await this.ShowInputAsync("FERMETURE DE L'APPLICATION.", "Tu dois demander à tes parents pour quitter." + "\n" + "Indiquer votre mot de passe pour quitter l'application.");
     var wcf = new ServiceReferenceParent.ParentServiceClient();
     Parent par = wcf.GetParent(parent.ParentId);
    if (result == par.Password) //user pressed cancel
        Application.Current.Shutdown() ;
}
도움이 되었습니까?

해결책

Since there is no available implementation, you will need to create your own dialog.

See the MahApps.Metro Dialog section at github for further details whether your concern was implemented or not. You may also replace the TextBox control by a PasswordBox control in the present code. This shouldn't be a problem since we are talking about just one control which isn't actually quite different than the TextBox.

UPDATE:

As I was researching for my current project, I found an issue in the MahApps.Metro repository where someone released a login dialog. You might want to check this out. I'm going to use that now.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top