Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The ShowMessageAsync of MahApps.Metro won't show the message dialog #41

Closed
imgen opened this issue Aug 22, 2015 · 11 comments
Closed

The ShowMessageAsync of MahApps.Metro won't show the message dialog #41

imgen opened this issue Aug 22, 2015 · 11 comments
Assignees
Milestone

Comments

@imgen
Copy link

imgen commented Aug 22, 2015

When I tried the MahApps sample, I wanted to show a message dialog, so I followed the documentation and called ShowMessageAsync to do that. But unfortunately this doesn't work, the window will dim out, but the message will not show up. Can you help me with this?

@imgen
Copy link
Author

imgen commented Aug 22, 2015

Another strange thing is that if I try it in my own project using the latest nuget packages (MahApps.Metro 1.1.3-ALPHA152, MaterialDesignThemes 0.0.0.92, MaterialDesignColors 1.0.0) instead of the source code, I get a null exception, the cause is that MahApps.Metro complains theme is null, how does this happen? Maybe I should use the latest source code instead of the latest nuget package?

@ButchersBoy ButchersBoy self-assigned this Aug 22, 2015
@ButchersBoy
Copy link
Collaborator

OK...because when you open a MahApps dialog, it looks up the MahApps theme, but there is no MahApps theme, as the App.xaml is configured a bit differently for Material Design Toolkit. Bang.

...looking into a solution...

@ButchersBoy ButchersBoy added this to the ver 1.0 milestone Aug 22, 2015
@imgen
Copy link
Author

imgen commented Aug 22, 2015

Thanks, looking forward to the solution

@ButchersBoy
Copy link
Collaborator

Raised a PR with MahApps: MahApps/MahApps.Metro#2087 , which should resolve the issue.

@imgen
Copy link
Author

imgen commented Aug 22, 2015

Wooo! That was fast! Thanks for the quick response!

@ButchersBoy
Copy link
Collaborator

⚡ 😉

@ButchersBoy
Copy link
Collaborator

Keep your eye on the MashUp demo project, because I'm making some other changes so we can pass Material Themeing through to MahApss for the dialogs. Currently, even when the fix is in it shows Metro styling.

@imgen
Copy link
Author

imgen commented Aug 22, 2015

Cool. Will do just that.

@ButchersBoy
Copy link
Collaborator

In bizness.

image

You'll need to update to the latest alphas of both MahApps and Material. You can see the above example in the MahMaterialDragablzMashUp demo app.

You need to pass a few options into the dialog, but it's pretty easy:

private void InputDialog()
{
    var metroDialogSettings = new MetroDialogSettings
    {
        CustomResourceDictionary =
            new ResourceDictionary
            {
                Source = new Uri("pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.MahApps.Dialogs.xaml")
            },
        NegativeButtonText = "CANCEL",                
        SuppressDefaultResources = true
    };

    DialogCoordinator.Instance.ShowInputAsync(this, "MahApps Dialog", "Using Material Design Themes", metroDialogSettings);
}

@punker76
Copy link
Contributor

@ButchersBoy it's like chocolate or a praline :-P

@ButchersBoy
Copy link
Collaborator

Ha, we should do some Photoshop image of a box of chocolates with the different flavours 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants