C#C
C#2y ago
pxd 丝

How could I implement the tree correctly using XAML?

Hello! I've started a XAML .NET application
https://github.com/PerikiyoXD/RWTree/

The problem I'm facing is that I'm creating chunks of data in classes that are going to represent a tree.

Now I just create TreeItem instances using this approach:

Middleware/RenderWare/Stream/Chunks/ClumpStructChunk.cs
    public new TreeViewItem ToTreeViewItem()
    {
        var treeViewItem = base.ToTreeViewItem();

        treeViewItem.Items.Add(new TreeViewItem {Header = $"Atomic Chunk Count: {AtomicChunkCount}"});
        treeViewItem.Items.Add(new TreeViewItem {Header = $"Light Chunk Count: {LightChunkCount}"});
        treeViewItem.Items.Add(new TreeViewItem {Header = $"Camera Chunk Count: {CameraChunkCount}"});

        return treeViewItem;
    }


I know this is not the best approach and I'd like to have suggestions on how could I implement this

The end product should be something like this (Side by side comparison, left is RWTree, right is RWAnalyze which I'm trying to replicate)
image.png
GitHub
RWTree is a specialized application crafted for visualizing the internal structure of RenderWare binary streams. - GitHub - PerikiyoXD/RWTree: RWTree is a specialized application crafted for visual...
Was this page helpful?