Esempio n. 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
        }
Esempio n. 2
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));
        }