Fixed Show dialog bug and updated nuget packages

This commit is contained in:
2020-06-05 20:48:16 +02:00
parent 0cf6664ee1
commit 7874f71ca2
3 changed files with 8 additions and 8 deletions

View File

@@ -22,7 +22,7 @@ namespace ModernWpfPlayground
public MainWindowViewModel()
{
ShowDialogCommand = new DelegateCommand(() => ShowDialogAsync().Await());
ShowDialogCommand = new DelegateCommand(ShowDialog);
CloseCommand = new DelegateCommand(() => Application.Current.Shutdown());
OpenViewModelCommand = new DelegateCommand(LoadViewModel);
SaveViewModelCommand = new DelegateCommand(SaveViewModel);
@@ -35,10 +35,10 @@ namespace ModernWpfPlayground
_deserializer = new DeserializerBuilder().Build();
}
public string? Path
private string? Path
{
get => _path;
private set => SetProperty(ref _path, value,
set => SetProperty(ref _path, value,
() => Title = value != null ? $"{System.IO.Path.GetFileName(value)} - {AppName}" : AppName);
}
@@ -123,11 +123,10 @@ namespace ModernWpfPlayground
};
}
private async Task ShowDialogAsync()
private void ShowDialog()
{
var dialog = new ContentDialogExample {Message = WelcomeMessage};
var result = await dialog.ShowAsync().ConfigureAwait(false);
WelcomeMessage = result.ToString();
dialog.ShowAsync().Await(completedCallback: x => WelcomeMessage = x.ToString());
}
private void BooleanValue_OnChanged(bool obj)