by
0
7
1,062
0
Top 1% !
Popular
Famous
Easy-to-find
Specified
Refined
OpenSource
Popularity: 22945th place

Published on:

InputName0message
InputType0string
LanguageCSharp
LicenseMIT_X11
MethodNameShowOkCancelPopup
OSWindows
OutputTypebool

ShowOkCancelPopup: Shows a popup with OK/Cancel buttons and a message.

<summary>
Shows a popup with OK/Cancel buttons and a message.
</summary>
<param name="message">The message.</param>
<returns>True if the user selected ok, false if they selected cancel.</returns>
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/286563/ShowOkCancelPopup--Shows-a-popup-with-OK?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Citrix.XaAdminMobile.ViewModel; using Citrix.Cmp; /// <summary> /// Shows a popup with OK/Cancel buttons and a message. /// </summary> /// <param name="message">The message.</param> /// <returns>True if the user selected ok, false if they selected cancel.</returns> public static bool ShowOkCancelPopup(string message) { PopupViewModel popupVm = new PopupViewModel(); PopupWindow window = new PopupWindow(); window.Title = Properties.Resources.PopupTitle; PopupButtonViewModel ok = new PopupButtonViewModel(window, PopupButtonType.OK); PopupButtonViewModel cancel = new PopupButtonViewModel(window, PopupButtonType.Cancel); PopupMessageViewModel messageVm = new PopupMessageViewModel(message); popupVm.AddMessage(messageVm); popupVm.AddButton(ok); popupVm.AddButton(cancel); window.DataContext = popupVm; ClientKeyboardController.HideKeyboard(); App app = App.Current as App; if (null != app && null != app.MainWindow) { window.Owner = app.MainWindow; } return window.ShowDialog() ?? false; }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus