title: Equivalent of data binding model updates in Elm-style model-view-update
body: <p><strong>MVU State Changes</strong></p>
  
  <p>As I understand Elm-style model-view-update architectures, changes to application state follow the sending of a message that defines the updated state.  The state here is immutable, so changes result in a whole new set of application state. </p>
  
  <p>For example, in the below (taken from the <a href="https://fsprojects.github.io/Fabulous/" rel="nofollow noreferrer">Fabulous</a> project) the <code>Pressed</code> message results in the state changing <code>Model.Pressed</code> to be <code>true</code>.</p>
  
  <p>I believe the message would be sent as a result of the user taking an explicit action, such as clicking submit or save.</p>
  
  <pre><code>/// The messages dispatched by the view
  type Msg =
      | Pressed
  
  /// The model from which the view is generated
  type Model =
      { Pressed: bool }
  
  /// Returns the initial state
  let init() = { Pressed = false }
  
  /// The function to update the view
  let update (msg: Msg) (model: Model) =
      match msg with
      | Pressed -&gt; { model with Pressed = true }
  
  /// The view function giving updated content for the page
  let view (model: Model) dispatch =
      if model.Pressed then
          View.Label(text="I was pressed!")
      else
          View.Button(text="Press Me!", command=(fun () -&gt; dispatch Pressed))
  
  type App () as app =
      inherit Application ()
  
      let runner =
          Program.mkSimple init update view
          |&gt; Program.withConsoleTrace
          |&gt; Program.runWithDynamicView app
  </code></pre>
  
  <p><strong>Data Binding State Changes</strong></p>
  
  <p>Let's say you have a model in WPF, perhaps, that implements <code>INotifyPropertyChanged</code> and uses data binding to attach your state to a user interface.  So, the state here is mutable and will change over time.</p>
  
  <p>As the user enters new values, the model is updated as a result of the data binding and without them explicitly saving or submitting.  Because of this, any calculated values in the model will update as the user enters values.  Here's an example of a model that updates an <code>Age</code> value when a new date of birth is entered.</p>
  
  <pre><code>public class PersonView: INotifyPropertyChanged
  {
      private DateTime _birthday;
      public DateTime Birthday
      {
          get { return _birthday; }
          set
          {
              _birthday = value;
              PropertyChanged("Birthday");
              Age = CalculateAgeFromBirthday();
          }
      }
  
      private int _age;
      public int Age
      {
          get { return _age; }
          private set
          {
              _age = value;
              PropertyChanged("Age");
          }
      }
  
      void PropertyChanged(string property)
      {
          // Etc.
      }
  
      int CalculateAgeFromBirthday()
      {
          // Do you sums here;
      }
  }
  </code></pre>
  
  <p><strong>The Question</strong></p>
  
  <p>My question is whether there is an equivalent way in Elm style model-view-update architectures to create a user interface that updates these "calculated properties" as the user enters values in a similar manner to how a data bound view with a mutable model?</p>