VirtualTreeView 0.4.2

dotnet add package VirtualTreeView --version 0.4.2                
NuGet\Install-Package VirtualTreeView -Version 0.4.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VirtualTreeView" Version="0.4.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VirtualTreeView --version 0.4.2                
#r "nuget: VirtualTreeView, 0.4.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install VirtualTreeView as a Cake Addin
#addin nuget:?package=VirtualTreeView&version=0.4.2

// Install VirtualTreeView as a Cake Tool
#tool nuget:?package=VirtualTreeView&version=0.4.2                

VirtualTreeView

A virtualizing TreeView for .NET Framezork 4.6.2, .NET 6 and .NET 8

How to use it

It is available as a NuGet package.
The source code includes a demonstration application, where both modes (content and binding) are showed, side-by-side to traditional TreeView control.

The treeview itself

It works exactly as the original TreeView (with a lot of missing features...):

<vtv:VirtualTreeView ItemsSource="{Binding Items}">
    
    <vtv:VirtualTreeView.Resources>
        
        <HierarchicalDataTemplate ItemsSource="{Binding Children}" 
                                  DataType="{x:Type my:ViewModels}">
            <Grid>
                <TextBlock Text="{Binding MyLabel}"/>
            </Grid>
        </HierarchicalDataTemplate>
    </vtv:VirtualTreeView.Resources>
    
    <vtv:VirtualTreeView.ItemContainerStyle>
        <Style TargetType="{x:Type vtv:VirtualTreeViewItem}">
            <Setter Property="IsExpanded" Value="{Binding MyIsExpanded, Mode=TwoWay}" />
        </Style>
    </vtv:VirtualTreeView.ItemContainerStyle>
</vtv:VirtualTreeView>

The treeview item

If you move from an existing treeView, you'll need to copy/paste your TreeViewItem style and adapt it to vtv:TreeViewItem (usually no change is required, except removing the hierarchical part, which is generated when the control converts the tree to a list).

What does work

Currently it has only the features I needed (which is showing items and let them live); all contributors are welcome. The goal is to have a complete and extensible tree view.

  • With binding, INotifyCollectionChanged fully works, so you can dynamically change content by adding or removing elements at any point of the hierarchy.

What does not

  • With binding, INotifyPropertyChanged does not work at all, since the binding is partly simulated (because the view items are not generated).

How to contribute

Fork it, update it, and submit your pull requests.
Alternatively you can submit requests.

Product Compatible and additional computed target framework versions.
.NET net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net8.0-windows was computed.  net8.0-windows7.0 is compatible. 
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6.2

    • No dependencies.
  • net6.0-windows7.0

    • No dependencies.
  • net8.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.4.2 166 7/26/2024
0.4.1 672 2/14/2022
0.4.0 1,432 5/2/2017
0.3.3 1,225 11/14/2016
0.3.2 1,203 11/14/2016
0.3.1 1,383 11/9/2016
0.3.0 1,509 11/5/2016
0.2.7 1,183 10/31/2016
0.2.3 1,216 10/28/2016
0.2.2 1,197 10/28/2016
0.2.1 1,239 10/27/2016
0.2.0 1,152 10/27/2016
0.1.0 1,193 10/26/2016