popup gallery does not show my images

Ribbon for WPF Forum

Posted 10 years ago by Arthur Damen
Version: 9.2.0510
Avatar
Hi,
I am trying to show a popup gallery with images.
Your example shows it with bitmapimages, but i must use resources which contains png content.

With this code my images are not shown. What am i doing wrong here?
                                
<ribbon:PopupGallery Name="PageTransitionGallery"  InitialColumnCount="5" >
                                    <ribbon:PopupGallery.CategorizedItemsSource>
                                     <x:Array Type="{x:Type Image}">
                                     <Image ribbon:PopupGallery.Category="No Transition" Source="{x:Static res:Images.block_blue_32x32}"></Image>
                                     <Image ribbon:PopupGallery.Category="Faders" Source="{x:Static res:Images.block_blue_32x32}"></Image>
                                     <Image ribbon:PopupGallery.Category="Wipers" Source="{x:Static res:Images.block_blue_32x32}"></Image>
                                     </x:Array>
                                    </ribbon:PopupGallery.CategorizedItemsSource>
                                    <ribbon:PopupGallery.ItemTemplate>
                                        <DataTemplate>
                                            <Border Margin="2" BorderBrush="#808080" BorderThickness="1"  Width="40" Height="40" SnapsToDevicePixels="True">
                                                <Image Source="{Binding Path=Source}" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="True" />
                                            </Border>
                                        </DataTemplate>
                                    </ribbon:PopupGallery.ItemTemplate>
                                </ribbon:PopupGallery>

Comments (2)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Arthur,

For these types of problems, it's generally better to put together a small sample project that reproduces the issue and email it over to support address. But from the code above you have Image objects as your items (the ones in the array), which are "displayed" using another Image element (the one inside the DataTemplate). Typically, the "items" would be a non-visual element (such as BitmapImage in our sample) and the ItemTemplate indicates how to display the items (such as using an Image element).

But since you bind the Source of the ItemTemplate Image to the Source property of the "items" Images, then it should probably work. So it may be a problem with the res:Images part. But we'd need to see a sample to be sure.


Actipro Software Support

Posted 10 years ago by Arthur Damen
Avatar
You are right, it works.

After exit VS 2008, reload the project and recompile it shows the images.....
Visual Studio 2008 gets confused and does not show me what it should do...

Sorry for wasting your time.

Thanks.

[Modified at 01/04/2010 03:40 AM]
The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.