VirtualTreeView 0.4.1

.NET 6.0 .NET Framework 4.6.2
Install-Package VirtualTreeView -Version 0.4.1
dotnet add package VirtualTreeView --version 0.4.1
<PackageReference Include="VirtualTreeView" Version="0.4.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VirtualTreeView --version 0.4.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: VirtualTreeView, 0.4.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. 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.1

// Install VirtualTreeView as a Cake Tool
#tool nuget:?package=VirtualTreeView&version=0.4.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

<table> <tr> <td rowspan=2> <img src="https://raw.githubusercontent.com/picrap/VirtualTreeView/master/Icon/VirtualTreeView.png" width=128 height=128 /></td> <td><h1>VirtualTreeView</h1></td> </tr> <tr><td>A WPF TreeView that actually supports virtualization.<br/> Works with .NET Framework 4.5.</td></tr> </table>

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 Versions
.NET net6.0-windows7.0
.NET Framework net462 net463 net47 net471 net472 net48
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6.2

    • No dependencies.
  • net6.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.1 144 2/14/2022
0.4.0 1,182 5/2/2017
0.3.3 1,007 11/14/2016
0.3.2 969 11/14/2016
0.3.1 1,171 11/9/2016
0.3.0 1,272 11/5/2016
0.2.7 963 10/31/2016
0.2.3 979 10/28/2016
0.2.2 970 10/28/2016
0.2.1 1,012 10/27/2016
0.2.0 935 10/27/2016
0.1.0 967 10/26/2016