wpfui icon indicating copy to clipboard operation
wpfui copied to clipboard

Pane menu items' FontSize cannot be changed

Open SalehBagheri opened this issue 2 years ago • 1 comments

Describe the bug

According to the screenshot, the FontSize property doesn't work for the Pane menu items, and it's too large in comparison to other similar apps.

To Reproduce

Just create a NavigationView menu and add some menu items as below:

<ui:NavigationView
    FrameMargin="0"
    IsBackButtonVisible="Collapsed"
    IsPaneToggleVisible="False"
    OpenPaneLength="60"
    PaneDisplayMode="LeftFluent">
    <ui:NavigationView.MenuItems>
        <ui:NavigationViewItem
            Content="Home"
            FontSize="7" <!-- Not Working -->
            Icon="{ui:SymbolIcon Home24}">
        </ui:NavigationViewItem>
    </ui:NavigationView.MenuItems>
</ui:NavigationView>

Expected behavior

Setting the FontSize property should change the size of the font.

Screenshots

image

OS version

Windows 11

.NET version

.NET 8.0.1

WPF-UI NuGet version

3.0.0

Additional context

No response

SalehBagheri avatar Feb 07 '24 01:02 SalehBagheri

While only a band aid, this is how I handled it for myself.

<ui:NavigationViewItem>
    <ui:NavigationViewItem.Icon>
        <ui:FontIcon FontSize="9" FontFamily="{DynamicResource SegoeFluentIcons}" Glyph="&#xe80f;" />
    </ui:NavigationViewItem.Icon>
    <ui:NavigationViewItem.Content>
        <TextBlock FontSize="9" Text="Payments" />
    </ui:NavigationViewItem.Content>
</ui:NavigationViewItem>

Note that you can remove FontSize off of the FontIcon for it to auto size. Personally, I found FontIcon tends to scale better than SymbolIcon.

Grinch avatar Feb 28 '24 05:02 Grinch

Thank you! It's a nice workaround ...

While only a band aid, this is how I handled it for myself.

<ui:NavigationViewItem>
    <ui:NavigationViewItem.Icon>
        <ui:FontIcon FontSize="9" FontFamily="{DynamicResource SegoeFluentIcons}" Glyph="&#xe80f;" />
    </ui:NavigationViewItem.Icon>
    <ui:NavigationViewItem.Content>
        <TextBlock FontSize="9" Text="Payments" />
    </ui:NavigationViewItem.Content>
</ui:NavigationViewItem>

Note that you can remove FontSize off of the FontIcon for it to auto size. Personally, I found FontIcon tends to scale better than SymbolIcon.

SalehBagheri avatar Feb 28 '24 07:02 SalehBagheri