Пример #1
0
 private Control Template(ToolTip control)
 {
     return new Border
     {
         [~Border.BackgroundProperty] = control[~ToolTip.BackgroundProperty],
         [~Border.BorderBrushProperty] = control[~ToolTip.BorderBrushProperty],
         [~Border.BorderThicknessProperty] = control[~ToolTip.BorderThicknessProperty],
         [~Border.PaddingProperty] = control[~ToolTip.PaddingProperty],
         Content = new ContentPresenter
         {
             Name = "contentPresenter",
             [~ContentPresenter.ContentProperty] = control[~ToolTip.ContentProperty],
         }
     };
 }
Пример #2
0
 /// <summary>
 /// The default template for the <see cref="ToolTip"/> control.
 /// </summary>
 /// <param name="control">The control being styled.</param>
 /// <returns>The root of the instantiated template.</returns>
 public static Control Template(ToolTip control)
 {
     return new Border
     {
         [~Border.BackgroundProperty] = control[~TemplatedControl.BackgroundProperty],
         [~Border.BorderBrushProperty] = control[~TemplatedControl.BorderBrushProperty],
         [~Border.BorderThicknessProperty] = control[~TemplatedControl.BorderThicknessProperty],
         [~Decorator.PaddingProperty] = control[~TemplatedControl.PaddingProperty],
         Child = new ContentPresenter
         {
             Name = "contentPresenter",
             [~ContentPresenter.ContentProperty] = control[~ContentControl.ContentProperty],
         }
     };
 }