private void UpdateModelFromProperties()
{
//get live property values from model
var props = _model.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public)
.ToList();
//iterate through live values and update them on the local model with the changed Properties values
props.ForEach(prop =>
{
var propEssentialValue = Properties.SingleOrDefault(pe => pe.Name.Equals(prop.Name));
if (propEssentialValue != null && prop.CanWrite)
{
var convertedValue = Convert.ChangeType(propEssentialValue.Value, prop.PropertyType);
prop.SetValue(_model, convertedValue);
}
});
}