示例#1
0
 /// <summary>
 /// This event handler is called when an element is loaded
 /// </summary>
 /// <param name="sender">Event source object</param>
 /// <param name="e">Event arguments</param>
 private void Element_Loaded(object sender, RoutedEventArgs e)
 {
     if (!(sender is ColorItem))
     {
         ElementChildren.Update();
     }
 }
示例#2
0
 /// <summary>
 /// Clears all the child items
 /// </summary>
 public void Clear()
 {
     if (ElementChildren != null)
     {
         ElementChildren.Children.Clear();
         ElementChildren.Update();
     }
     Items.Clear();
 }
示例#3
0
        /// <summary>
        /// This is called when the template has been bound to the control
        /// </summary>
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            ElementContainer         = (ScrollViewer)GetTemplateChild(ElementContainerName);
            ElementContainer.Content = ElementChildren;

            ElementChildren.Updated += new EventHandler(ElementChildren_Updated);

            UpdateVisualState();
            ElementChildren.Update();

            this.MouseWheel += new MouseWheelEventHandler(OnMouseWheel);

            foreach (ItemViewerItem item in ElementChildren.Children)
            {
                SetChildEvents(item);
            }
        }
示例#4
0
        /// <summary>
        /// Adds a single ItemViewerItem object
        /// </summary>
        /// <param name="item">Item object</param>
        public void Add(ItemViewerItem item)
        {
            SetChildEvents(item);

            ElementChildren.Add(item);
        }
 public RWElementResourceHolder()
 {
     _resources = new ElementResourceDictionary();
     _children  = new ElementChildren();
 }