コード例 #1
0
        /// <summary>
        /// Gets the or create behavior.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <returns></returns>
        private static MouseDownBehavior GetOrCreateBehavior(RibbonTab element)
        {
            MouseDownBehavior behavior = element.GetValue(ItemClickCommandBehaviorProperty) as MouseDownBehavior;

            if (behavior == null)
            {
                behavior = new MouseDownBehavior(element);
                element.SetValue(ItemClickCommandBehaviorProperty, behavior);
            }

            return(behavior);
        }
コード例 #2
0
        private void LoadListBoxItems()
        {
            for (int i = 0; i < this.collection.Count; i++)
            {
                RibbonTab newTab = this.collection[i] as RibbonTab;

                if (newTab != null && !((bool)newTab.GetValue(RadItem.IsAddNewItemProperty)))
                {
                    RadListBoxItem listBoxItem = new RadListBoxItem();
                    listBoxItem.Text = newTab.Text;
                    listBoxItem.Tag  = newTab;
                    this.radListBoxTabItems.Items.Insert(this.radListBoxTabItems.Items.Count, listBoxItem);
                }
            }

            if (this.radListBoxTabItems.Items.Count > 0)
            {
                this.radListBoxTabItems.SelectedIndex = 0;
            }
        }