Пример #1
0
 public BrushEditor()
 {
     this.DataContextChanged          += new DependencyPropertyChangedEventHandler(this.OnBrushEditorDataContextChanged);
     this.Loaded                      += new RoutedEventHandler(this.OnBrushEditorLoaded);
     this.Unloaded                    += new RoutedEventHandler(this.OnBrushEditorUnloaded);
     this.advancedPropertiesAggregated = new ObservableCollectionAggregator();
     this.advancedBrushProperties      = new ObservableCollection <PropertyEntry>();
     this.advancedPropertiesAggregated.AddCollection((IList)this.advancedBrushProperties);
     this.InitializeComponent();
     this.CommandBindings.Add(new CommandBinding((ICommand)BrushEditor.OnResourceSelectCommand, new ExecutedRoutedEventHandler(BrushEditor.OnResourceSelect)));
     this.CommandBindings.Add(new CommandBinding((ICommand)BrushEditor.OnEditResourceCommand, new ExecutedRoutedEventHandler(this.OnEditResource)));
 }
        void InitResourcePaneHook(IWindowService windowService)
        {
            var resourcePalette = windowService.PaletteRegistry.PaletteRegistryEntries.FirstOrDefault(p => p.Name == "Designer_ResourcePane");
            if (resourcePalette == null) return;

            var resourcePane = resourcePalette.Content as ResourcePane;
            if (resourcePane == null) return;

            _resourceContainers = resourcePane.ResourceContainers as ObservableCollectionAggregator;
            if (_resourceContainers == null) return;

            _resourceContainers.CollectionChanged += ResourceListChangedEventHandler;
        }