Posted 15 years ago
by Ken Hanson
Version: 10.1.0522
Platform: .NET 3.5
Environment: Windows 7 (64-bit)
I have a RibbonGallery that shows a Catagorized Popup Gallery. The DataTemplate I am using shows a icon that happens to be Xaml. For this reason I use a ContentPresenter in my DataTemplate.
I see the Xaml Icons (with labels) in the RibbonGallery.
I pop open the PopupGallery and it still looks good and I see the Xaml Icons (with labels)
The Bug
However, when I close the PopupGallery, my initial RibbonGallery no longer shows the Xaml Icons, it only shows the labels in my Data Template. The PopupGallery still works correctly and shows it's ContentPresenter icons.
Below is the RibbonGallery in my main.xaml.
Any suggestions?
Best Regards,
Ken
I see the Xaml Icons (with labels) in the RibbonGallery.
I pop open the PopupGallery and it still looks good and I see the Xaml Icons (with labels)
The Bug
However, when I close the PopupGallery, my initial RibbonGallery no longer shows the Xaml Icons, it only shows the labels in my Data Template. The PopupGallery still works correctly and shows it's ContentPresenter icons.
Below is the RibbonGallery in my main.xaml.
Any suggestions?
Best Regards,
Ken
<ribbon:RibbonGallery ItemsSource="{Binding Source={StaticResource ControlsDataSrc}, Path=Controls}" MediumVariantColumnCount="5" LargeVariantColumnCount="3" ImageSourceSmall="/Resources/Images/ColorPicker32.png">
<ribbon:RibbonGallery.ItemTemplate>
<DataTemplate >
<Grid Width="72" Height="22">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<ContentPresenter Content="{Binding BindsDirectlyToSource=True, Path=WrappedObject.Image}" Grid.Row="0"/>
<TextBlock Grid.Column="1" VerticalAlignment="Bottom" HorizontalAlignment="Center" FontSize="9" Text="{Binding BindsDirectlyToSource=True, Path=WrappedObject.ItemString}" />
</Grid>
</DataTemplate>
</ribbon:RibbonGallery.ItemTemplate>
<ribbon:RibbonGallery.PopupContent>
<StackPanel>
<ribbon:PopupGallery InitialColumnCount="3"
IsPreviewEnabled="True" IsSelectionHighlightVisible="False"
CategorizedItemsSource="{Binding Source={StaticResource ControlsDataSrc}, Path=Controls}"
>
<ribbon:PopupGallery.ItemTemplate>
<DataTemplate >
<Grid Width="60" Height="44">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ContentPresenter Content="{Binding BindsDirectlyToSource=True, Path=WrappedObject.Image}" />
<TextBlock Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Center" FontSize="9" Text="{Binding BindsDirectlyToSource=True, Path=WrappedObject.ItemString}" />
</Grid>
</DataTemplate>
</ribbon:PopupGallery.ItemTemplate>
</ribbon:PopupGallery>
</StackPanel>
</ribbon:RibbonGallery.PopupContent>
</ribbon:RibbonGallery>