You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AttributeList.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -132,7 +132,7 @@ public void DeferredLoad()
132
132
}
133
133
catch(Exceptionerr)
134
134
{
135
-
thrownewCodecException(String.Format("Deferred loading of attribute \"{0}\" on element {1} using codec {2} threw an exception.",Name,((Element)Owner).ID,OwnerDatamodel.Codec),err);
135
+
thrownewCodecException($"Deferred loading of attribute \"{Name}\" on element {((Element)Owner).ID} using {OwnerDatamodel.Codec} codec threw an exception.",err);
* Write your own codecs with the `ICodec` interface
39
-
40
-
### Data Binding
41
-
42
-
You can bind to an attribute as if it were a property of the host element, e.g. `{Binding MyElement.Hello}`. If an attribute's name collides with a statically-defined property of `Element` then use indexer syntax instead, e.g. `{Binding MyElement[Owner]}`.
43
-
44
-
### ObservableAttribute
45
-
46
-
In order to correctly implement `IDictionary`, attributes are exposed as `KeyValuePair` objects. Since these aren't great for data binding the utility type `ObservableAttribute` is provided.
47
-
48
-
`ObservableAttribute` will automatically wrap its descendants. For further binding convenience it will also wrap array items, generating an index-based label in place of an attribute key for each.
49
-
50
-
An `IValueConverter` class is provided in a comment block at the start of `ObservableAttribute`'s class definition.
37
+
* Support for property based attributes
51
38
52
39
## Quick example
53
40
@@ -62,12 +49,9 @@ var MyString = HelloWorld.Root.Get<string>("Hello");
62
49
HelloWorld.Save("hello world.dmx", "keyvalues2", 1); // must provide an encoding name and version
63
50
```
64
51
65
-
```xml
66
-
<DatamodelFormat="helloworld"FormatVersion="1">
67
-
<Datamodel.Root>
68
-
<ElementName="my_root">
69
-
<sys:Stringx:Key="Hello">World</sys:String>
70
-
</Element>
71
-
</Datamodel.Root>
72
-
</Datamodel>
52
+
```vdf
53
+
<--! dmx encoding keyvalues2 1 format helloworld 1>
0 commit comments