Beispiel #1
0
        private static DialogRepository RegisterDialogs(Window wnd)
        {
            DialogRepository dialogRepository = new DialogRepository(wnd);

            dialogRepository.Register <PatientUpdateViewModel, PatientDialogWindow>();
            dialogRepository.Register <PatientNewViewModel, PatientDialogWindow>();
            dialogRepository.Register <AppointmentViewModel, AppointmentDialogWindow>();
            dialogRepository.Register <PatientListViewModel, PatientListDialogWindow>();
            dialogRepository.Register <ErrorViewModel, ErrorDialogWindow>();
            return(dialogRepository);
        }
Beispiel #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            try {
                var(importService, reportService) = WorkSpeedBusinessContextCreator.Create();
                reportService.ReloadAllCollections();

                Window mainWindow       = new MainWindow();
                var    dialogRepository = new DialogRepository(mainWindow);
                dialogRepository.Register <ErrorViewModel, ErrorWindow>();
                var mvm = new MainViewModel(importService, reportService, dialogRepository);
                mainWindow.DataContext = mvm;

                mainWindow.Show();
            }
            catch
#if RELEASE
            (Exception ex)
#endif
            {
#if DEBUG
                throw;
#endif

#if RELEASE
                string message = $"{ex.Message}\n{ex.InnerException}\n{ex.StackTrace}";
                File.AppendAllText("log.log", message);
#endif
            }
        }