public void RefreshData() { AutoService service = new AutoService(); cars = new ObservableCollection <AutoEntity>(service.GetAllCars()); this.lvAuto.ItemsSource = cars; }
private bool CheckDoppione() { string carName = (this.DataContext as AutoEntity).CarName.ToLower(); AutoService service = new AutoService(); List <AutoEntity> cars = service.GetAllCars(); if (cars.Any(x => x.CarName.ToLower().Equals(carName))) { return(true); } return(false); }