private void UpdateBrushEditorFromDataContext() { Microsoft.Windows.Design.PropertyEditing.PropertyValue propertyValue = this.DataContext as Microsoft.Windows.Design.PropertyEditing.PropertyValue; SceneNodeProperty sceneNodeProperty = (SceneNodeProperty)null; if (propertyValue != null) { sceneNodeProperty = (SceneNodeProperty)propertyValue.ParentProperty; } if (sceneNodeProperty == this.editingProperty) { return; } BrushCategory.ResetLastUsedBrushes(); this.ResetEditingProperty(); this.editingProperty = sceneNodeProperty; if (this.editingProperty != null) { this.editingProperty.PropertyReferenceChanged += new Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler(this.OnBrushChanged); } this.OnPropertyChanged("EditingProperty"); this.Rebuild(); }
static BrushCategory() { BrushCategory.ResetLastUsedBrushes(); }