private void addCarRefuel() { NewCarRefuelWindow window = new NewCarRefuelWindow(); window.Owner = Application.Current.MainWindow; CarRefuel refuel = new CarRefuel(); refuel.Date = DateTime.Today; CarRefuelViewModel refuelVM = new CarRefuelViewModel(refuel); window.DataContext = refuelVM; if ((bool)window.ShowDialog()) { Car.RefuelList.Add(refuel); DataManager.Instance.SaveCars(); RaisePropertyChanged(() => CarRefuelViewModels); RaisePropertyChanged(() => GraphModel); } }
public CarRefuelViewModel(CarRefuel refuel) { CarRefuel = refuel; }