Getting duplicate Dropdown Pop-up when ribbon is collapsed

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am working on creating custom ribbon tab in AutoCAD ribbon.
I am creating ribbon using RibbonCompositeItem and RibbonPanelSource classes.
I am using xaml file to add custom ribbon, which has dropdown with wpf popup element.
When the ribbon is not collapsed, dropdown popup is coming once when opened, and working fine.
But when window size is decreased, and ribbon is collapsed, then I am getting duplicate popup.
Please help, how can I resolve this.
I am using button click to open popup.
<Button x:Name="PART_DropDownButton" Background="Transparent" Height="Auto">
</Button>
<Popup AllowsTransparency="True" x:Name="PART_Popup"PopupAnimation="Fade" >
<ContentControl Content="{Binding PopupContent, RelativeSource={RelativeSource TemplatedParent}}"/>
</Border>
</Popup>