Example #1
0
    private void OnGenericViewRequested(object sender, GenericViewRequestedEventArgs e)
    {
        GenericWindow window = new GenericWindow(e.ViewModel);

        window.Owner = this;
        window.ShowDialog();
    }
Example #2
0
 public void Run(object sender, IRunnable runnable)
 {
     _context.Send(_ =>
     {
         var owner  = GetOwner(sender);
         var window = new GenericWindow {
             DataContext = runnable, Owner = owner
         };
         window.ShowDialog();
     });
 }
Example #3
0
        public static void LoadGenericWindow(ref GenericWindow genWindow, System.Windows.Window owner, eWindowShowStyle windowStyle, string windowTitle, Page windowPage,
                                             ObservableList <Button> windowBtnsList = null, bool showClosebtn = true, string closeBtnText = "Close", RoutedEventHandler closeEventHandler = null, bool startupLocationWithOffset = false)
        {
            genWindow = null;
            eWindowShowStyle winStyle;

            do
            {
                if (genWindow != null)
                {
                    winStyle = genWindow.ReShowStyle;
                    genWindow.BottomPanel.Children.Clear();
                    genWindow = null;
                }
                else
                {
                    winStyle = windowStyle;
                }
                genWindow         = new GenericWindow(owner, winStyle, windowTitle, windowPage, windowBtnsList, showClosebtn, closeBtnText, closeEventHandler);
                genWindow.Topmost = true;
                genWindow.Activate();
                genWindow.Title = windowPage.Title;
                if (startupLocationWithOffset)
                {
                    genWindow.WindowStartupLocation = WindowStartupLocation.Manual;
                    genWindow.Left = 50;
                    genWindow.Top  = 200;
                }
                if (winStyle == eWindowShowStyle.Dialog || winStyle == eWindowShowStyle.OnlyDialog)
                {
                    genWindow.ShowDialog();
                }
                else
                {
                    genWindow.Show();
                }
            }while (genWindow.NeedToReShow);
        }