nice features

This commit is contained in:
2020-02-18 20:08:06 +01:00
parent 2467cad2a1
commit b910d3a1e6
6 changed files with 64 additions and 25 deletions

View File

@@ -8,13 +8,15 @@ namespace ModernWpfPlayground
{
public WindowViewModel()
{
ShowDialogCommand = new RelayCommand(async x => await ShowDialogAsync(x));
ShowDialogCommand = new RelayCommand(async x => await ShowDialogAsync());
CloseCommand = new RelayCommand(x => Application.Current.Shutdown());
}
private async Task ShowDialogAsync(object obj)
private async Task ShowDialogAsync()
{
var dialog = new ContentDialogExample();
await dialog.ShowAsync();
var dialog = new ContentDialogExample {Message = WelcomeMessage};
var result = await dialog.ShowAsync();
WelcomeMessage = result.ToString();
}
public bool BooleanValue
@@ -41,6 +43,14 @@ namespace ModernWpfPlayground
set => SetProperty(value);
}
public ICommand ShowDialogCommand { get; }
public RelayCommand ShowDialogCommand { get; }
public string WelcomeMessage
{
get => GetProperty("Shadow of the empire");
set => SetProperty(value);
}
public ICommand CloseCommand { get; }
}
}