-
Notifications
You must be signed in to change notification settings - Fork 0
Documentation
Roman Vladimirov edited this page Feb 22, 2021
·
10 revisions
ReactiveProperty aims to simplify work with XAML properties.
ReactiveProperty single class for manage reactive property. Usually you code look at (it pseudocode):
public Property {
get {
return m_Value;
}
set {
SetAndRaiseProperty(m_Value, value);
}
}
Issue there what get method is symmetric, means that if user input or our code call get it will be same, but set method not.
User input call Set method after changes in UI (and in common case don't need to raise property) but our code call Set method before it and require raise property for UI that it also figure out changes have a place.
What because ReactiveProperty has two different behavior for two that cases:
- From application code (usually ViewModel). It means we change the value as Prop.SetValue(newValue). It executing in our code.
- From user input (or from Xaml Framework). It means user input change the value as Prop.Value = newValue. In the common case, this executing not in our code.