private void UnmonitorExtendElement(object element) { if (element != null) { MeasureElement extend = element as MeasureElement; if (extend != null) { extend.NeedMeasure -= new EventHandler(OnNeedMeasure); LogicalChildRemove(extend); } } }
private void MonitorExtendElement(object element) { if (element != null) { MeasureElement extend = element as MeasureElement; if (extend != null) { LogicalChildAdd(extend); extend.NeedMeasure += new EventHandler(OnNeedMeasure); } } }
/// <summary> /// Invoked when a property change requires a measure to occur. /// </summary> /// <param name="d">Owning object.</param> /// <param name="e">Details of property that has changed.</param> protected static void OnNeedMeasureOnChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MeasureElement sender = (MeasureElement)d; sender.OnNeedMeasure(sender, EventArgs.Empty); }