internal override void LoadSettings() { base.LoadSettings(); var namingPreferencesXml = this.OptionService.GetOption(SimplificationOptions.NamingPreferences, _languageName); SerializableNamingStylePreferencesInfo preferencesInfo; if (string.IsNullOrEmpty(namingPreferencesXml)) { preferencesInfo = new SerializableNamingStylePreferencesInfo(); } else { preferencesInfo = SerializableNamingStylePreferencesInfo.FromXElement(XElement.Parse(namingPreferencesXml)); } _viewModel = new NamingStylesOptionPageControlViewModel(preferencesInfo, _languageName, _categories, _notificationService); this.DataContext = _viewModel; this.RootTreeView.ItemsPath = nameof(NamingRuleTreeItemViewModel.Children); this.RootTreeView.IsExpandablePath = nameof(NamingRuleTreeItemViewModel.HasChildren); this.RootTreeView.FilterParentEvaluator = GetParent; this.RootTreeView.RootItemsSource = new ObservableCollection <NamingRuleTreeItemViewModel>() { _viewModel.rootNamingRule }; }
internal NamingRuleDialog(NamingRuleDialogViewModel viewModel, NamingStylesOptionPageControlViewModel outerViewModel, ImmutableArray<string> categories, INotificationService notificationService) { _notificationService = notificationService; _categories = categories; _viewModel = viewModel; _namingStylesViewModel = outerViewModel; InitializeComponent(); DataContext = viewModel; }
internal NamingRuleDialog(NamingRuleDialogViewModel viewModel, NamingStylesOptionPageControlViewModel outerViewModel, ImmutableArray <string> categories, INotificationService notificationService) { _notificationService = notificationService; _categories = categories; _viewModel = viewModel; _namingStylesViewModel = outerViewModel; InitializeComponent(); DataContext = viewModel; }
internal NamingRuleTreeItemViewModel( string name, SymbolSpecificationViewModel symbolSpec, NamingStyleViewModel namingStyle, EnforcementLevel enforcementLevel, NamingStylesOptionPageControlViewModel vm) { this.EnforcementLevel = enforcementLevel; this._title = name; this.symbolSpec = symbolSpec; this.namingStyle = namingStyle; this._namingStylesViewModel = vm; this.children = new ChildRuleCollection(this); this.children.CollectionChanged += OnChildrenCollectionChanged; }
internal override void LoadSettings() { base.LoadSettings(); var namingPreferencesXml = this.OptionService.GetOption(SimplificationOptions.NamingPreferences, _languageName); SerializableNamingStylePreferencesInfo preferencesInfo; if (string.IsNullOrEmpty(namingPreferencesXml)) { preferencesInfo = new SerializableNamingStylePreferencesInfo(); } else { preferencesInfo = SerializableNamingStylePreferencesInfo.FromXElement(XElement.Parse(namingPreferencesXml)); } _viewModel = new NamingStylesOptionPageControlViewModel(preferencesInfo, _languageName, _categories, _notificationService); this.DataContext = _viewModel; this.RootTreeView.ItemsPath = nameof(NamingRuleTreeItemViewModel.Children); this.RootTreeView.IsExpandablePath = nameof(NamingRuleTreeItemViewModel.HasChildren); this.RootTreeView.FilterParentEvaluator = GetParent; this.RootTreeView.RootItemsSource = new ObservableCollection<NamingRuleTreeItemViewModel>() { _viewModel.rootNamingRule }; }