private void OnCurrentItemChanged()
{
Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false");
if (CollectionView == null || IsSelectionChangeActive)
{
return;
}
// Synchronize the SelectedItem to be the first Item
// within the current Category.
RibbonGalleryCategory category = this.ItemContainerGenerator.ContainerFromItem(CollectionView.CurrentItem) as RibbonGalleryCategory;
if (category != null && category.Items.Count > 0)
{
SelectedItem = category.Items[0];
}
}