Example #1
0
 internal void OnChildGroupRenderSizeChanged(RibbonGroup group, double originalWidth)
 {
     if (!_changedWidthGroups.ContainsKey(group))
     {
         _changedWidthGroups[group] = originalWidth;
     }
     if (!_processGroupWidthChangeQueued)
     {
         _processGroupWidthChangeQueued = true;
         Dispatcher.BeginInvoke(
             (Action) delegate()
         {
             if (_changedWidthGroups.Count > 0)
             {
                 foreach (RibbonGroup invalidGroup in _changedWidthGroups.Keys)
                 {
                     double originalRenderWidth = _changedWidthGroups[invalidGroup];
                     if (!DoubleUtil.AreClose(originalRenderWidth, invalidGroup.ActualWidth))
                     {
                         // Reset the next increase group's cached data
                         // if there was a real change in any groups width.
                         ResetNextIncreaseGroupCache();
                         InvalidateMeasure();
                         break;
                     }
                 }
             }
             _changedWidthGroups.Clear();
             _processGroupWidthChangeQueued = false;
         },
             DispatcherPriority.Input,
             null);
     }
 }
 private void Clear()
 {
     childrenRoot.Children.Clear();
     dataToVisual.Clear();
 }