Example #1
0
        public WpfView GetView()
        {
            System.Windows.UIElement view = null;
            WpfView retView = null;

            try
            {
                do
                {
                    view = ViewLocator.LocateForModel(this, null, null);

                    if (view == null)
                    {
                        break;
                    }
                    if (view is WpfView wpfView)
                    {
                        retView = wpfView;
                        ViewModelBinder.Bind(this, retView, null);
                    }
                } while (false);
            }
            catch (Exception e)
            {
                MessageBox.Show($"WpfViewModel::GetView -  Fail to get view of Run Parameters due to exception: {e.Message}");
            }
            return(retView);
        }
Example #2
0
        /// <summary>The on startup.</summary>
        /// <param name="e">The e.</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            this.InitializeErrorHandler();
            NotificationView.Initialize();
            var mainView = new WpfView();

            this.MainWindow = mainView.Window;
            this.controller = new MainViewController(mainView, new AggregateCalendar());
            this.controller.Query();
        }
Example #3
0
 /// <summary>Initializes a new instance of the <see cref="MainWindow" /> class.</summary>
 /// <param name="view">The view.</param>
 internal MainWindow(WpfView view = null)
 {
     this.View = view;
     this.InitializeComponent();
 }