DataBinding and Inheritance

Dec 7, 2010 at 5:41 PM

Hi, I have a base type and a derived type in a separate file.  When I generate, I generate with DataBinding option enable.  The generated code both has PropertyChanged event, below.  As you can see, there are two PropertyChanged event.  So when I subscribe for property change on the derived type but change an attribute that belongs to the base type I won't get the property change event because it was attached to the property change event of the derived class.  Any workaround for this issue?  And please don't suggest I manually change the file :)

 

public class A {
    private string foo;

    public event PropertyChangedEventHandler PropertyChanged;

    public string foo
   {
        // raise property changed if value changes
   }
}

public class B : A {
    private string bar;

    public event PropertyChangedEventHandler PropertyChanged;

    public string bar
   {
        // raise property changed if value changes
   }
}






XML File:  a.xml

<xs:complexType name="AType">
    <xs:attribute name="foo" type="xs:string">
</xs:complexType>

Then b.xml I have
 
<xs:complexType name="BType">
    <xs:complexContent>
        <xs:extension base="AType">
            <xs:attribute name="bar" type="xs:string"/>
        </xs:extension>
    </xs:complexContent>
</xs:complexType>
Mar 4, 2011 at 2:55 PM

any answer to this?  thanks in advance