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