private void TestTreeView_Expanding(TreeView sender, TreeViewExpandingEventArgs args) { var loadingNode = args.Node; if (loadingNode == _virtualizedNode) { loadingNode.Children.Add(new TreeViewNode() { Content = "Loaded: 1" }); loadingNode.Children.Add(new TreeViewNode() { Content = "Loaded: 2" }); loadingNode.Children.Add(new TreeViewNode() { Content = "Loaded: 3" }); loadingNode.HasUnrealizedChildren = false; Results.Text = "Loaded"; } }
private void ContentModeTestTreeView_Expanding(TreeView sender, TreeViewExpandingEventArgs args) { var loadingItem = args.Item as TreeViewItemSource; var count = TestTreeViewItemsSource[0].Children.Count; if (loadingItem == TestTreeViewItemsSource[0].Children[count - 1]) { loadingItem.Children.Add(new TreeViewItemSource() { Content = "Loaded: 1" }); loadingItem.Children.Add(new TreeViewItemSource() { Content = "Loaded: 2" }); loadingItem.Children.Add(new TreeViewItemSource() { Content = "Loaded: 3" }); loadingItem.HasUnrealizedChildren = false; Results.Text = "Loaded"; } }
private void DirectoryView_Expanding(Microsoft.UI.Xaml.Controls.TreeView sender, Microsoft.UI.Xaml.Controls.TreeViewExpandingEventArgs args) { if (args.Node.HasUnrealizedChildren) { ItemViewModel.FillTreeNode(args.Item, sender); } }