Example #1
0
        /// <summary>
        ///   Initializes static members of the RibbonControl class.  Here we override the
        ///   default style, and add a couple callbacks.
        /// </summary>
        static RibbonControl()
        {
            Type ownerType = typeof(RibbonControl);

            DefaultStyleKeyProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(ownerType));
            FocusableProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(false));

            IsInQuickAccessToolBarProperty.OverrideMetadata(ownerType,
                                                            new FrameworkPropertyMetadata(OnIsInQuickAccessToolBarChanged),
                                                            RibbonControlService.IsInQuickAccessToolBarPropertyKey);

            IsInControlGroupProperty.OverrideMetadata(ownerType,
                                                      new FrameworkPropertyMetadata(OnIsInControlGroupChanged),
                                                      RibbonControlService.IsInControlGroupPropertyKey);

            ControlSizeDefinitionProperty.OverrideMetadata(ownerType,
                                                           new FrameworkPropertyMetadata(OnControlSizeDefinitionChanged, CoerceControlSizeDefinition));

            ItemForItemContainerProperty.OverrideMetadata(ownerType,
                                                          new FrameworkPropertyMetadata(OnItemForItemContainerChanged));

#if RIBBON_IN_FRAMEWORK
            AutomationProperties.IsOffscreenBehaviorProperty.OverrideMetadata(typeof(RibbonControl), new FrameworkPropertyMetadata(IsOffscreenBehavior.FromClip));
#endif
        }
Example #2
0
        /// <summary>
        ///   Initializes static members of the RibbonSplitButton class.  It also overrides the default style.
        /// </summary>
        static RibbonSplitButton()
        {
            Type ownerType = typeof(RibbonSplitButton);

            DefaultStyleKeyProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(ownerType));
            BorderThicknessProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(new Thickness(), new PropertyChangedCallback(OnBorderThicknessChanged)));
            ControlSizeDefinitionProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnBorderThicknessChanged)));
            IsInControlGroupProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(false, new PropertyChangedCallback(OnBorderThicknessChanged)), RibbonControlService.IsInControlGroupPropertyKey);
        }
Example #3
0
        /// <summary>
        ///   Initializes static members of the RibbonControl class.  Here we override the
        ///   default style, and add a couple callbacks.
        /// </summary>
        static RibbonControl()
        {
            Type ownerType = typeof(RibbonControl);

            DefaultStyleKeyProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(ownerType));
            FocusableProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(false));

            IsInQuickAccessToolBarProperty.OverrideMetadata(ownerType,
                                                            new FrameworkPropertyMetadata(OnIsInQuickAccessToolBarChanged),
                                                            RibbonControlService.IsInQuickAccessToolBarPropertyKey);

            IsInControlGroupProperty.OverrideMetadata(ownerType,
                                                      new FrameworkPropertyMetadata(OnIsInControlGroupChanged),
                                                      RibbonControlService.IsInControlGroupPropertyKey);

            ControlSizeDefinitionProperty.OverrideMetadata(ownerType,
                                                           new FrameworkPropertyMetadata(OnControlSizeDefinitionChanged, CoerceControlSizeDefinition));
        }
        /// <summary>
        ///   Initializes static members of the RibbonContentPresenter class.
        ///   Here we add a couple callbacks which propagate pseudeinherited proeprties to the child control.
        /// </summary>
        static RibbonContentPresenter()
        {
            Type ownerType = typeof(RibbonContentPresenter);

            IsInQuickAccessToolBarProperty.OverrideMetadata(ownerType,
                                                            new FrameworkPropertyMetadata(OnIsInQuickAccessToolBarChanged),
                                                            RibbonControlService.IsInQuickAccessToolBarPropertyKey);

            IsInControlGroupProperty.OverrideMetadata(ownerType,
                                                      new FrameworkPropertyMetadata(OnIsInControlGroupChanged),
                                                      RibbonControlService.IsInControlGroupPropertyKey);

            ControlSizeDefinitionProperty.OverrideMetadata(ownerType,
                                                           new FrameworkPropertyMetadata(OnControlSizeDefinitionChanged, CoerceControlSizeDefinition));

            RibbonControlService.RibbonPropertyKey.OverrideMetadata(ownerType,
                                                                    new FrameworkPropertyMetadata(OnRibbonChanged));
        }