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

Get the dialog from a MetroWindow #1467

Closed
wants to merge 5 commits into from

Conversation

saturne1606
Copy link

I need this because i need to fill InputDialog from a barcode scanner.
This function can be used outside from the MahApps.Metro namespace.
This can be modified to not use Reflection, but it should be merged in DialogManager.cs like this

public static async Task<TDialog> GetDialogAsync<TDialog>(MetroWindow owner) where TDialog : BaseMetroDialog
{
    TDialog dialog = null;
    await owner.Dispatcher.BeginInvoke(new Action(() =>
    {
        if (owner.metroDialogContainer.Children.Count != 0)
            dialog = owner.metroDialogContainer.Children[0] as TDialog;
    }));
    return dialog;
}

Sorry for my bad english...

Get the dialog from a MetroWindow
@flagbug
Copy link
Member

flagbug commented Jul 11, 2014

This PR doesn't build

@saturne1606
Copy link
Author

I forgot using... :-( I will correct it

@saturne1606
Copy link
Author

Sorry for failed PR.
I work a lot with await/async and don't know how to do the same without.
It finally builds.

@flagbug
Copy link
Member

flagbug commented Aug 20, 2014

Can you please squash your commits and make the commit message more descriptive?

@punker76
Copy link
Member

@saturne1606

Can you please squash your commits and make the commit message more descriptive?

@punker76
Copy link
Member

punker76 commented Jan 8, 2015

added by 55c1de1

@punker76 punker76 closed this Jan 8, 2015
@punker76 punker76 added this to the 1.1.0 milestone Jan 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants