public static InputDialogBoxResult Show(string message, string caption) { var dlgBox = new InputDialogBoxWindow { Title = caption, Message = message }; var result = dlgBox.ShowDialog(); if (result == true) { var input = dlgBox.InputString; return(new InputDialogBoxResult(InputDialogBoxButton.Okay, input)); } else { return(new InputDialogBoxResult(InputDialogBoxButton.Cancel, "")); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.window = ((Knb.UI.Wpf.Utilities.InputDialogBox.InputDialogBoxWindow)(target)); return; case 2: this.TxtB_message = ((System.Windows.Controls.TextBlock)(target)); return; case 3: this.Txt_input = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.Btn_ok = ((System.Windows.Controls.Button)(target)); #line 20 "..\..\..\..\..\Utilities\InputDialogBox\InputDialogBoxWindow.xaml" this.Btn_ok.Click += new System.Windows.RoutedEventHandler(this.Btn_ok_Click); #line default #line hidden return; case 5: this.Btn_cancel = ((System.Windows.Controls.Button)(target)); #line 21 "..\..\..\..\..\Utilities\InputDialogBox\InputDialogBoxWindow.xaml" this.Btn_cancel.Click += new System.Windows.RoutedEventHandler(this.Btn_cancel_Click); #line default #line hidden return; } this._contentLoaded = true; }