Skip to content
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

Property Change in MenuBarItem not working. #8827

Closed
JustBoredTbh opened this issue Sep 4, 2023 · 4 comments
Closed

Property Change in MenuBarItem not working. #8827

JustBoredTbh opened this issue Sep 4, 2023 · 4 comments
Labels
area-Menus bug Something isn't working team-Controls Issue for the Controls team

Comments

@JustBoredTbh
Copy link

JustBoredTbh commented Sep 4, 2023

Describe the bug

I tried to change the font, Colour and Size of a MenuBarItem, but when rendered, the MenuBarItem does not reflect the change. I also restarted the build but it still didn't work.
A somewhat similar issue raised but no solutions have been provided #7070

Steps to reproduce the bug

  1. Add this code to your MainWindow.xaml file
<MenuBarItem Title="View"
             FontFamily="{StaticResource Righteous}"
             FontSize="14"
             FontWeight="Normal"
             Foreground="#5b5b5b">
    <MenuFlyoutItem Text="Edit History"
                    FontFamily="{StaticResource Righteous}"
                    FontSize="14"
                    FontWeight="Normal"
                    Foreground="#5b5b5b"/>
    <MenuFlyoutSeparator/>
    <MenuFlyoutItem Text="Pending Audits"
                    FontFamily="{StaticResource Righteous}"
                    FontSize="14"
                    FontWeight="Normal"
                    Foreground="#5b5b5b"/>
    <MenuFlyoutSeparator/>
    <MenuFlyoutItem Text="Approved Commits"
                    FontFamily="{StaticResource Righteous}"
                    FontSize="14"
                    FontWeight="Normal"
                    Foreground="#5b5b5b"/>
</MenuBarItem>
  1. The FontFamily can be any random FontFamily added to the resource dictionary.

Expected behavior

MenuBarItem was expected to have the same fontstyle as its flyout.

image

Rather it still has the default MenuBarItem Style.

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.4.0: 1.4.230822000

Windows version

Windows 11 (22H2): Build 22621

Additional context

The MenuBarItem Is Inside a custom app bar.

@JustBoredTbh JustBoredTbh added the bug Something isn't working label Sep 4, 2023
@JustBoredTbh
Copy link
Author

The Margin Property Seems to be working. But any Text Styling doesn't work.

@kmgallahan
Copy link
Contributor

What is the parent of your ResourceDictionary?

@JustBoredTbh
Copy link
Author

its an Application-level Resource Dict

What is the parent of your ResourceDictionary?

@bpulliam bpulliam added area-Menus team-Controls Issue for the Controls team labels Sep 7, 2023
@JustBoredTbh
Copy link
Author

I found a way to change the font of the menubaritem using the app.xaml file.
You override the contentcontroltheme properties like this:

<FontFamily x:Key="ContentControlThemeFontFamily">/Assets/Fonts/Righteous Regular.ttf/#Righteous</FontFamily>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Menus bug Something isn't working team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

3 participants