Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            Application.Current.ShutdownMode = ShutdownMode.OnLastWindowClose;

            Closing += (s, e) =>
            {
                var dc = DataContext as BaseViewModel;
                if (dc == null || _closingAccepted)
                {
                    return;
                }
                e.Cancel         = true;
                _closingAccepted = true;
                MessengerHelper.SendCloseWindowMessage(dc);
                Environment.Exit(0);
            };
        }
Exemplo n.º 2
0
 internal static void LoadMainWindow()
 {
     MessengerHelper.SendDisplayViewMessage(null, ViewsEnum.MainWindow);
     MessengerHelper.SendDisplayViewMessage(Current, ViewsEnum.Filler);
 }