Skip to content
Discussion options

You must be logged in to vote

Hi @mpa74!

Taking a look at your markup code for the bindings of the ItemTemplate and ItemsSource of the TreeView, I think the wrong extension methods are being used here. You can take a look at the docs here on Templates and Bindings in C# Markup. Following that doc I created some sample code that generates the following TreeView structure:

Here's the markup code that creates that:

namespace UnoApp29;

public sealed partial class MainPage : Page
{
  public record Item(string Name, Item[] Children)
  {
    public Item() : this(string.Empty, [])
    {
    }
  }

  private Item[] _items =
  [
    new Item()
    {
      Name = "Flavors",
      Children =
      [
        new Item() { Name = "…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mpa74
Comment options

Answer selected by francoistanguay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants