Posted 15 years ago
by Roel Alblas
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:
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>