fluentribbon / Fluent.Ribbon

WPF Ribbon control like in Office
http://fluentribbon.github.io
MIT License
2.54k stars 518 forks source link

Empty ContextMenu shown when ribbon controls are used outside of Ribbon #1123

Open ychumpov opened 1 year ago

ychumpov commented 1 year ago

I noticed that when I click on split button with right click, the follow small square appears:

image

Is this by design or it is a bug?

Here is the actual xaml:

<fluent:SplitButton Grid.Row="3"
                                Header="Test"
                                HorizontalAlignment="Center">
                <fluent:MenuItem Header="Name">
                    <fluent:MenuItem.ContextMenu>
                        <fluent:ContextMenu>
                            <fluent:MenuItem Header="Menu Item"
                                      Background="Transparent"/>
                        </fluent:ContextMenu>
                    </fluent:MenuItem.ContextMenu>
                </fluent:MenuItem>
                <fluent:MenuItem Header="Family"/>
            </fluent:SplitButton>

Environment

batzen commented 1 year ago

Could you try this with the current preview version of version 10? I can't reproduce your issue using that version. Haven't tried version 9.

If it also happens with version 10 it would be nice if you could attach a small repro project.

ychumpov commented 1 year ago

Confirm the small square is still shown on the right click in version - 10.0.0-alpha0256. Here is demo project.

FluentContextMenuExample.zip

batzen commented 1 year ago

Ah, you are trying to use the control outside of a Ribbon.

The context menu code to support the same context menu on every ribbon control is quite complicated and the way it works leads to an empty context menu if controls meant to be used in the ribbon are used outside of a ribbon.

I am not sure when and if I will ever fix this. Maybe I have a bright moment and find a solution some day.

ychumpov commented 1 year ago

Beyond this bug, are there any other issues if I use fluent controls like drop down button and split button outside the ribbon?

batzen commented 1 year ago

Not as far as I know.