{"action":"closed","issue":{"url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/2232","labels_url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/2232/labels{/name}","comments_url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/2232/comments","events_url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/2232/events","html_url":"https://github.com/MahApps/MahApps.Metro/issues/2232","id":119147446,"number":2232,"title":"How to call ShowMessageDialog in user control","user":{"login":"akshithrajesh","id":15243183,"avatar_url":"https://avatars.githubusercontent.com/u/15243183?v=3","gravatar_id":"","url":"https://api.github.com/users/akshithrajesh","html_url":"https://github.com/akshithrajesh","followers_url":"https://api.github.com/users/akshithrajesh/followers","following_url":"https://api.github.com/users/akshithrajesh/following{/other_user}","gists_url":"https://api.github.com/users/akshithrajesh/gists{/gist_id}","starred_url":"https://api.github.com/users/akshithrajesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akshithrajesh/subscriptions","organizations_url":"https://api.github.com/users/akshithrajesh/orgs","repos_url":"https://api.github.com/users/akshithrajesh/repos","events_url":"https://api.github.com/users/akshithrajesh/events{/privacy}","received_events_url":"https://api.github.com/users/akshithrajesh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-27T07:52:36Z","updated_at":"2015-11-27T08:00:35Z","closed_at":"2015-11-27T08:00:35Z","body":"How to call ShowMessageDialog in user control\r\n\r\n```csharp\r\npublic async void ShowMessageDialog(object sender, RoutedEventArgs e)\r\n{\r\n// This demo runs on .Net 4.0, but we're using the Microsoft.Bcl.Async package so we have async/await support\r\n// The package is only used by the demo and not a dependency of the library!\r\nvar mySettings = new MetroDialogSettings()\r\n{\r\nAffirmativeButtonText = \"Hi\",\r\nNegativeButtonText = \"Go away!\",\r\nFirstAuxiliaryButtonText = \"Cancel\",\r\nColorScheme = MetroDialogOptions.ColorScheme\r\n};\r\n\r\n        MessageDialogResult result = await this.ShowMessageAsync(\"Hello!\", \"Welcome to the world of metro!\",\r\n            MessageDialogStyle.AffirmativeAndNegativeAndSingleAuxiliary, mySettings);\r\n\r\n        if (result != MessageDialogResult.FirstAuxiliary)\r\n            await this.ShowMessageAsync(\"Result\", \"You said: \" + (result == MessageDialogResult.Affirmative ? mySettings.AffirmativeButtonText : mySettings.NegativeButtonText +\r\n                Environment.NewLine + Environment.NewLine + \"This dialog will follow the Use Accent setting.\"));\r\n    }\r\n```"}}