Activeitem not showing

Ribbon for WPF Forum

Posted 15 years ago by Roel Alblas
Avatar
Hi,

I filled a ribbongallery with images including a popupgallery. This works fine.

Only on initial load there will render only one image. And when selecting a second image the first isnt replace by the second. So the activeitem is not visible.

When I open the popupgallery. The selection is highlighted, so it is selected.

Could this be how I defined the variants. If so could you please explain how this works?

This is the XAML:
<ribbon:Group Label="Images" KeyTipAccessText="I">
                    <ribbon:Group.Variants>
                        <ribbon:GroupVariant Priority="20" Size="Medium" />
                        <ribbon:GroupVariant Priority="60" Size="Small" />
                        <ribbon:GroupVariant Priority="70" Size="Collapsed" />
                    </ribbon:Group.Variants>
                    <ribbon:RibbonGallery x:Name="RG" Label="Images" Width="500" VariantBehavior="NoCollapse"  MediumVariantColumnCount="5" PopupResizeMode="Both" VariantSize="Medium" KeyTipAccessText="L" IsSelectionHighlightVisible="True" SelectedItemChanged="RG_SelectedItemChanged">
                        <ribbon:RibbonGallery.ItemTemplate>
                            <DataTemplate>
                                <Image Margin="2" Width="80" Height="60" Name="RGImage" Source="{Binding Image}" Tag="{Binding ID}" Stretch="UniformToFill" />
                            </DataTemplate>
                        </ribbon:RibbonGallery.ItemTemplate>
                        <ribbon:RibbonGallery.PopupContent>
                            <StackPanel>
                                <ribbon:PopupGallery InitialColumnCount="4" IsSelectionHighlightVisible="True"
                                        ItemTemplate="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ribbon:RibbonGallery}}, Path=ItemTemplate}"                                        
                                        ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ribbon:RibbonGallery}}, Path=ItemsSource}"
                                        />
                            </StackPanel>
                        </ribbon:RibbonGallery.PopupContent>
                    </ribbon:RibbonGallery>
                </ribbon:Group>

Comments (1)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Roel,

I would never recommend setting a Width on a control in the Ribbon like you did on the RibbonGallery since that could break proper dynamic sizing of the gallery.

But overall, I'm not quite sure what you are asking. We'd probably need you to email over a simple sample project that shows the issue and please explain what you are trying to do in a little more detail. Thanks!


Actipro Software Support

The latest build of this product (v24.1.3) 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.