In html, there is nothing preventing you from creating custom attributes, since it is effectively xml such as
<span myProperty="myValue"></span>
Then you can read that property via javascript.
Can you do the same thing in wpf? For example:
<Canvas MyProperty="MyValue" Name="MyCanvas" DataContext="{Binding}" Background="Black" Margin="181,0,0,0"></Canvas>
and If so how would you access that property? For example:
MyCanvas.MyProperty;
The closest you can get are attached properties. Basically, another class defines a known property (i.e. MyProperty), which can be set on other elements.
An example would be the Canvas.Left property, which is used by the Canvas to position a child element. But any class can define an attached property.
Attached properties are the key behind attached behaviors, which is a great feature of WPF/Silverlight.
EDIT:
Here is an example class:
Then in XAML you can use it like so:
You can get the property from code using
MyClass.GetMyProperty
and passing in the element on which the property is set.