예제 #1
0
        private void OnCreateObject(object sender, RoutedEventArgs e)
        {
            var property = (JsonPropertyModel)((CheckBox)sender).Tag;

            if (property.Parent[property.Name] == null)
            {
                property.Parent[property.Name] = JsonObjectModel.FromSchema(property.Schema.ActualPropertySchema);
                property.RaisePropertyChanged <JsonPropertyModel>(i => i.HasValue);
            }
        }
예제 #2
0
        private void OnAddArrayObject(object sender, RoutedEventArgs e)
        {
            var property = (JsonPropertyModel)((Button)sender).Tag;

            if (property.Value == null)
            {
                property.Value = new ObservableCollection <JsonTokenModel>();
            }

            var list   = (ObservableCollection <JsonTokenModel>)property.Value;
            var schema = property.Schema.Item;

            var obj = schema.Properties == null ? (JsonTokenModel) new JsonValueModel {
                Schema = schema
            } : JsonObjectModel.FromSchema(schema);

            obj.ParentList = list;

            list.Add(obj);
        }