Beispiel #1
0
        public T ShowDialog <T>(BaseModelView modelView = null) where T : Window
        {
            T window = Activator.CreateInstance <T>();

            window.Owner = Application.Current.MainWindow;
            window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            window.DataContext           = modelView;
            window.Show();
            return(window);
        }
Beispiel #2
0
        public MainWindow()
        {
            viewProfile = new BaseModelView();
            InitializeComponent();

            this.DataContext = viewProfile;
            Main.Content     = new InfoError("Hello! Use the panel above to search for the summoner");

            MenuBar.Visibility       = Visibility.Hidden;
            GeneralButton.Foreground = Brushes.Purple;
        }
Beispiel #3
0
 public void ShowDialogThreadSafe(Window window, BaseModelView modelView = null)
 {
     window.Owner = Application.Current.MainWindow;
     window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
     window.DataContext           = modelView;
     //window.ShowDialog();
     //wizard.CreateUi();
     //bool? dialogResult = wizard.ShowDialog();
     window.Dispatcher.Invoke(DispatcherPriority.Normal, new ThreadStart(window.Show));
     //if (dialogResult.HasValue)
     //{
     //    return dialogResult.Value;
     //}
     //return false;
 }
Beispiel #4
0
        public bool ShowWizard <T>(BaseModelView modelView = null) where T : Wizard
        {
            T wizard = Activator.CreateInstance <T>();

            wizard.Owner = Application.Current.MainWindow;
            wizard.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            wizard.DataContext           = modelView;
            wizard.CreateUi();
            bool?dialogResult = wizard.ShowDialog();

            if (dialogResult.HasValue)
            {
                return(dialogResult.Value);
            }
            return(false);
        }