private void OnShowTooltipChanged(CutTextKind oldValue, CutTextKind newValue) { _cutTextKind = (CutTextKind)newValue; if (oldValue != CutTextKind.None) { _owner.IsVisibleChanged -= OnIsVisibleChanged; _owner.LayoutUpdated -= OnLayoutUpdated; _owner.SizeChanged -= OnSizeChanged; } if (newValue != CutTextKind.None) { _owner.IsVisibleChanged += OnIsVisibleChanged; _owner.LayoutUpdated += OnLayoutUpdated; _owner.SizeChanged += OnSizeChanged; } }
/// <summary> /// Sets the value that defines when the tooltip should be shown. /// </summary> /// <param name="obj">The element to which the attached property is written.</param> /// <param name="value">The needed DW.WPFToolkit.Interactivity.CutTooltipBehavior.ShowTooltip value.</param> public static void SetShowTooltip(DependencyObject obj, CutTextKind value) { obj.SetValue(ShowTooltipProperty, value); }