Skip to content

Commit

Permalink
(#770) Replace normal message box with MahApps Dialog
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AdmiringWorm authored and gep13 committed Jan 21, 2022
1 parent e0a4481 commit e7329bf
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Chocolatey" file="PackageViewModel.cs">
// Copyright 2017 - Present Chocolatey Software, LLC
// Copyright 2014 - 2017 Rob Reynolds, the maintainers of Chocolatey, and RealDimensions Software, LLC
Expand All @@ -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;
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit e7329bf

Please sign in to comment.