[Unity] Property changed event 'lost' in child classes?
Hi,
I've stumbled over seemingly flat surface and would appreciate any input on what am I doing wrong.
There is basic class (LocalOject) with one registered property (currentSpeed) and the class that inherits from it (with another registered property):
Now, when I set value of property from the instance of class where property is registered, everything works great. But when I try to modify value of property that registered in parent class:
I get the following : Exception: Can't launch PropertyChanged event. Property 'currentSpeed' not registered for type 'SpaceShip'
So what must be done to correctly inherit 'property changed event' from parent class? Thanks.
I've stumbled over seemingly flat surface and would appreciate any input on what am I doing wrong.

There is basic class (LocalOject) with one registered property (currentSpeed) and the class that inherits from it (with another registered property):
Code: Select all
[Noesis.Extended]
public class LocalObject: Noesis.BaseComponent {
private float _currentSpeed;
public float currentSpeed {
get { return _currentSpeed; }
set {
if (_currentSpeed != value) {
_currentSpeed = value;
NotifyPropertyChanged("currentSpeed");
}
}
}
...............
}
public class SpaceShip: LocalObject {
..................
private float _max_ShieldHP;
public float max_ShieldHP {
get { return _max_ShieldHP; }
set {
if (_max_ShieldHP != value) {
_max_ShieldHP = value;
NotifyPropertyChanged("max_ShieldHP");
}
}
}
................
}
Code: Select all
SpaceShip myShip = new SpaceShip();
myShip.currentSpeed = 10f;
I get the following : Exception: Can't launch PropertyChanged event. Property 'currentSpeed' not registered for type 'SpaceShip'
So what must be done to correctly inherit 'property changed event' from parent class? Thanks.
-
-
sfernandez
Site Admin
- Posts: 3203
- Joined:
Re: [Unity] Property changed event 'lost' in child classes?
There is nothing wrong in your code.
It is a bug in our plugin code, we will fix it for the next release.
Sorry for the inconvenience.
It is a bug in our plugin code, we will fix it for the next release.
Sorry for the inconvenience.
Re: [Unity] Property changed event 'lost' in child classes?
Understood, thanks. Looking forward to the update then. Cheers.
Re: [Unity] Property changed event 'lost' in child classes?
Just wanted to add that upcasting doesn't help either. Following code yields the same exception:
Can you hint on how soon you are planning to release the next version?
Code: Select all
SpaceShip myShip = new SpaceShip();
LocalObject myObj = (LocalObject) myShip;
myObj.currentSpeed = 10f;
-
-
sfernandez
Site Admin
- Posts: 3203
- Joined:
Re: [Unity] Property changed event 'lost' in child classes?
By the end of next week we will release 1.1.9 version.Can you hint on how soon you are planning to release the next version?
-
-
sfernandez
Site Admin
- Posts: 3203
- Joined:
Re: [Unity] Property changed event 'lost' in child classes?
Solved in 1.1.9 version.
Who is online
Users browsing this forum: No registered users and 7 guests