{"id":861,"date":"2019-04-09T14:33:10","date_gmt":"2019-04-09T13:33:10","guid":{"rendered":"https:\/\/ibex.tech\/windows-iot\/?p=861"},"modified":"2019-04-09T14:33:10","modified_gmt":"2019-04-09T13:33:10","slug":"messagebox","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/uwp-programming-in-c\/messagebox-dialog\/messagebox","title":{"rendered":"MessageBox"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">OK Messagebox<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>using Windows.UI.Popups;\n\n\t\/\/----- SHOW MESSAGEBOX -----\n\tvar dialog = new MessageDialog(\"Main message...\", \"MessageBox title\");\n\tdialog.Options = MessageDialogOptions.None;\n\tdialog.Commands.Add(new UICommand(\"OK\", cmd =&gt; {}));\n\tdialog.DefaultCommandIndex = 0;\n\tdialog.CancelCommandIndex = 0;\n\tvar command = await dialog.ShowAsync();<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">OK Cancel Messagebox<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tvar dialog = new MessageDialog(\"Main message...\", \"MessageBox title\");\n\tdialog.Options = MessageDialogOptions.None;\n\tdialog.Commands.Add(new UICommand { Label = \"OK\", Id = 0 } );\n\tdialog.Commands.Add(new UICommand { Label = \"Cancel\", Id = 1 } );\n\tvar command = await dialog.ShowAsync();\n\tif ((int)command.Id == 0)\n\t{\n\t\t\/\/OK PRESSED\n\t}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>OK Messagebox OK Cancel Messagebox<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105],"tags":[],"class_list":["post-861","post","type-post","status-publish","format-standard","hentry","category-messagebox-dialog"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=861"}],"version-history":[{"count":0,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/861\/revisions"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}