/// <summary>
        /// Adds an UIElement as adorner with the specified placement.
        /// </summary>
        protected void AddAdorner(AdornerPlacement placement, AdornerOrder order, UIElement adorner)
        {
            AdornerPanel p = new AdornerPanel();

            p.Order = order;
            AdornerPanel.SetPlacement(adorner, placement);
            p.Children.Add(adorner);
            this.Adorners.Add(p);
        }
        /// <summary>
        /// Adds several UIElements as adorners with the specified placement.
        /// </summary>
        protected void AddAdorners(AdornerPlacement placement, params UIElement[] adorners)
        {
            AdornerPanel p = new AdornerPanel();

            foreach (UIElement adorner in adorners)
            {
                AdornerPanel.SetPlacement(adorner, placement);
                p.Children.Add(adorner);
            }
            this.Adorners.Add(p);
        }
예제 #3
0
 public static void SetPlacement(UIElement adorner, AdornerPlacement placement)
 {
     if (adorner == null)
     {
         throw new ArgumentNullException("adorner");
     }
     if (placement == null)
     {
         throw new ArgumentNullException("placement");
     }
     adorner.SetValue(PlacementProperty, placement);
 }