c# - WhenAny for current null values -
is there way use whenany property of value null , set later?
this:
public server selectedserver {get;set;} public testclass() { this.whenany(selectedserver.items.changed, x => x).subscribe(/*do something*/); }
selectedserver null, set through user interaction , therefor nullreferenceexception in constructor.
this typo instead produces runtime crash, should be:
this.whenanyvalue(x => x.selectedserver.items.changed);
but given name of variable, i'm guessing better thing be:
this.whenanyobservable(x => x.selectedserver.items.changed);
Comments
Post a Comment