SetAppropriateSize() 공개 정적인 메소드

Sets appropriate size of the control according to the given group box state and control's size definition
public static SetAppropriateSize ( DependencyObject element, RibbonGroupBoxState state ) : void
element System.Windows.DependencyObject UI Element
state RibbonGroupBoxState Group box state
리턴 void
예제 #1
0
 /// <summary>
 /// Invoked when the System.Windows.Controls.ItemsControl.Items property changes.
 /// </summary>
 /// <param name="e">Information about the change.</param>
 protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     if (e.NewItems != null)
     {
         foreach (var element in e.NewItems.OfType <UIElement>())
         {
             RibbonAttachedProperties.SetAppropriateSize(element, State == RibbonGroupBoxState.QuickAccess ? RibbonGroupBoxState.Collapsed : State);
         }
     }
     base.OnItemsChanged(e);
 }
예제 #2
0
        // Set child sizes
        private static void SetChildSizes(RibbonGroupBoxState ribbonGroupBoxState, ItemsControl ribbonGroupBox)
        {
            if (ribbonGroupBox.ItemContainerGenerator.Status != GeneratorStatus.ContainersGenerated)
            {
                return;
            }

            foreach (var item in ribbonGroupBox.Items)
            {
                RibbonAttachedProperties.SetAppropriateSize(ribbonGroupBox.ItemContainerGenerator.ContainerFromItem(item), ribbonGroupBoxState);
            }
        }