GoXam for WPF v3
ReadEnum<T> Method
Northwoods.GoXam.Model Namespace > XHelper Class : ReadEnum<T> Method
this must be an Enum type
the attribute name, often the same as the data's property name
the XElement holding the expected attribute
the default value for the property
Consume an XAttribute on an XElement, converting the attribute's value to an enumerated type, or return the default value if the attribute is not present or if there is a conversion exception.
Syntax
public static T ReadEnum<T>( 
   XName n,
   XElement e,
   T defval
)
where T: new(), IComparable, struct

Parameters

n
the attribute name, often the same as the data's property name
e
the XElement holding the expected attribute
defval
the default value for the property

Type Parameters

T
this must be an Enum type

Return Value

the attribute value converted to the T, or the default value
See Also

Reference

XHelper Class
XHelper Members