예제 #1
0
        private static void OnIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RibbonControl    element    = d as RibbonControl;
            FrameworkElement oldElement = e.OldValue as FrameworkElement;

            if (oldElement != null)
            {
                element.RemoveLogicalChild(oldElement);
            }
            FrameworkElement newElement = e.NewValue as FrameworkElement;

            if (newElement != null)
            {
                element.AddLogicalChild(newElement);
            }
        }