示例#1
0
        public void RefreshData()
        {
            AutoService service = new AutoService();

            cars = new ObservableCollection <AutoEntity>(service.GetAllCars());
            this.lvAuto.ItemsSource = cars;
        }
示例#2
0
        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);
        }