예제 #1
0
        void loadSuperSession()
        {
            ViewModelProjectManager dc = DataContext as ViewModelProjectManager;

            if (dc == null || dc.ActiveStudy == null || superSessionStrip.SelectedSuperSession == null)
            {
                return;
            }

            if (!dc.ActiveStudy.IsSelectedSuperSessionOpened())
            {
                Dispatcher.BeginInvoke(new Action(() => {
                    try
                    {
                        ViewModelImagingSuperSession selected = superSessionStrip.SelectedSuperSession as ViewModelImagingSuperSession;
                        if ((dc.ActiveStudy.OpenedSelectedSuperSession as ViewModelImagingSuperSession)?.VerifySavingOfDataModelChanges(true) ?? true)
                        {
                            dc.ActiveStudy.SelectedSuperSession = selected;
                            dc.ActiveStudy.LoadSelectedSuperSession();
                        }
                    }
                    catch (Exception ex)
                    {
                        ViewMSOTcSystem.LogMessage(Xvue.MSOT.Services.Log.EnumLogType.Warning, "Selected SuperSession load", ex.Message);
                    }
                }));
            }
            else if (dc.ActiveStudy.SelectedSuperSession == null)
            {
                Window parentWindow = Window.GetWindow(this);
                dc.MSOTService.NotifyUserOnAction("Select a visualization to load", parentWindow.Title, UserNotificationType.Warning, false);
            }
        }
예제 #2
0
        void onNewComparisonSuperSessionButtonClick(object sender, RoutedEventArgs e)
        {
            ViewModelProjectManager dc = this.DataContext as ViewModelProjectManager;

            if (dc != null && dc.ActiveStudy != null && superSessionStrip.SelectedSuperSession != null)
            {
                dc.ActiveStudy.CreateNewAnalysisFromSelectedSnapshot();
                loadSuperSession();
            }
        }
예제 #3
0
        static void ShowSelectedSuperSessionChanged(DependencyObject source, DependencyPropertyChangedEventArgs e)
        {
            ViewPatientAnalysis     control = source as ViewPatientAnalysis;
            ViewModelProjectManager dc      = control.DataContext as ViewModelProjectManager;

            try
            {
                if ((bool)e.NewValue && dc != null && (dc?.ActiveStudy?.SelectedSuperSession.IsLoaded ?? false))
                {
                    dc.ActiveStudy.OpenedSelectedSuperSession = dc.ActiveStudy.SelectedSuperSession;
                }
            }
            finally
            {
                control.ShowSelectedSuperSession = false;
            }
        }