Created
October 7, 2018 08:24
-
-
Save Iyemon-018/8f129f635c3738c8b6e1c472db367fa4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using MaterialDesign.Dialog.Example.Dialogs; | |
using MaterialDesign.Dialog.Example.Dialogs.ViewModels; | |
using MaterialDesignThemes.Wpf; | |
namespace MaterialDesign.Dialog.Example.Services | |
{ | |
public class DialogService : IDialogService | |
{ | |
private readonly string _identifier; | |
public DialogService(string identifier) | |
{ | |
_identifier = identifier; | |
} | |
public async Task<bool> Question(string message) | |
{ | |
MessageDialog dialog = new MessageDialog | |
{ | |
DataContext = new MessageDialogViewModel | |
{ | |
Message = message | |
} | |
}; | |
object result = await DialogHost.Show(dialog, _identifier); | |
return (result is bool selectedResult) && selectedResult; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment