Пример #1
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (e.Parameter is INotifier)
     {
         ViewModel = new ClusterDetailViewModel(this.Dispatcher, e.Parameter as INotifier);
     }
     else
     {
         throw new NotSupportedException("Parameter is not supported");
     }
 }
Пример #2
0
        public AnalysisViewModel(MultiAlignAnalysis analysis)
        {
            m_showDriftTime = false;

            LoadDatasets(analysis);

            // Create matching clusters and AMT Matches.
            var matches  = analysis.DataProviders.MassTagMatches.FindAll();
            var clusters =
                analysis.Clusters.MapMassTagsToClusters(matches, analysis.MassTagDatabase);

            // Cache the clusters so that they can be readily accessible later on.
            // This will help speed up performance, so that we dont have to hit the database
            // when we want to find matching mass tags, and dont have to map clusters to tags multiple times.
            FeatureCacheManager <UMCClusterLightMatched> .SetFeatures(clusters.Item1);

            FeatureCacheManager <MassTagToCluster> .SetFeatures(clusters.Item2);

            SingletonDataProviders.Providers = analysis.DataProviders;


            // Create sub-view models
            MassTags                       = new ObservableCollection <MassTagToCluster>(clusters.Item2);
            ClusterTree                    = new UmcClusterCollectionTreeViewModel(clusters.Item1);
            ClusterSpectraViewModel        = new UmcClusterSpectraViewModel();
            ClusterIdentificationViewModel = new UMCClusterIdentificationViewModel();
            AnalysisOptionsViewModel       = new AnalysisOptionsViewModel(analysis.Options);
            ClusterViewModel               = new ClusterDetailViewModel();

            var charges = SingletonDataProviders.Providers.FeatureCache.RetrieveChargeStates();

            GlobalStatisticsViewModel = new GlobalStatisticsViewModel(clusters.Item1, charges);
            HasIdentifications        = (MassTags.Count > 0);


            SelectedClusterName = "Cluster Details:";
            LoadClusters(clusters.Item1);
            ApplyViewAsFilter = new BaseCommand(FilterFromView);
        }