문제

I have looked at the documentation at http://mahapps.com/controls/dialogs.html but I am still not sure how to use it. There is no documentation for ShowMetroDialogAsync().

도움이 되었습니까?

해결책

You have to create the dialog as a control like this:

<metro:BaseMetroDialog x:Class="Example.Dialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:metro="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
    Title="My new dialog">
  <TextBlock Text="Example" />
</metro:BaseMetroDialog>

Then, from another MetroWindow, you can show the dialog with something like this:

var dialog = new Example.Dialog()
await this.ShowMetroDialogAsync(dialog);

다른 팁

Add the following code:

await DialogManager.ShowMessageAsync(this, "Message Title here", "Your message description here");

The this keyword references your window

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top