SIL.Cog.Application.ViewModels.MultipleWordAlignmentViewModel.MultipleWordAlignmentViewModel C# (CSharp) Method

MultipleWordAlignmentViewModel() public method

public MultipleWordAlignmentViewModel ( IProjectService projectService, IBusyService busyService, IExportService exportService, IAnalysisService analysisService ) : System
projectService IProjectService
busyService IBusyService
exportService IExportService
analysisService IAnalysisService
return System
        public MultipleWordAlignmentViewModel(IProjectService projectService, IBusyService busyService, IExportService exportService, IAnalysisService analysisService)
            : base("Multiple Word Alignment")
        {
            _projectService = projectService;
            _busyService = busyService;
            _exportService = exportService;
            _analysisService = analysisService;

            _projectService.ProjectOpened += _projectService_ProjectOpened;

            var showCognateSets = new TaskAreaBooleanViewModel("Show cognate sets") {Value = true};
            showCognateSets.PropertyChanged += _showCognateSets_PropertyChanged;
            TaskAreas.Add(new TaskAreaItemsViewModel("Common tasks",
                new TaskAreaItemsViewModel("Sort words by",
                    new TaskAreaCommandGroupViewModel(
                        new TaskAreaCommandViewModel("Form", new RelayCommand(() => SortBy("StrRep", ListSortDirection.Ascending))),
                        new TaskAreaCommandViewModel("Variety", new RelayCommand(() => SortBy("Variety", ListSortDirection.Ascending)))),
                    showCognateSets)));
            TaskAreas.Add(new TaskAreaItemsViewModel("Other tasks",
                new TaskAreaCommandViewModel("Export all cognate sets", new RelayCommand(ExportCognateSets, CanExportCognateSets))));

            _words = new BindableList<MultipleWordAlignmentWordViewModel>();
            _selectedWords = new BindableList<MultipleWordAlignmentWordViewModel>();

            _showInVarietyPairsCommand = new RelayCommand(ShowInVarietyPairs, CanShowInVarietyPairs);
            _performComparisonCommand = new RelayCommand(PerformComparison);

            _groupByCognateSet = true;
            _sortByProp = "StrRep";

            Messenger.Default.Register<ComparisonPerformedMessage>(this, msg => AlignWords());
            Messenger.Default.Register<DomainModelChangedMessage>(this, msg =>
            {
                if (msg.AffectsComparison)
                    ResetAlignment();
            });
            Messenger.Default.Register<PerformingComparisonMessage>(this, msg => ResetAlignment());
            Messenger.Default.Register<SwitchViewMessage>(this, HandleSwitchView);
        }