I am building a C# application using the Entity framework.
I have an Entity which was created from my database which has fields "Price" and "Quantity".
Using a partial class declaration I created a custom property "SubTotal" as follows:
partial class Detail {
public decimal Subtotal {
get
{
return Price * Quantity;
}
}
}
The thing is, I use a lot of DataBinding in my application.
Somewhere, I use an IBindingList<Detail> as ItemsSource for a ListView.
When I modify (using code-behind) some elements of the list, the quantity and price, the listview is updated properly.
However, the Subtotal is not updated.
I think that it's because something is done automatically by the entity framework to notify that something has been changed, but I don't know what to add to my custom property so that it behaves the same way.
Could you help me out?