This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I am extending an entity with a new readonly property called AmountString – which is get’s its value from the entity property Amount. My WPF control is bound to AmountString. I want it to know AmountString has been changed when Amount has been modified by code elsewhere. I can’t call RaiseEvent PropertyChanged(...) in my partial class because I get the error “Derived classes cannot raise base class events” and calling OnPropertyChanged doesn’t seem to do anything. What am I missing? How can I do this? |
|
|
OnPropertyChanged should work fine. The Entity.OnPropertyChanged implementation fires the PropertyChanged event. |
|
|
Ahhh - figured it out. I had overridden OnPropertyChanged for another purpose - I needed to use MyBase.OnPropertyChanged - now its working as expected! Thanks. |
|
|
Hi KiwiRod I am trying to do something similar. I have entity which has three fields Unit and price and discount . I am creating a partial class to extend that entity and add a new property called total. my property looks like something private decimal? total; public decimal total; { get { _total=unit*price-discount; return _ total; } set { if(total!=value) { _total=value; OnPropertyChanged("total"); } } It displays fine when form loaded first time but when i make any change in any other fields it does not reflect the total, what i can do in this partial class to updated it automatically? I dont want to make any changes in the auto generated partial class. Thanks |
|