My problem is as follows:
I am working with MVVM pattern and I would like to know how to detect changes of subproperties.
I have a textbox:
<TextBox Name="Descripcion" Text="{Binding AccionActual.Descripcion,Mode=TwoWay}" />
In the ViewModel I have the property:
Accion _accionActual;
public Accion AccionActual
{
get { return _accionActual; }
set
{
_accionActual = value;
RaisePropertyChanged("AccionActual");
}
}
The Accion entity definition is:
public partial class Accion : Entity
{
public Accion()
{
this.AccionesDocumentos = new HashSet<AccionDocumento>();
}
public int IdAccion { get; set; }
public int IdEmpleado { get; set; }
public string Descripcion { get; set; }
public string DescripcionDetalle { get; set; }
public bool Finalizada { get; set; }
public Nullable<int> IdExpediente { get; set; }
public Nullable<int> IdOrdenTrabajo { get; set; }
public bool Facturable { get; set; }
public Nullable<short> GestComAlbaranAño { get; set; }
public Nullable<short> GestComAlbaranEmpresa { get; set; }
public Nullable<int> GestComAlbaranNumero { get; set; }
public bool Facturado { get; set; }
public bool ComputarHorasACliente { get; set; }
public string DescripcionInterna { get; set; }
public virtual Aplicacion Aplicacione { get; set; }
public virtual AplicacionModulo AplicacionesModulo { get; set; }
public virtual Cliente Cliente { get; set; }
public virtual ClienteContacto ClientesContacto { get; set; }
public virtual Empleado Empleado { get; set; }
public virtual Expediente Expediente { get; set; }
public virtual OrdenTrabajo OrdenesTrabajo { get; set; }
public virtual ICollection<AccionDocumento> AccionesDocumentos { get; set; }
}
I could create in the ViewModel a property for each of the properties of Accion, but there any way to receive the changes without having to create a property for each of the properties of Accion?