Exemplo n.º 1
0
        private static void OnIsSelectedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            MyRibbonGalleryItem container = (MyRibbonGalleryItem)d;
            bool newValue = (bool)e.NewValue;
            MyRibbonGalleryCategory ribbonGalleryCategory = container.RibbonGalleryCategory;

            if (ribbonGalleryCategory == null)
            {
                return;
            }
            MyRibbonGallery ribbonGallery = ribbonGalleryCategory.RibbonGallery;

            if (ribbonGallery == null)
            {
                return;
            }
            object obj = ribbonGalleryCategory.ItemContainerGenerator.ItemFromContainer((DependencyObject)container);

            if (obj == DependencyProperty.UnsetValue)
            {
                obj = (object)container;
            }
            ribbonGallery.ChangeSelection(obj, container, newValue);
            Debug.WriteLine("hello");
        }
Exemplo n.º 2
0
        /// <inheritdoc />
        protected override void ClearContainerForItemOverride(DependencyObject element, object item)
        {
            base.ClearContainerForItemOverride(element, item);
            MyRibbonGalleryCategory ribbonGalleryCategory = (MyRibbonGalleryCategory)element;

            ribbonGalleryCategory.RibbonGallery = null;
        }
Exemplo n.º 3
0
        /// <inheritdoc />
        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
        {
            MyRibbonGalleryCategory ribbonGalleryCategory = (MyRibbonGalleryCategory)element;

            ribbonGalleryCategory.RibbonGallery = this;
            base.PrepareContainerForItemOverride(element, item);
        }
Exemplo n.º 4
0
 private void SynchronizeWithCurrentItem(MyRibbonGalleryCategory containerGalleryCategory, object item)
 {
     _SynchronizeWithCurrentItem?.Invoke(this, new object[] { containerGalleryCategory, item });
 }