public JsonObjectViewModel(JsonObject model, JsonObjectViewModel parentVM) { Model = model ?? throw new ArgumentNullException(nameof(model)); ParentVM = parentVM; _isExpanded = false; _isSelected = false; }
private JsonObjectViewModel Transform(JsonObject root, JsonObjectViewModel parentVM, ref Dictionary <JsonObject, List <JsonObjectViewModel> > map) { if (root == null) { throw new ArgumentNullException(); } var rootVM = new JsonObjectViewModel(root, parentVM); map.Add(root, new List <JsonObjectViewModel> { rootVM }); foreach (var child in root.Fields) { rootVM.Fields.Add(Transform(child, rootVM, ref map)); } return(rootVM); }