コード例 #1
0
ファイル: ItemsPresenter.cs プロジェクト: vetuomia/rocket
        /// <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);
        }
コード例 #2
0
ファイル: ProgressBar.cs プロジェクト: vetuomia/rocket
        /// <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);
        }
コード例 #3
0
ファイル: ProgressBar.cs プロジェクト: vetuomia/rocket
        /// <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);
        }
コード例 #4
0
ファイル: ContentControl.cs プロジェクト: vetuomia/rocket
        /// <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);
        }