I use mvvm pattern in wpf app. As datasource i've XDocument. In UI i bind controls to XElements and XAttribute's values from this XDocument. f.ex.
<TextBox Text={Binding XElement[TitleNode].XElement[Title].Value} />
It allows me to have data in only place - in XDoc and allows to avoid data conversion from custom models to xml.
Now I need to extend functionality of model with IDataErrorInfo to realize error notification. So i need to add interface to XElement and XAttribute .net classes. i've 2 decisions: 1) pattern adapter for xelement and xattribute, that will have adaptee, realiztion of interface IDataErrorInfo and Value setter\getter for xelement\xattribute's value. Weakness - i need create adapter-objects for all UI input control and bind to it. 2) Create child class and inherite from XElement\XAttribute with interface realization. Weekness - i need to convert all xelements and xattributes to my child class. What way is better?