Ejemplo n.º 1
0
 public VdWndInput(string text, WndInput wndInput, Func <string, string> func = null)
     : base(wndInput)
 {
     this.Text = (text ?? "");
     this._wnd = wndInput;
     SetBinding("Text", wndInput.tboxInput, () => func(this.Text));
 }
Ejemplo n.º 2
0
        public static void MyShow(string tip, string title, Action <string> callback, string inputDef = null, string helpurl = null, Func <string, string> validator = null, Window owner = null, bool startUpCenterOwner = false)
        {
            var editor = new WndInput(tip, title, inputDef, helpurl, validator);

            editor.Owner   = owner;
            editor.Closed += (sender, e) =>
            {
                if (editor._isClosedByOkButton)
                {
                    callback(editor.Result);
                }
            };
            WindowEx.xSetStartUpLocation(editor, startUpCenterOwner);
            WindowEx.xShowFirstTime(editor);
        }
Ejemplo n.º 3
0
        public static string MyShowDialog(string tip, string title, string inputDef = null, string helpurl = null, Func <string, string> validator = null, Window owner = null, bool startUpCenterOwner = false)
        {
            var txt = string.Empty;

            DispatcherEx.xInvoke(() =>
            {
                var editor   = new WndInput(tip, title, inputDef, helpurl, validator);
                editor.Owner = owner;
                WindowEx.xSetStartUpLocation(editor, startUpCenterOwner);
                var dlgRlt = editor.ShowDialogEx(owner);
                if (dlgRlt.HasValue && dlgRlt.Value)
                {
                    txt = editor.Result;
                }
            });
            return(txt);
        }