Skip to content

Documentation

Roman Vladimirov edited this page Feb 22, 2021 · 10 revisions

Welcome to documentation about Nerv library

ReactiveProperty

ReactiveProperty aims to simplify work with XAML properties.

Concept

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:

  1. From application code (usually ViewModel). It means we change the value as Prop.SetValue(newValue). It executing in our code.
  2. 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.

ReactiveContext

Commands

Clone this wiki locally