1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-31 17:53:32 +00:00

Fixed changelog not hiding

This commit is contained in:
SpoinkyNL 2016-11-16 00:40:36 +01:00
parent b2c09a96b5
commit 137497c2ee
3 changed files with 22 additions and 5 deletions

View File

@ -47,7 +47,7 @@
MinWidth="80" MinWidth="80"
Margin="0 0 5 0" Margin="0 0 5 0"
Content="Alrighty, let's go!" Content="Alrighty, let's go!"
Style="{DynamicResource AccentedDialogSquareButton}" /> Style="{DynamicResource AccentedDialogSquareButton}" Click="PART_AffirmativeButton_Click" />
</StackPanel> </StackPanel>
</Grid> </Grid>
</dialogs:CustomDialog> </dialogs:CustomDialog>

View File

@ -1,28 +1,45 @@
using System.Windows; using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input; using System.Windows.Input;
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
namespace Artemis.Dialogs namespace Artemis.Dialogs
{ {
/// <summary> /// <summary>
/// Interaction logic for MarkdownDialog.xaml /// Interaction logic for MarkdownDialog.xaml
/// </summary> /// </summary>
public partial class MarkdownDialog public partial class MarkdownDialog : CustomDialog
{ {
public MetroWindow ParentWindow { get; set; }
public static readonly DependencyProperty MarkdownProperty = DependencyProperty.Register("Markdown", public static readonly DependencyProperty MarkdownProperty = DependencyProperty.Register("Markdown",
typeof(string), typeof(MarkdownDialog), new PropertyMetadata(default(string))); typeof(string), typeof(MarkdownDialog), new PropertyMetadata(default(string)));
public MarkdownDialog()
public MarkdownDialog(MetroWindow parentWindow)
{ {
ParentWindow = parentWindow;
InitializeComponent(); InitializeComponent();
Tcs = new TaskCompletionSource<MessageDialogResult>();
CommandBindings.Add(new CommandBinding(NavigationCommands.GoToPage, CommandBindings.Add(new CommandBinding(NavigationCommands.GoToPage,
(sender, e) => System.Diagnostics.Process.Start((string) e.Parameter))); (sender, e) => System.Diagnostics.Process.Start((string) e.Parameter)));
} }
public TaskCompletionSource<MessageDialogResult> Tcs { get; set; }
public string Markdown public string Markdown
{ {
get { return (string) GetValue(MarkdownProperty); } get { return (string) GetValue(MarkdownProperty); }
set { SetValue(MarkdownProperty, value); } set { SetValue(MarkdownProperty, value); }
} }
private void PART_AffirmativeButton_Click(object sender, RoutedEventArgs e)
{
ParentWindow.HideMetroDialogAsync(this);
}
} }
} }

View File

@ -60,7 +60,7 @@ namespace Artemis.Services
if (GetActiveWindow() == null) if (GetActiveWindow() == null)
return; return;
var dialog = new MarkdownDialog var dialog = new MarkdownDialog(GetActiveWindow())
{ {
Markdown = markdown, Markdown = markdown,
Title = title Title = title