예제 #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);
 }