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

Icon is not working #1083

Closed
tmdakm opened this issue May 10, 2024 · 3 comments
Closed

Icon is not working #1083

tmdakm opened this issue May 10, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@tmdakm
Copy link

tmdakm commented May 10, 2024

Describe the bug

I added a button and a navigationviewitem in Dark theme window, and set their icon to "Home24", but it's not working. Light theme too
ui:SymblolIcon is working.

To Reproduce

create new window and add

        <ui:NavigationView PaneDisplayMode="LeftFluent" IsPaneVisible="True">
            <ui:NavigationView.MenuItems>
                <ui:NavigationViewItem Content="Home" Icon="Home24"/>
            </ui:NavigationView.MenuItems>
        </ui:NavigationView>
        <ui:Button Icon="Home24" Content="Home" Margin="79,10,0,0" VerticalAlignment="Top"/>

to its xaml file.

Expected behavior

I can see icons in window

Screenshots

image

OS version

Windows 11

.NET version

.netframework 4.7.2

WPF-UI NuGet version

3.0.4 and 3.0.3

Additional context

No response

@tmdakm tmdakm added the bug Something isn't working label May 10, 2024
@tmdakm
Copy link
Author

tmdakm commented May 10, 2024

this is xaml file of the window:

<Window
        x:Class="LMC.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
        xmlns:controls="clr-namespace:Wpf.Ui.Controls;assembly=Wpf.Ui"
        xmlns:local="clr-namespace:LMC"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid Background="#FF1D1D1D">
        <ui:NavigationView PaneDisplayMode="LeftFluent" IsPaneVisible="True">
            <ui:NavigationView.MenuItems>
                <ui:NavigationViewItem Content="Home" Icon="Home24"/>
            </ui:NavigationView.MenuItems>
        </ui:NavigationView>
        <ui:Button Icon="Home24" Content="Home" Margin="79,10,0,0" VerticalAlignment="Top"/>
    </Grid>
</Window>

@Fabi
Copy link

Fabi commented May 11, 2024

Not only that. I think the whole navigation is broken? Icons not working and selecting items also does not work?

@pomianowski
Copy link
Member

pomianowski commented May 12, 2024

The Icon property of the NavigationViewItem requires IconElement, not the symbol name.

<ui:NavigationViewItem
  Content="Dashboard"
  NavigationCacheMode="Enabled"
  TargetPageType="{x:Type pages:DashboardPage}">
  <ui:NavigationViewItem.Icon>
    <ui:SymbolIcon Symbol="Home24" />
  </ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>

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

No branches or pull requests

3 participants