/// <summary> /// ToDo: Unfinished /// </summary> #warning This ShowDialog method is unfinished public static int ShowDialog(Window owner, string text, string title, string[] buttonChoices) { PosDialogWindow window = new PosDialogWindow(owner); DialogBoxControl control = (DialogBoxControl)window.DockedControl; double width, height; MeasureText(control.textBox1, text, out width, out height); control.textBox1.Text = text; window.IsClosable = false; window.Width = width; window.Height = height; window.labelTitle.Content = title; window.ShowDialog(); // Return the selected button index, not -1 return(-1); }
private PosDialogWindow(Window parent, bool shadeParent = false) { _isClosable = true; ClosedByUser = false; AllowsTransparency = false; InitializeComponent(); if (ForceTopMost) { Topmost = true; } Owner = parent; DockedControl = new DialogBoxControl(); dockPanel1.Children.Add(DockedControl); if (!shadeParent) { return; } Loaded += PosDialogWindow_Loaded; Closed += PosDialogWindow_Closed; }