public TestDriveCarViewModel(DateTime dt, CarListBaseDataModel model, int id, bool changed) { Update(model, id); CurrentCar = model; _dateWork = dt; IsChange = changed; }
private void Update(CarListBaseDataModel model, int id) { ID = id; CarNumber = model.DID; Name = model.CarNumber; StartWorkTime = 8; EndWorkTime = 18; }
public CarViewModel(CarListBaseDataModel model, int errors) { CarNumber = model.CarNumber; Mark = model.Mark; Model = model.Model; CurrentDistance = model.CurrentDistance; IncomeDistance = model.IncomeDistance; ServiceName = model.ServiceName; DaysToService = model.DaysToService; ErrorsCount = errors; if (errors > 0) { VisErrors = Visibility.Visible; } else { VisErrors = Visibility.Collapsed; } }
private async Task UpdateAsync() { var res = await TcpConnection.Send("BA"); if (res.Px != 'B' || res.Fx != 'A') { return; } Cars.Clear(); try { foreach (var el in JsonConvert.DeserializeObject <List <CarListBaseDataModel> >(res.Msg)) { Cars.Add(el); } if (SelectedCar == null) { SelectedCar = Cars.FirstOrDefault(); } } catch (Exception e) { } }
public CarViewModel(CarListBaseDataModel model) { _model = model; }
public TestDriveCarViewModel(CarListBaseDataModel model, int id) { Update(model, id); CurrentCar = model; }