XToolkit.WhiteLabel
XToolkit.WhiteLabel copied to clipboard
Bindings null-values cause crash
Description
It would be more convenient if Bindings will use some kind of null-propagation: if one of the properties in the expression is null - then the value of the source would consider null
Steps to Reproduce
- Create ViewModel for screen
- Implement SubViewModel class with string Message
- Add property of type SubViewModel to screen ViewModel
- Set SubViewModel to null by default
- Apply binding like following
this.Bind(() => ViewModel.SubViewModel.Message, () => Label.Text)
Expected Behavior
Source value (ViewModel.SubViewModel.Message) is interpreted as null, so target property (Label.Text) is set to null. Also, as SubViewModel value is changed - Binding should react and recalculate source value
Actual Behavior
NullReferenceException, as expression () => ViewModel.SubViewModel.Message is used to calculate source value
Basic Information
- Version with issue: doesn't seem like we tracking versions, really.. latest master
- Last known good version: none
- IDE: JetBrains Rider 2019.3.3
- Platform Target Frameworks:
- iOS: 11.0