Coder Social home page Coder Social logo

Comments (7)

davidxuang avatar davidxuang commented on July 22, 2024 2

I just stumbled over this question. I'm currently try to achieve this aswell. I declared it like this and it starts, but the icon isn't shown. It's just empty. Any idea what I'm doing wrong?

    <ui:NavigationView x:Name="NavigationView"
                       ItemInvoked="NavigationView_OnItemInvoked"
                       IsBackButtonVisible="True"
                       IsBackEnabled="{Binding CanGoBack, Mode=OneWay}"
                       BackRequested="NavigationView_OnBackRequested">
        <ui:NavigationView.MenuItems>
            <ui:NavigationViewItem Content="{x:Static lang:Translations.DashboardMenuItem}">
                <ui:NavigationViewItem.IconSource>
                    <ic:SymbolIconSource Symbol="Home" />
                </ui:NavigationViewItem.IconSource>
            </ui:NavigationViewItem>
            <ui:NavigationViewItem Content="{x:Static lang:Translations.StatisticsMenuItem}">
                <ui:NavigationViewItem.IconSource>
                    <ic:SymbolIconSource Symbol="ChartMultiple" />
                </ui:NavigationViewItem.IconSource>
            </ui:NavigationViewItem>
        </ui:NavigationView.MenuItems>

@NPadrutt @Leon99 This isn't working because the FluentAvalonia use a hard-coded conversion for IconSource (see here). I've updated my SymbolIconSource implementation as a derived class of PathIconSouce. It should be working starting the next automated release.

from fluenticons.

NPadrutt avatar NPadrutt commented on July 22, 2024 1

I just stumbled over this question. I'm currently try to achieve this aswell. I declared it like this and it starts, but the icon isn't shown. It's just empty. Any idea what I'm doing wrong?

    <ui:NavigationView x:Name="NavigationView"
                       ItemInvoked="NavigationView_OnItemInvoked"
                       IsBackButtonVisible="True"
                       IsBackEnabled="{Binding CanGoBack, Mode=OneWay}"
                       BackRequested="NavigationView_OnBackRequested">
        <ui:NavigationView.MenuItems>
            <ui:NavigationViewItem Content="{x:Static lang:Translations.DashboardMenuItem}">
                <ui:NavigationViewItem.IconSource>
                    <ic:SymbolIconSource Symbol="Home" />
                </ui:NavigationViewItem.IconSource>
            </ui:NavigationViewItem>
            <ui:NavigationViewItem Content="{x:Static lang:Translations.StatisticsMenuItem}">
                <ui:NavigationViewItem.IconSource>
                    <ic:SymbolIconSource Symbol="ChartMultiple" />
                </ui:NavigationViewItem.IconSource>
            </ui:NavigationViewItem>
        </ui:NavigationView.MenuItems>

image

from fluenticons.

davidxuang avatar davidxuang commented on July 22, 2024

No, as for FluentIcons.Avalonia. As a workaround, I’ve just released a new package FluentIcons.FluentAvalonia where SymbolIcon is built upon FontIcon from FluentAvalonia. It should work with all FluentAvalonia v1.3.0+ controls since the FontIcon APIs haven’t change since then, but I haven’t tested it for v2 yet. So please leave some feedback whether it works on v2 or not.

Please note that for now, only preview versions works for FluentAvalonia v2.

from fluenticons.

masterWeber avatar masterWeber commented on July 22, 2024

Please note that for now, only preview versions works for FluentAvalonia v2.

Not buildable for v2, because avalonia v11 is used there.

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Avalonia.Visuals, Version=0.10.13.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b'. The system cannot find the file specified.

from fluenticons.

davidxuang avatar davidxuang commented on July 22, 2024

Use the version with preview suffix. Latest is 1.1.182-preview.

图片

from fluenticons.

masterWeber avatar masterWeber commented on July 22, 2024

Great! Thank you so much!

from fluenticons.

Leon99 avatar Leon99 commented on July 22, 2024

@NPadrutt +1.
The same code using FAvalonia's SymbolIconSource works.

from fluenticons.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.