Пример #1
0
 private static void OnAttachPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     if ((bool)e.NewValue)
     {
         d.SetValue(TextBlockToolTipPropertyKey, TextBlockTooltipAttachment.Attach((TextBlock)d, null));
     }
     else
     {
         var attached = d.GetValue(TextBlockToolTipPropertyKey.DependencyProperty) as TextBlockTooltipAttachment;
         if (attached != null)
         {
             attached.Dispose();
         }
     }
 }
Пример #2
0
 public static void Attach(TextBlock tb, FrameworkElement parent)
 {
     TextBlockTooltipAttachment.Attach(tb, parent);
 }