Binding Symbols in a ListBox

后端 未结 1 1602
逝去的感伤
逝去的感伤 2020-12-12 05:42

I want to use some items in Segoe MDL2 Assets as icons for a menu driven off a collection.

I have my collection defined

NavItems = n         


        
1条回答
  •  攒了一身酷
    2020-12-12 06:31

    In C#, unicode character escapes sequences are prefixed by \u, so your code should look like this:

    NavItems = new ObservableCollection
    {
        new NavItem { Icon = "\uE1E2", ... },
        new NavItem { Icon = "\uE115", ... }
    };
    

    0 讨论(0)
提交回复
热议问题