-
Notifications
You must be signed in to change notification settings - Fork 692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to style the MenuBarItem Flyout #1035
Comments
@YuliKl thinks there might be a way to do this, but if it's not straightforward then a new property on MenuBar & MenuBarItem for the style seems fine. |
@jordui <Style TargetType="MenuFlyoutPresenter">
<Setter Property="Background" Value="Red"/>
</Style> This had the effect of coloring the backgrounds of all MenuBarItems and all MenuFlyouts in my app. Can you tell us more about your scenario? Are you trying to style the Flyout of a single MenuBarItem, or all flyouts in a MenuBar? What aspects of the flyout do you need to style? |
@YuliKl Ah yes you're right, I put the implicit style into my App.xaml and it worked. I thought it would work implicitly in my local usercontrol xaml resources (I also tried inside the MenuBarItem overridden Style.Resources). I am currently working with a customized version of the 19H1 Win32 XamlIslands sample using cppwinrt and mux as we need to use win32 for our app (at least for now). We have our own colour scheme manager so everything will need to be styled for most controls; the background colour and padding etc. That's not to say we couldn't consider ThemeResources though. |
@jordui, sounds like your issue is resolved so I'll go ahead and close it. Please reopen if I'm misunderstanding. |
@YuliKl is it intentional that styling the flyout only works globally (via |
I definitely would not call this intentional. While I didn't try adding the style to a user control, I did try making it a resource of the Page and more specific components. @MikeHillberg, any thoughts on this? |
There appears to be no way to style the flyout which appears in a menu bar item. In WPF the Popup was declared in XAML allowing us to make cutom changes to the flyout. Currently the menu flyout is created in code. I tried making a generic MenuFlyoutPresenter style but it isnt getting picked up. Perhaps the code could check if the named ContentButton has a flyout and use that. or failing that the MenuBarItem needs a MenuFlyoutStyle DP?
The text was updated successfully, but these errors were encountered: