Ejemplo n.º 1
0
        /// <summary>
        ///   Initializes static members of the RibbonGalleryCategory class.
        /// </summary>
        static RibbonGalleryCategory()
        {
            Type ownerType = typeof(RibbonGalleryCategory);

            DefaultStyleKeyProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(ownerType));
            ItemTemplateProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnNotifyPropertyChanged), new CoerceValueCallback(CoerceItemTemplate)));
            ItemContainerStyleProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(new PropertyChangedCallback(OnNotifyPropertyChanged), new CoerceValueCallback(CoerceItemContainerStyle)));

            FocusableProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(false));
        }
Ejemplo n.º 2
0
        /// <summary>
        ///   Initializes static members of the RibbonGalleryCategory class.
        /// </summary>
        static RibbonGalleryCategory()
        {
            Type ownerType = typeof(RibbonGalleryCategory);

            DefaultStyleKeyProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(ownerType));
            ItemTemplateProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnNotifyPropertyChanged), new CoerceValueCallback(CoerceItemTemplate)));
            ItemContainerStyleProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(new PropertyChangedCallback(OnNotifyPropertyChanged), new CoerceValueCallback(CoerceItemContainerStyle)));

            FocusableProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(false));
#if RIBBON_IN_FRAMEWORK
            AutomationProperties.IsOffscreenBehaviorProperty.OverrideMetadata(typeof(RibbonGalleryCategory), new FrameworkPropertyMetadata(IsOffscreenBehavior.FromClip));
#endif
        }
Ejemplo n.º 3
0
        static TreeGridContentColumnDefinition()
        {
            var template = new DataTemplate();

            template.VisualTree = new FrameworkElementFactory(typeof(ContentControl));
            template.VisualTree.SetBinding(ContentControl.ContentProperty, new Binding());
            template.Seal();

            ItemTemplateProperty.OverrideMetadata(typeof(TreeGridContentColumnDefinition),
                                                  new PropertyMetadata(template));

            DefaultStyleKeyProperty.OverrideMetadata(typeof(TreeGridContentColumnDefinition),
                                                     new FrameworkPropertyMetadata(typeof(TreeGridContentColumnDefinition)));
        }
        static RibbonContextualTabGroupItemsControl()
        {
            Type ownerType = typeof(RibbonContextualTabGroupItemsControl);

            DefaultStyleKeyProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(ownerType));
            ItemTemplateProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(null, OnNotifyPropertyChanged, CoerceItemTemplate));
            ItemContainerStyleProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(null, OnNotifyPropertyChanged, CoerceItemContainerStyle));
            VisibilityProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(null, new CoerceValueCallback(CoerceVisibility)));
            FocusableProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(false));

            FrameworkElementFactory factory    = new FrameworkElementFactory(typeof(RibbonContextualTabGroupsPanel));
            ItemsPanelTemplate      itemsPanel = new ItemsPanelTemplate(factory);

            itemsPanel.Seal();
            ItemsPanelProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(itemsPanel));
        }