public DevolucionItemViewModel() { this.PropertyChanged += DevolucionItemViewModel_PropertyChanged; if (!this.IsInDesignMode) { _data = CommonServiceLocator.ServiceLocator.Current.GetInstance <Common.ServiceContracts.IDataServiceAsync>(); this.Options = _data.GetRazonesDevolucion(); } if (this.IsInDesignMode) { this.Options = new Common.Entities.RazonNotaDevolucion[] { new Common.Entities.RazonNotaDevolucion { Id = 1, Descripcion = "op1", Comentarios = false }, new Common.Entities.RazonNotaDevolucion { Id = 2, Descripcion = "op2", Comentarios = false }, new Common.Entities.RazonNotaDevolucion { Id = 3, Descripcion = "op3", Comentarios = false }, }; this.SelectedOpcion = this.Options.First(); this.Item = new Common.Entities.ProductoDevolucion() { Id = 1, Sucursal = "suc", Folio = "folio", Serie = "serie", Marca = "marca", Modelo = "modelo", Talla = "talla", Corrida = "corrida", Precio = 799m, Pago = 500m }; this.Razon = "razon"; } }
public NotaViewModel() { if (!this.IsInDesignMode) { _data = CommonServiceLocator.ServiceLocator.Current.GetInstance <Common.ServiceContracts.IDataServiceAsync>(); this.Options = _data.GetRazonesDevolucion(); } this.RestoreCommand = new GalaSoft.MvvmLight.Command.RelayCommand(() => { this.Item.Precio = this.ProductoItem.PrecioOriginal; this.ProductoItem.NotaRazon = null; this.ProductoItem.Notas = null; GalaSoft.MvvmLight.Messaging.Messenger.Default.Send( new Utilities.Messages.ModalResponse { }, this.GID); }); this.PropertyChanged += NotaViewModel_PropertyChanged; if (this.IsInDesignMode) { this.Precio = 1799.89m; this.Razon = "se respeta precio de aparador"; this.Options = new Common.Entities.RazonNotaDevolucion[] { new Common.Entities.RazonNotaDevolucion { Id = 1, Descripcion = "op1", Comentarios = false }, new Common.Entities.RazonNotaDevolucion { Id = 2, Descripcion = "op2", Comentarios = false }, new Common.Entities.RazonNotaDevolucion { Id = 3, Descripcion = "op3", Comentarios = false }, }; this.SelectedOpcion = this.Options.First(); } }