/// <summary> /// Called when a property value is changed. /// </summary> /// <param name="source">The source element.</param> /// <param name="property">The property.</param> /// <param name="previousValue">The previous value.</param> protected override void OnPropertyChanged(Element source, Property property, object previousValue) { if (source is ItemsControl) { this.Content = null; } base.OnPropertyChanged(source, property, previousValue); }
/// <summary> /// Gets the default value for the property. /// </summary> /// <param name="property">The property.</param> /// <returns>The default value for the property.</returns> protected override object GetDefaultValue(Property property) { if (property == TemplateProperty) { return DefaultTemplate; } return base.GetDefaultValue(property); }
/// <summary> /// Called when a property value is changed. /// </summary> /// <param name="source">The source element.</param> /// <param name="property">The property.</param> /// <param name="previousValue">The previous value.</param> protected override void OnPropertyChanged(Element source, Property property, object previousValue) { if (this.fill != null) { if (property == MinimumProperty || property == MaximumProperty || property == ValueProperty) { this.fill.HorizontalFill = this.NormalizedValue; } } base.OnPropertyChanged(source, property, previousValue); }
/// <summary> /// Called when a property value is changed. /// </summary> /// <param name="source">The source element.</param> /// <param name="property">The property.</param> /// <param name="previousValue">The previous value.</param> protected override void OnPropertyChanged(Element source, Property property, object previousValue) { if (source == this && property == ContentProperty) { var oldContent = previousValue as UIElement; if (oldContent != null) { this.DetachChild(oldContent); } var newContent = this.Content as UIElement; if (newContent != null) { this.AttachChild(newContent); } } base.OnPropertyChanged(source, property, previousValue); }