// When the ControlSizeDefinition property changes we need to invalidate // the parent chain measure so that the RibbonGroupsContainer can calculate // the new size within the same MeasureOverride call. This property // usually changes from RibbonGroupsContainer.MeasureOverride. private static void OnSizePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { RibbonControl ribbonControl = (RibbonControl)d; ribbonControl.OnSizePropertyChanged( (RibbonControlSize)e.OldValue, (RibbonControlSize)e.NewValue); }