コード例 #1
0
        private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            VisualisationViewModel vvm = (d as VisualisationViewModel);
            bool changed = false;
            bool connectionSettingsChanged = false;

            switch (e.Property.Name)
            {
            case "ReproducibleExecution":
                changed = vvm.Parent.SettingContainer.Settings.SlamSettings.ReproducibleExecution != vvm.ReproducibleExecution;
                vvm.Parent.SettingContainer.Settings.SlamSettings.ReproducibleExecution = vvm.ReproducibleExecution;
                connectionSettingsChanged = false;
                break;

            case "EnableVisualInertial":
                changed = vvm.Parent.SettingContainer.Settings.SlamSettings.EnableVisualInertial != vvm.EnableVisualInertial;
                vvm.Parent.SettingContainer.Settings.SlamSettings.EnableVisualInertial = vvm.EnableVisualInertial;
                connectionSettingsChanged = false;
                break;

            case "ShowKeyFrameOrientations":
                changed = vvm.Parent.SettingContainer.Settings.SlamSettings.ShowKeyFrameOrientations != vvm.ShowKeyFrameOrientations;
                vvm.Parent.SettingContainer.Settings.SlamSettings.ShowKeyFrameOrientations = vvm.ShowKeyFrameOrientations;
                connectionSettingsChanged = false;
                vvm.SlamModel3D.ShowKeyFrameOrientations = vvm.ShowKeyFrameOrientations;
                break;

            default:
                break;
            }
            if (changed)
            {
                vvm.Parent.UpdateSettings(connectionSettingsChanged);
            }
        }
コード例 #2
0
        public MainViewModel()
        {
            _IOProxy = new IOProxy(_SettingContainer);

            _SyncContext = SynchronizationContext.Current;

            CameraViewModel        = new CameraViewModel(this);
            SettingViewModel       = new SettingViewModel(this);
            DataPlotViewModel      = new DataPlotViewModel(this);
            CalibrationViewModel   = new CalibrationViewModel(this);
            RecordViewModel        = new RecordViewModel(this);
            ReplayViewModel        = new ReplayViewModel(this);
            DebugViewModel         = new DebugViewModel(this);
            VisualisationViewModel = new VisualisationViewModel(this);

            _DialogCoordinator = MahApps.Metro.Controls.Dialogs.DialogCoordinator.Instance;
        }