Files
FluentTerminal/FluentTerminal.App/Services/Implementation/DialogService.cs
T
2018-02-14 18:00:00 +01:00

24 lines
645 B
C#

using System;
using System.Threading.Tasks;
using Windows.UI.Popups;
namespace FluentTerminal.App.Services.Implementation
{
internal class DialogService : IDialogService
{
public async Task<DialogButton> ShowDialogAsnyc(string title, string content, params DialogButton[] buttons)
{
var dialog = new MessageDialog(content, title);
foreach (var button in buttons)
{
dialog.Commands.Add(new UICommand(button.ToString()));
}
var result = await dialog.ShowAsync();
return Enum.Parse<DialogButton>(result.Label);
}
}
}