diff --git a/App/MainWindowViewModel.cs b/App/MainWindowViewModel.cs index 6614b88..908c801 100644 --- a/App/MainWindowViewModel.cs +++ b/App/MainWindowViewModel.cs @@ -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) diff --git a/App/ModernWpfPlayground.csproj b/App/ModernWpfPlayground.csproj index 6a1a116..b734b26 100644 --- a/App/ModernWpfPlayground.csproj +++ b/App/ModernWpfPlayground.csproj @@ -9,10 +9,10 @@ - + - + diff --git a/Controls/Controls.csproj b/Controls/Controls.csproj index 3d8b68e..af3d448 100644 --- a/Controls/Controls.csproj +++ b/Controls/Controls.csproj @@ -7,6 +7,7 @@ +