wpfui
wpfui copied to clipboard
ContextMenu style lacks drop shadow
Describe the bug
The default style for <ContextMenu>
doesn't seem to set a drop shadow (or any other kind of border). However, the style for subseqent submenus does.
To Reproduce
(I think this is clear from the screenshots.)
Expected behavior
The visual style should match other menus
Screenshots
Notice no drop shadow around the menu items:
Whereas submenus show one that seems almost too strong?
OS version
Windows 11 22H2 23506.1000
.NET version
Framework 4.7.2
WPF-UI NuGet version
2.0.3
Additional context
I skimmed the style files, and notice that
-
Menu.xaml
sets a drop shadow -
ContextMenu.xaml
sets a propertyHasDropShadow
tofalse
(not sure why, and it seems to have no effect), and also doesn't set one either way
With recent updates, a border was added to make sure the contextmenu. @chucker mind testing the latest preview (preview-10
) to see if that resolves this issue?
to see if that resolves this issue?
Hmmm, as of 8afb0d9 or preview-11
, it doesn't seem to. I'm using the Light theme:
foreach (var uri in new[]
{
"pack://application:,,,/Wpf.Ui;component/Resources/Theme/Light.xaml",
"pack://application:,,,/Wpf.Ui;component/Resources/Wpf.Ui.xaml"
})
{
resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri(uri) });
}
…and applying UiContextMenu
:
Style = (Style)FindResource("UiContextMenu");
…and it looks like this:
@chucker Yeah, the only change I'm seeing is that there is a very (subtle) border around the context menu. But agree, ideally this would show a dropshadow as well
Ah, you're right — the border is new. That is indeed better than before!