private void RecurseToggle(JTokenTreeItem item, bool isExpanded) { item.IsExpanded = isExpanded; if (item.Children != null) { foreach (var jtti in item.Children) { RecurseToggle(jtti, isExpanded); } } }
private void SetItemSource() { if (_treeView != null) { if (RootToken == null) { _treeView.ItemsSource = null; } else { var items = JTokenTreeItem.Build(RootToken); items[0].IsExpanded = true; _treeView.ItemsSource = items; } } }
public static JTokenTreeItem[] Build(JToken source) { var node = new JTokenTreeItem(source); return(new JTokenTreeItem[] { node }); }