コード例 #1
0
ファイル: Show.cs プロジェクト: ktzsoe/Forge.Forms
            private DialogResult ShowWindow(object model)
            {
                object lastAction          = null;
                object lastActionParameter = null;
                var    window = new DialogWindow(model, context, options);

                if (options.TopMost)
                {
                    window.Topmost = true;
                }

                window.Form.OnAction += (s, e) =>
                {
                    lastAction          = e.ActionContext.Action;
                    lastActionParameter = e.ActionContext.ActionParameter;
                };

                window.ShowDialog();
                if (options.BringToFront)
                {
                    window.Activate();
                    window.Focus();
                }

                return(new DialogResult(window.Form.Value, lastAction, lastActionParameter));
            }
コード例 #2
0
ファイル: Show.cs プロジェクト: BenjaminSieg/Forge.Forms
            private DialogResult ShowWindow(object model)
            {
                return(Application.Current.Dispatcher.Invoke(() =>
                {
                    object lastAction = null;
                    object lastActionParameter = null;
                    var window = new DialogWindow(model, context, options);
                    if (options.TopMost)
                    {
                        window.Topmost = true;
                    }

                    window.Form.OnAction += (s, e) =>
                    {
                        lastAction = e.ActionContext.Action;
                        lastActionParameter = e.ActionContext.ActionParameter;
                    };

                    window.Owner = Application.Current.MainWindow;
                    window.ShowDialog();

                    if (options.BringToFront)
                    {
                        window.Activate();
                        window.Focus();
                        Keyboard.Focus(window);
                    }
                    return new DialogResult(window.Form.Value, lastAction, lastActionParameter);
                }));
            }
コード例 #3
0
ファイル: Show.cs プロジェクト: kioltk/VKDesktop
 public static void DialogWindow(Dialog dialog)
 {
     if (!DialogWindowFocus(dialog))
     {
         DialogWindow dialogWindow = new DialogWindow(dialog);
         dialogWindow.Show();
         dialogWindow.Activate();
     }
 }