public ResultObjectViewModel(ResultObject resultObject) { _resultObject = resultObject; // use a Task since ResultObject is a MBRO, so each member access means IO _detailsLoadTask = new Lazy<Task>(() => Task.Run(() => { _header = _resultObject.Header; OnPropertyChanged(nameof(Header)); _value = _resultObject.Value; OnPropertyChanged(nameof(Value)); _children = _resultObject.Children?.Select(x => new ResultObjectViewModel(x)).ToArray(); OnPropertyChanged(nameof(Children)); })); CopyCommand = new DelegateCommand(Copy); }
public void OnDumped(ResultObject o) { Dumped?.Invoke(o); }