Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releases v8 #129

Merged
merged 6 commits into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ This project adheres to [Semantic Versioning](http://semver.org/) and is followi

## Unreleased

NOTE: Features with breaking changes are found on branch [releases/v8](https://github.com/FantasticFiasco/mvvm-dialogs/tree/releases/v8) and will stay there until a new major version is released. Until then the features have been published to [www.nuget.org](https://www.nuget.org/packages/MvvmDialogs/) as pre-releases to v8.

### :zap: Added

- Support for .NET Core 3.1

### :syringe: Changed

- [#116](https://github.com/FantasticFiasco/mvvm-dialogs/issues/116) [BREAKING CHANGE] `IDialogService.Close` returns `false` instead of throwing an exception when failing to close a dialog. This behavior aligns with the behavior of `IDialogService.Activate`.

### :skull: Removed

- [BREAKING CHANGE] Support for .NET Core 3.0 due to [deprecation as of March 3, 2020](https://dotnet.microsoft.com/platform/support/policy/dotnet-core)
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<VersionPrefix>7.1.1</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionPrefix>8.0.0</VersionPrefix>
<VersionSuffix>beta.4</VersionSuffix>
<Authors>Mattias Kindborg</Authors>
<Company>FantasticFiasco</Company>
<Product>MVVM Dialogs</Product>
Expand Down
2 changes: 1 addition & 1 deletion SolutionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
[assembly: AssemblyCulture("")]

// Assembly version
[assembly: AssemblyVersion("7.1.1")]
[assembly: AssemblyVersion("8.0.0")]
15 changes: 10 additions & 5 deletions src/net/DialogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,30 @@ select window.Activate()
}

/// <inheritdoc />
public void Close(INotifyPropertyChanged viewModel)
public bool Close(INotifyPropertyChanged viewModel)
{
if (viewModel == null) throw new ArgumentNullException(nameof(viewModel));

foreach (Window? window in Application.Current.Windows)
{
if (window == null)
if (window == null || !viewModel.Equals(window.DataContext))
{
continue;
}

if (viewModel.Equals(window.DataContext))
try
{
window.Close();
return;
return true;
}
catch (Exception e)
{
Logger.Write($"Failed to close dialog: {e}");
break;
}
}

throw new DialogNotFoundException();
return false;
}

/// <inheritdoc />
Expand Down
8 changes: 4 additions & 4 deletions src/net/IDialogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ void Show(
/// <see cref="Show{T}"/> or <see cref="ShowCustom{T}"/>.
/// </summary>
/// <param name="viewModel">The view model of the dialog to close.</param>
/// <exception cref="DialogNotFoundException">
/// No dialog is found with specified view model as data context.
/// </exception>
void Close(INotifyPropertyChanged viewModel);
/// <returns>
/// true if the <see cref="Window"/> was successfully closed; otherwise, false.
/// </returns>
bool Close(INotifyPropertyChanged viewModel);

/// <summary>
/// Displays a message box that has a message, title bar caption, button, and icon; and
Expand Down