示例#1
0
 /// <summary>
 /// A virtual method that is called when the Owner of this indicator changes.
 /// </summary>
 /// <param name="newOwner">The new Owner.</param>
 /// <param name="oldOwner">The old Owner.</param>
 internal virtual void OnOwnerChanged(GaugePanel newOwner, GaugePanel oldOwner)
 {
     if (newOwner != null)
     {
         newOwner.ScheduleUpdate();
     }
 }
示例#2
0
        /// <summary>
        /// Called in the measure layout pass to determine the desired size.
        /// </summary>
        /// <param name="availableSize">The available size that was given by the layout system.</param>
        /// <returns>Returns the desired size of the indicator.</returns>
        protected override Size MeasureOverride(Size availableSize)
        {
            if (this.MeasureCallback != null)
            {
                this.MeasureCallback();
            }

            if (this.ownerPanel == null)
            {
                this.ownerPanel = ElementTreeHelper.FindVisualAncestor <GaugePanel>(this);
            }

            Size result = RadGauge.NormalizeSize(availableSize);

            if (result.Width == 0 || result.Height == 0)
            {
                result = this.ownerPanel.LastMeasureSize;
            }

            this.Update(result);

            this.LastMeasureSize = result;

            return(result);
        }
示例#3
0
        /// <summary>
        /// Resolves the control's template parts.
        /// </summary>
        protected override bool ApplyTemplateCore()
        {
            bool applied = base.ApplyTemplateCore();

            this.panel = this.GetTemplatePartField <GaugePanel>(PanelPartName);
            applied    = applied && this.panel != null;

            return(applied);
        }
        /// <summary>
        /// A virtual method that is called when the Owner of this indicator changes.
        /// </summary>
        /// <param name="newOwner">The new Owner.</param>
        /// <param name="oldOwner">The old Owner.</param>
        internal override void OnOwnerChanged(GaugePanel newOwner, GaugePanel oldOwner)
        {
            base.OnOwnerChanged(newOwner, oldOwner);

            Orientation orientation = RadLinearGauge.GetOrientation(newOwner);

            this.isHorizontal = orientation == Orientation.Horizontal;
            RadLinearGauge.SetOrientation(this, orientation);
        }