static JsonItemViewModel() { var defaultProperty = new JsonProperty { Name = @". . ." }; var defaultChildItem = new JsonViewItem(defaultProperty); _defaultChildren = new ReadOnlyCollection <JsonItemViewModel>(new List <JsonItemViewModel> { new JsonItemViewModel(defaultChildItem) }); }
internal JsonItemViewModel(JsonViewItem rootItem, bool loadChildren = true) { _rootItem = rootItem; if (loadChildren) { _children = new ReadOnlyCollection <JsonItemViewModel>( (from item in _rootItem.Children select new JsonItemViewModel(item, false)).ToList()); } else { _children = _defaultChildren; } }