Ejemplo n.º 1
0
 /// <summary>
 /// Be sure to call the base class constructor. 
 /// </summary>
 /// <param name="adornedElement">The ui element to adorn</param>
 /// <param name="toolTip">The tooltip to show on click</param>
 /// <param name="overlayTemplate">A style for a PopupButton</param>
 public OverlayAdorner(UIElement adornedElement, ToolTip toolTip, ControlTemplate overlayTemplate)
     : base(adornedElement)
 {
     Debug.Assert(adornedElement != null, "adornedElement should not be null");
     _popupButton = new PopupButton
     {
         IsTabStop = false,
         AdornedElement = adornedElement
     };
     if (overlayTemplate != null)
     {
         _popupButton.Template = overlayTemplate;
     }
     if (toolTip != null)
     {
         _popupButton.ToolTip = toolTip;
     }
     AddVisualChild(_popupButton);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Be sure to call the base class constructor.
 /// </summary>
 /// <param name="adornedElement">The ui element to adorn</param>
 /// <param name="toolTip">The tooltip to show on click</param>
 /// <param name="overlayTemplate">A style for a PopupButton</param>
 public OverlayAdorner(UIElement adornedElement, ToolTip toolTip, ControlTemplate overlayTemplate)
     : base(adornedElement)
 {
     Debug.Assert(adornedElement != null, "adornedElement should not be null");
     _popupButton = new PopupButton
     {
         IsTabStop      = false,
         AdornedElement = adornedElement
     };
     if (overlayTemplate != null)
     {
         _popupButton.Template = overlayTemplate;
     }
     if (toolTip != null)
     {
         _popupButton.ToolTip = toolTip;
     }
     AddVisualChild(_popupButton);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OverlayAdorner"/> class.
        /// Be sure to call the base class constructor.
        /// </summary>
        /// <param name="adornedElement">The ui element to adorn</param>
        /// <param name="toolTip">The tooltip to show on click</param>
        /// <param name="overlayTemplate">A style for a PopupButton</param>
        public OverlayAdorner(UIElement adornedElement, ToolTip toolTip, ControlTemplate overlayTemplate)
            : base(adornedElement)
        {
            Debug.Assert(adornedElement != null, "adornedElement should not be null");
            this.popupButton = new PopupButton
            {
                IsTabStop      = false,
                AdornedElement = adornedElement
            };
            if (overlayTemplate != null)
            {
                this.popupButton.SetCurrentValue(Control.TemplateProperty, overlayTemplate);
            }

            if (toolTip != null)
            {
                this.popupButton.SetCurrentValue(ToolTipProperty, toolTip);
            }

            this.AddVisualChild(this.popupButton);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// The clear the single child of a TemplatedAdorner
 /// </summary>
 public void ClearChild()
 {
     this.RemoveVisualChild(this.popupButton);
     this.popupButton = null;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// The clear the single child of a TemplatedAdorner
 /// </summary>
 public void ClearChild()
 {
     RemoveVisualChild(_popupButton);
     _popupButton = null;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// The clear the single child of a TemplatedAdorner
 /// </summary>
 public void ClearChild()
 {
     RemoveVisualChild(_popupButton);
     _popupButton = null;
 }