From e7329bfd7c91ceeed32c92daf10a39ee2e9b1c2b Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Thu, 20 Jan 2022 18:14:22 +0100 Subject: [PATCH] (#770) Replace normal message box with MahApps Dialog This commit removes the use of a normal Windows MessageBox to instead use the Dialog service to show a message instead. This flows better into how the styling is used in the rest of the application. --- .../ViewModels/Items/PackageViewModel.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/ChocolateyGui.Common.Windows/ViewModels/Items/PackageViewModel.cs b/Source/ChocolateyGui.Common.Windows/ViewModels/Items/PackageViewModel.cs index acd2c0821..99e020c0c 100644 --- a/Source/ChocolateyGui.Common.Windows/ViewModels/Items/PackageViewModel.cs +++ b/Source/ChocolateyGui.Common.Windows/ViewModels/Items/PackageViewModel.cs @@ -1,4 +1,4 @@ -// -------------------------------------------------------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- // // Copyright 2017 - Present Chocolatey Software, LLC // Copyright 2014 - 2017 Rob Reynolds, the maintainers of Chocolatey, and RealDimensions Software, LLC @@ -7,10 +7,11 @@ using System; using System.Diagnostics; +using System.Linq; using System.Threading.Tasks; -using System.Windows; using AutoMapper; using Caliburn.Micro; +using chocolatey; using ChocolateyGui.Common.Base; using ChocolateyGui.Common.Models; using ChocolateyGui.Common.Models.Messages; @@ -426,10 +427,13 @@ public bool IsPackageSizeAvailable get { return PackageSize != -1; } } - public void ShowArguments() + public async Task ShowArguments() { - var decryptedArguments = _packageArgumentsService.DecryptPackageArgumentsFile(Id, Version.ToString()); - MessageBox.Show(decryptedArguments); + var decryptedArguments = _packageArgumentsService.DecryptPackageArgumentsFile(Id, Version.ToString()).ToList(); + + await _dialogService.ShowMessageAsync( + Resources.PackageViewModel_ArgumentsForPackageFormat.format_with(Title), + string.Join(Environment.NewLine, decryptedArguments)); } public async Task Install()