title: How do I restore default values for a custom type in WPF MVVM?
body: <p>Can't figure out how do I restore default values for my property.
  I have a simple form with some TextBoxes that are bond to a property of custom type.
  And a button that use command to push collected data into database.
  Problem is that I can't restore default values after I click on button and set data into database.</p>
  <p>Here is my xaml</p>
     
  <pre><code>&lt;TextBox Grid.Row=&quot;0&quot; Grid.Column=&quot;2&quot; Text=&quot;{Binding ProdusulCreat.Denumire}&quot;/&gt;
  
  &lt;TextBlock Grid.Row=&quot;1&quot; Grid.Column=&quot;0&quot; Text=&quot;Calorii&quot; VerticalAlignment=&quot;Center&quot; HorizontalAlignment=&quot;Center&quot;/&gt;
  &lt;TextBox Grid.Row=&quot;1&quot; Grid.Column=&quot;1&quot; Text=&quot;{Binding ProdusulCreat.Calorii}&quot;/&gt;
  &lt;TextBlock Grid.Row=&quot;1&quot; Grid.Column=&quot;2&quot; Text=&quot;Proteine&quot; VerticalAlignment=&quot;Center&quot; HorizontalAlignment=&quot;Center&quot;/&gt;
  &lt;TextBox Grid.Row=&quot;1&quot; Grid.Column=&quot;3&quot; Text=&quot;{Binding ProdusulCreat.Proteine}&quot;/&gt;
  
  &lt;TextBlock Grid.Row=&quot;2&quot; Grid.Column=&quot;0&quot; Text=&quot;Sare&quot; VerticalAlignment=&quot;Center&quot; HorizontalAlignment=&quot;Center&quot;/&gt;
  &lt;TextBox Grid.Row=&quot;2&quot; Grid.Column=&quot;1&quot; Text=&quot;{Binding ProdusulCreat.Sare}&quot; VerticalAlignment=&quot;Center&quot;/&gt;
  &lt;TextBlock Grid.Row=&quot;2&quot; Grid.Column=&quot;2&quot; Text=&quot;Zahar&quot; VerticalAlignment=&quot;Center&quot; HorizontalAlignment=&quot;Center&quot;/&gt;
  &lt;TextBox Grid.Row=&quot;2&quot; Grid.Column=&quot;3&quot; Text=&quot;{Binding ProdusulCreat.Zahar}&quot; VerticalAlignment=&quot;Center&quot;/&gt;
  
  &lt;TextBlock Grid.Row=&quot;3&quot; Grid.Column=&quot;0&quot; Text=&quot;Fibre&quot; VerticalAlignment=&quot;Center&quot; HorizontalAlignment=&quot;Center&quot;/&gt;
  &lt;TextBox Grid.Row=&quot;3&quot; Grid.Column=&quot;1&quot; Text=&quot;{Binding ProdusulCreat.Fibre}&quot; VerticalAlignment=&quot;Center&quot;/&gt;
  &lt;TextBlock Grid.Row=&quot;3&quot; Grid.Column=&quot;2&quot; Text=&quot;Grasimi&quot; VerticalAlignment=&quot;Center&quot; HorizontalAlignment=&quot;Center&quot;/&gt;
  &lt;TextBox Grid.Row=&quot;3&quot; Grid.Column=&quot;3&quot; Text=&quot;{Binding ProdusulCreat.Grasimi}&quot; VerticalAlignment=&quot;Center&quot;/&gt;
  
  &lt;TextBlock Grid.Row=&quot;4&quot; Grid.Column=&quot;0&quot; Text=&quot;Colesterol&quot; VerticalAlignment=&quot;Center&quot; HorizontalAlignment=&quot;Center&quot;/&gt;
  &lt;TextBox Grid.Row=&quot;4&quot; Grid.Column=&quot;1&quot; Text=&quot;{Binding ProdusulCreat.Colesterol}&quot; VerticalAlignment=&quot;Center&quot;/&gt;
  &lt;TextBlock Grid.Row=&quot;4&quot; Grid.Column=&quot;2&quot; Text=&quot;Carbohidrati&quot; VerticalAlignment=&quot;Center&quot; HorizontalAlignment=&quot;Center&quot;/&gt;
  &lt;TextBox Grid.Row=&quot;4&quot; Grid.Column=&quot;3&quot;  Text=&quot;{Binding ProdusulCreat.Carbohidrati}&quot; VerticalAlignment=&quot;Center&quot;/&gt;
  
  &lt;Button Grid.Row=&quot;5&quot; Grid.Column=&quot;1&quot; Grid.ColumnSpan=&quot;2&quot; HorizontalAlignment=&quot;Center&quot; Content=&quot;Adauga produsul&quot; Command=&quot;{Binding AdaugaProdusulCommand}&quot;/&gt;
  </code></pre>
  <p>View model</p>
  <pre><code>#region Properties
  
  #region ProdusModel : ProdusModel - Ingredientul creat
  private ProdusModel _ProdusModel = new ProdusModel();
  
  public ProdusModel ProdusulCreat
  {
      get =&gt; _ProdusModel;
      set =&gt; Set(ref _ProdusModel, value);
  }
  #endregion
  
  #endregion
  
  /* ------------------------------------------------------------------------------------------------------------------------ */
  
  #region Commands
  public ICommand AdaugaProdusulCommand { get; }
  private bool CanAdaugaProdusulExecute(object ob) =&gt; !string.IsNullOrEmpty(ProdusulCreat.Denumire);
  private void OnAdaugaProdusulExecuted(object ob) =&gt; DataBase.AdaugaProdus(ProdusulCreat);
  #endregion
  public CreatorIngredienteViewModel()
  {
      AdaugaProdusulCommand = new RelayCommand(OnAdaugaProdusulExecuted, CanAdaugaProdusulExecute);
  }
  </code></pre>
  <p>And a part of Model</p>
  <pre><code>public class ProdusModel
  {
      public int ID { get; set; }
      public int IDSubCategorie { get; set; }
      public string Denumire { get; set; }
      public string UM { get; set; }
      public string Compozitie { get; set; }
      public double Sare { get; set; }
      public double Zahar { get; set; }
      public double Fibre { get; set; }
      public double Grasimi { get; set; }
      public double Proteine { get; set; }
      public double Colesterol { get; set; }
      public double Carbohidrati { get; set; }
      public double Calorii { get; set; }
      public int Prioritate { get; set; }
  }
  </code></pre>