ModernDialog DialogResult

Sep 11, 2013 at 12:32 PM
Edited Sep 11, 2013 at 12:47 PM
Using ModernDialog is confusing.
I don't know how to read ModernDialog OK / Yes / No / Cancel DialogResult value.

var v = new ModernDialog
{
 Title = "Common dialog",
 Content = new LoremIpsum(),
};
v.Buttons = new Button[] { v.OkButton, v.CancelButton };

bool? result = v.ShowDialog();
if (result.HasValue)
{
 MessageBox.Show(v.DialogResult.ToString());    
 // allways false because DialogResult is bool?
}

mui has private property dialogResult but I don't have access to it.
I think mui needs new property
public new MessageBoxResult DialogResult { get { return dialogResult; } }

or are there better ways to do that?
Sep 11, 2013 at 1:16 PM
Edited Sep 11, 2013 at 1:20 PM
MessageBoxButton btn = MessageBoxButton.YesNo;
if(ModernDialog.ShowMessage("MSG", "Caption", btn) == MessageBoxResult.Yes)
{
    //Do something
}
You can still use an anonymous call like you have in your post. Just when working with this framwork it's MessageBoxResult that you will care about.
Sep 11, 2013 at 1:41 PM
I can't use ModernDialog.ShowMessage because I need special Dialog, Calendar etc.