1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +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"
Margin="0 0 5 0"
Content="Alrighty, let's go!"
Style="{DynamicResource AccentedDialogSquareButton}" />
Style="{DynamicResource AccentedDialogSquareButton}" Click="PART_AffirmativeButton_Click" />
</StackPanel>
</Grid>
</dialogs:CustomDialog>

View File

@ -1,28 +1,45 @@
using System.Windows;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
namespace Artemis.Dialogs
{
/// <summary>
/// Interaction logic for MarkdownDialog.xaml
/// </summary>
public partial class MarkdownDialog
public partial class MarkdownDialog : CustomDialog
{
public MetroWindow ParentWindow { get; set; }
public static readonly DependencyProperty MarkdownProperty = DependencyProperty.Register("Markdown",
typeof(string), typeof(MarkdownDialog), new PropertyMetadata(default(string)));
public MarkdownDialog()
public MarkdownDialog(MetroWindow parentWindow)
{
ParentWindow = parentWindow;
InitializeComponent();
Tcs = new TaskCompletionSource<MessageDialogResult>();
CommandBindings.Add(new CommandBinding(NavigationCommands.GoToPage,
(sender, e) => System.Diagnostics.Process.Start((string) e.Parameter)));
}
public TaskCompletionSource<MessageDialogResult> Tcs { get; set; }
public string Markdown
{
get { return (string) GetValue(MarkdownProperty); }
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)
return;
var dialog = new MarkdownDialog
var dialog = new MarkdownDialog(GetActiveWindow())
{
Markdown = markdown,
Title = title