/// <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)); }
static EasyTreeView() { ItemContainerStyleProperty.OverrideMetadata( typeof(EasyTreeView), new FrameworkPropertyMetadata( ApplyDefaultItemContainerStyle(new Style(typeof(TreeViewItem))), null, (dep, o) => ApplyDefaultItemContainerStyle(o as Style) ) ); }
/// <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 }
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)); }