I'm developing an application using WinUI 3, PnP Core SDK. The code is retreiving the document libraries and lists of a sharepoint with some parameters.

I want you cbange the code to retrieve a lot more information from the lists and library. Add treenode under the listNode nodes if needed.
For example, but not limited to that : description of the list, list of content types, list of columns, list of the views, etc.

Here's the current code.

MainWindow.xaml :

<Window
    x:Class="TestWinUI3ConnectionSharePoint_20240916.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TestWinUI3ConnectionSharePoint_20240916"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Margin="20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,20">
            <TextBox x:Name="SiteUrlTextBox" PlaceholderText="Entrez l'URL du site SharePoint" Text="https://testtesttest.sharepoint.com/sites/SiteProjetPOC20240416" Width="300" Margin="0,0,10,0"/>
            <Button Content="Scan" Click="OnScanClick"/>
        </StackPanel>

        <TextBlock x:Name="StatusTextBlock" Grid.Row="1" Margin="0,0,0,10"/>

        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <TreeView x:Name="ResultsTreeView" Grid.Column="0" 
          BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}" 
          BorderThickness="1" 
          SelectionChanged="ResultsTreeView_SelectionChanged" />

            <ScrollViewer Grid.Column="1" Margin="20,0,0,0">
                <TextBlock x:Name="DetailsTextBlock" TextWrapping="Wrap"/>
            </ScrollViewer>
        </Grid>
    </Grid>
</Window>


MainWindow.xaml.cs : 

using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using PnP.Core.Services;
using PnP.Core.Auth;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using PnP.Core.Model.SharePoint;
using PnP.Core.QueryModel;

namespace TestWinUI3ConnectionSharePoint_20240916
{

    public class ListInfo
    {
        public string Title { get; set; }
        public ListTemplateType TemplateType { get; set; }
        public string ServerRelativeUrl { get; set; }
        public bool EnableVersioning { get; set; }
    }

    public sealed partial class MainWindow : Window
    {
        private IHost host;
        private const string ClientId = "65d32704-49e5-490f-94c0-000000000000";
        private const string TenantId = "56740a61-9b73-4c19-9220-000000000000";
        private const string RedirectUri = "http://localhost";

        private List<ListInfo> listInfos;


        public MainWindow()
        {
            this.InitializeComponent();
        }

        private async void OnScanClick(object sender, RoutedEventArgs e)
        {
            try
            {
                string siteUrl = SiteUrlTextBox.Text;
                if (string.IsNullOrEmpty(siteUrl))
                {
                    StatusTextBlock.Text = "Veuillez entrer l'URL du site SharePoint.";
                    return;
                }

                StatusTextBlock.Text = "Scan en cours...";
                var authProvider = CreateAuthenticationProvider();
                ConfigureHost(siteUrl, authProvider);

                using var scope = host.Services.CreateScope();
                var pnpContextFactory = scope.ServiceProvider.GetRequiredService<IPnPContextFactory>();
                using (var context = await pnpContextFactory.CreateAsync("Default"))
                {
                    var lists = await context.Web.Lists
                        .QueryProperties(l => l.Title, l => l.TemplateType, l => l.EnableVersioning)
                        .ToListAsync();
                    
                    listInfos = new List<ListInfo>();
                    foreach (var list in lists)
                    {
                        var rootFolder = await list.RootFolder.GetAsync(f => f.ServerRelativeUrl);
                        listInfos.Add(new ListInfo
                        {
                            Title = list.Title,
                            TemplateType = list.TemplateType,
                            ServerRelativeUrl = rootFolder.ServerRelativeUrl,
                            EnableVersioning = list.EnableVersioning
                        });
                    }

                    DisplayResults(siteUrl, listInfos);
                }
            }
            catch (Exception ex)
            {
                StatusTextBlock.Text = $"Erreur : {ex.Message}";
                System.Diagnostics.Debug.WriteLine($"Erreur : {ex.Message}\nStack Trace : {ex.StackTrace}");
            }
        }

        private InteractiveAuthenticationProvider CreateAuthenticationProvider()
        {
            return new InteractiveAuthenticationProvider(ClientId, TenantId, new Uri(RedirectUri));
        }

        private void ConfigureHost(string siteUrl, InteractiveAuthenticationProvider authProvider)
        {
            host = Host.CreateDefaultBuilder()
                .ConfigureServices((context, services) =>
                {
                    services.AddPnPCore(options =>
                    {
                        options.Sites.Add("Default", new PnP.Core.Services.Builder.Configuration.PnPCoreSiteOptions
                        {
                            SiteUrl = siteUrl,
                            AuthenticationProvider = authProvider
                        });
                    });
                })
                .Build();
        }

        private void DisplayResults(string siteUrl, List<ListInfo> listInfos)
        {
            var rootNode = new TreeViewNode()
            {
                Content = $"{DateTime.Now:yyyyMMdd_HHmm}-?"
            };
            rootNode.IsExpanded = true;

            var siteNode = new TreeViewNode()
            {
                Content = siteUrl
            };
            siteNode.IsExpanded = true;
            rootNode.Children.Add(siteNode);

            var librariesNode = new TreeViewNode()
            {
                Content = "Bibliothèques"
            };
            librariesNode.IsExpanded = true;
            siteNode.Children.Add(librariesNode);

            var listsNode = new TreeViewNode()
            {
                Content = "Listes"
            };
            listsNode.IsExpanded = true;
            siteNode.Children.Add(listsNode);

            foreach (var listInfo in listInfos)
            {
                var listNode = new TreeViewNode()
                {
                    Content = listInfo.Title
                    
                };
                listNode.IsExpanded = true;

                if (listInfo.TemplateType == ListTemplateType.DocumentLibrary || listInfo.TemplateType == ListTemplateType.WebPageLibrary)
                {
                    librariesNode.Children.Add(listNode);
                }
                else
                {
                    listsNode.Children.Add(listNode);
                }
            }

            if (ResultsTreeView.RootNodes.Count == 0)
            {
                ResultsTreeView.RootNodes.Add(rootNode);
            }
            else
            {
                ResultsTreeView.RootNodes[0].Children.Add(rootNode);
            }

            StatusTextBlock.Text = "Scan terminé. Résultats affichés.";
        }



        private void ResultsTreeView_SelectionChanged(TreeView sender, TreeViewSelectionChangedEventArgs args)
        {
            if (sender.SelectedNode != null && sender.SelectedNode.Content is string SelectedList)
            {
                
                ListInfo selectedItem = listInfos.FirstOrDefault(item => item.Title == SelectedList);

                if (selectedItem != null)
                {
                    DetailsTextBlock.Text = $"Titre: {selectedItem.Title}\n" +
                                            $"Type: {selectedItem.TemplateType}\n" +
                                            $"URL: {selectedItem.ServerRelativeUrl}\n" +
                                            $"Versionnage activé: {selectedItem.EnableVersioning}";
                }
            }
            else
            {
                DetailsTextBlock.Text = "Sélectionnez une liste ou une bibliothèque pour voir les détails.";
            }
        }

    }
}