Answer the question
In order to leave comments, you need to log in
How to implement LazyLoad on TreeView?
Hello.
Let's go right away, there is a TreeView
<TreeView ItemsSource="{Binding MyObjects}" Grid.Row="0">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Path=Children}">
<StackPanel Orientation="Horizontal">
<Image Source="/MyAddIn;component\Resources\treeEl.png" Stretch="Fill" Width="12" Height="12" RenderOptions.BitmapScalingMode="HighQuality"/>
<TextBlock Text=" " />
<TextBlock Text="{Binding Description}" />
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
public string Description { get; set; }
public ObservableCollection<MyObject> Children { get; set; }
Answer the question
In order to leave comments, you need to log in
Than the example from MSDN did not arrange?
https://docs.microsoft.com/en-us/dotnet/framework/...
There is a moment - under certain conditions, virtualization is disabled:
- if item containers are added directly to the ItemsControl.
- if the ItemsControl object contains containers of elements of various types.
- if the attached property VirtualizingStackPanel.IsVirtualizing is set to false - if
the
attached property ScrollViewer.CanContentScroll is set to
false
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question