Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainViewModel"/> class.
        /// </summary>
        public MainViewModel()
        {
            m_config = new AnalysisConfig();
            Analysis = new MultiAlignAnalysis();
            m_config.AnalysisName = "Analysis.db3";
            m_config.Analysis = Analysis;

            this.WindowTitle = "MultiAlign Rogue";

            DataSelectionViewModel = new AnalysisDatasetSelectionViewModel(Analysis);

            SelectFilesCommand = new RelayCommand(SelectFiles, () => !string.IsNullOrWhiteSpace(this.ProjectPath));
            SelectDirectoryCommand = new RelayCommand(SelectDirectory, () => !string.IsNullOrWhiteSpace(this.ProjectPath));
            AddFolderCommand = new RelayCommand(AddFolderDelegate, () => !string.IsNullOrWhiteSpace(this.InputFilePath) && Directory.Exists(this.InputFilePath) && !string.IsNullOrWhiteSpace(this.ProjectPath));
            SearchDmsCommand = new RelayCommand(SearchDms, () => this.ShowOpenFromDms && !string.IsNullOrWhiteSpace(this.ProjectPath));
            CreateNewProjectCommand = new RelayCommand(this.CreateNewProject);
            SaveProjectCommand = new RelayCommand(SaveProject, () => !string.IsNullOrWhiteSpace(this.ProjectPath));
            LoadProjectCommand = new RelayCommand(LoadProject);
            SaveAsProjectCommand = new RelayCommand(this.SaveProjectAs, () => !string.IsNullOrWhiteSpace(this.ProjectPath));

            featureCache = new FeatureLoader { Providers = Analysis.DataProviders };
            this.SelectedDatasets = new List<DatasetInformationViewModel>();
            Datasets = new ObservableCollection<DatasetInformationViewModel>();

            featureCache.Providers = Analysis.DataProviders;
            this.FeatureFindingSettingsViewModel = new FeatureFindingSettingsViewModel(Analysis, featureCache);
            this.AlignmentSettingsViewModel = new AlignmentSettingsViewModel(Analysis, featureCache);
            this.ClusterSettingsViewModel = new ClusterSettingsViewModel(Analysis);
        }
        private void SetupViewModels(AnalysisConfig configuration)
        {
            m_config = configuration;
            CurrentStep = AnalysisSetupStep.DatasetSelection;

            CancelCommand = new AnalysisCancelCommand(this);
            BackCommand = new AnalysisBackCommand(this);
            NextCommand = new AnalysisNextCommand(this);

            DatasetSelectionViewModel = new AnalysisDatasetSelectionViewModel(configuration.Analysis);
            BaselineSelectionViewModel = new AnalysisBaselineSelectionViewModel(configuration.Analysis);
            AnalysisNamingViewModel = new AnalysisNamingViewModel(configuration);
            AnalysisOptionsViewModel = new AnalysisOptionsViewModel(configuration.Analysis.Options);
        }