RibbonGallery Popup Placement

Ribbon for WPF Forum

Posted 10 years ago by Ken Hanson
Version: 13.2.0591
Avatar

I have tried to cause by PopupGallery to open so that the top of the popup happens at the bottom the RibbonGallery.  However, it always opens positioned at the Top and covers the PopuGallery Button.  This causes me grief because of mouse over events getting fired in the popup itself.

 

How/Where in the xaml would I specify the PopupPlacement attached property?

 

Here is what I have currently:

 

 

                <ribbon:Group Label="Control Toolbox" VariantSize="Medium" ImageSourceLarge="/Resources/Images/ControlsIcon32.png">
                        <ribbon:Group.Variants>
                            <ribbon:GroupVariant Priority="100" Size="Medium"></ribbon:GroupVariant>
                            <ribbon:GroupVariant Priority="110" Size="Small"></ribbon:GroupVariant>
                            <ribbon:GroupVariant Priority="120" Size="Collapsed"></ribbon:GroupVariant>
                        </ribbon:Group.Variants>

                        <ribbon:RibbonGallery x:Name="ControlRibbonGallery"  ItemClick="ControlRibbonGallery_ItemClick" VariantBehavior="NoAutoSize" MouseMove="ControlRibbonGallery_MouseMove"  
                                              MediumVariantColumnCount="7" LargeVariantColumnCount="7" ItemsSource="{Binding Source={StaticResource ToolbarControlsDataSrc}, Path=Controls}" IsPreviewEnabled="True"    
                                              PopupOpening="ControlRibbonGallery_PopupOpening" ribbon:PopupControlService.PopupPlacement="Bottom" >
                            <ribbon:RibbonGallery.ItemTemplate>
                                <DataTemplate>
                                    <local:ControlGalleryItem ShowLabel="False" Width="24" Height="24" ToolTip="{Binding BindsDirectlyToSource=True, Path=Name}"  ControlItem="{Binding BindsDirectlyToSource=True}"  MouseDown="ControlGalleryItem_PreviewMouseDown" MouseUp="ControlGalleryItem_MouseUp"  PreviewMouseMove="ControlGalleryItem_PreviewMouseMove"  PreviewGiveFeedback="ControlGalleryItem_PreviewGiveFeedback"  QueryContinueDrag="ControlGalleryItem_QueryContinueDrag" />
                                </DataTemplate>
                            </ribbon:RibbonGallery.ItemTemplate>
                            <ribbon:RibbonGallery.PopupContent>
                                <ribbon:PopupGallery 
											IsPreviewEnabled="True" IsSelectionHighlightVisible="False"  InitialColumnCount="5"  HorizontalAlignment="Right"  VerticalAlignment="Bottom"
											CategorizedItemsSource="{Binding Source={StaticResource PopupControlsDataSrc}, Path=Controls}" 
                                            MaxHeight="900" >
                                    <ribbon:PopupGallery.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel   >
                                                <!--<local:ControlGalleryItem Width="60" Height="60" ControlItem="{Binding BindsDirectlyToSource=True}" MouseDown="ControlGalleryItem_PreviewMouseDown" MouseUp="ControlGalleryItem_MouseUp"  PreviewMouseMove="ControlGalleryItem_PreviewMouseMove"  PreviewGiveFeedback="ControlGalleryItem_PreviewGiveFeedback"  QueryContinueDrag="ControlGalleryItem_QueryContinueDrag"   />-->
                                                <Grid x:Name="ControlGrid" Width="60" Height="60" MouseDown="ControlGalleryItem_PreviewMouseDown" MouseUp="ControlGalleryItem_MouseUp"  PreviewMouseMove="ControlGalleryItem_PreviewMouseMove"  PreviewGiveFeedback="ControlGalleryItem_PreviewGiveFeedback"  QueryContinueDrag="ControlGalleryItem_QueryContinueDrag" >
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="*" />
                                                    </Grid.ColumnDefinitions>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="*" />
                                                        <RowDefinition Height="Auto" />
                                                    </Grid.RowDefinitions>
                                                    <Image Stretch="Uniform" Grid.Row="0" Grid.Column="0" Source="{Binding Path=Icon}"/>
                                                    <TextBlock x:Name="ItemLabelBottom" Grid.Row="1" Grid.Column="0" VerticalAlignment="Top" TextWrapping="Wrap" HorizontalAlignment="Center" FontSize="9" Text="{Binding Path=Name}"  />
                                                </Grid>
                                            </StackPanel>
                                        </DataTemplate>
                                    </ribbon:PopupGallery.ItemTemplate>
                                    <ribbon:PopupGallery.ZoomedInItemTemplate>
                                        <DataTemplate>
                                            <local:ControlGalleryItem Width="96" Height="96" ControlItem="{Binding BindsDirectlyToSource=True}"  MouseDown="ControlGalleryItem_PreviewMouseDown" MouseUp="ControlGalleryItem_MouseUp"  PreviewMouseMove="ControlGalleryItem_PreviewMouseMove"  PreviewGiveFeedback="ControlGalleryItem_PreviewGiveFeedback"  QueryContinueDrag="ControlGalleryItem_QueryContinueDrag"  />
                                        </DataTemplate>
                                    </ribbon:PopupGallery.ZoomedInItemTemplate>
                                </ribbon:PopupGallery>
                            </ribbon:RibbonGallery.PopupContent>


Thanks,

Ken     

Comments (1)

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

Hi Ken,

It is intentional (and I think it might even be a requirement by Microsoft) that the popup gallery cover up the in-ribbon gallery.  I don't believe we have a way to change that since it is by design and wouldn't result in a good UI if it was under the ribbon.

What specific problem do you have with the mouse events that you mentioned?


Actipro Software Support

The latest build of this product (v24.1.2) was released 0 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.