나는 데이터베이스와 모든 코딩을 만들었습니다. 그러나 정보는 이제 전화로 나타납니다. 어떻게 표시 할 수 있습니까? 세부 정보를 표시하지 못했습니다. 그것은 "this.listBox.ItemsSource = CarScores;"라는 코드에서이 줄로 갈 수 없다는 것을 보여줍니다.정보가 나타나지 않습니다
//Main Page Coding .xaml.CS
namespace carDatabaseCreater
{
public partial class MainPage : PhoneApplicationPage
{
public static List<Car> CarScoresList = new List<Car>();
Uri uri;
Grid CarGrid;
CarHisrotyRepository CarHisrotyRepository;
ObservableCollection<Car> CarScores;
// Constructor
public MainPage()
{
InitializeComponent();
this.DisplayCarHistory();
this.UpdateCarScoresFromDB();
}
public void SaveCarToCarHistory(Car _Car)
{
CarHisrotyRepository _CarHisrotyRepository = new CarHisrotyRepository();
Car item0 = new Car() { CarName = "Arion", CarSupplierName = "Bahowan", CarImage = "Image/BMW.jpg", CarCompanyName = "Toyota" };
Car item1 = new Car() { CarName = "Arion", CarSupplierName = "Bahowan", CarImage = "Image/BMW.jpg", CarCompanyName = "Toyota" };
Car item2 = new Car() { CarName = "Arion", CarSupplierName = "Bahowan", CarImage = "Image/BMW.jpg", CarCompanyName = "Toyota" };
Car item3 = new Car() { CarName = "Arion", CarSupplierName = "Bahowan", CarImage = "Image/BMW.jpg", CarCompanyName = "Toyota" };
Car item4 = new Car() { CarName = "Arion", CarSupplierName = "Bahowan", CarImage = "Image/BMW.jpg", CarCompanyName = "Toyota" };
CarScoresList.Add(item0);
_CarHisrotyRepository.Save(item0);
CarScoresList.Add(item1);
_CarHisrotyRepository.Save(item1);
CarScoresList.Add(item2);
_CarHisrotyRepository.Save(item2);
CarScoresList.Add(item3);
_CarHisrotyRepository.Save(item3);
CarScoresList.Add(item4);
_CarHisrotyRepository.Save(item4);
}
private void UpdateCarScoresFromDB()
{
CarHisrotyRepository CarHisrotyRepository = new carDatabaseCreater.CarHisrotyRepository();
List<Car> AllGames = CarHisrotyRepository.allQuery(CarHisrotyRepository.CarContext).ToList();
}
public void DisplayCarHistory()
{
this.CarHisrotyRepository = new CarHisrotyRepository();
// Get Game History from IsoStore
List<Car> CarHistory = this.CarHisrotyRepository.Load();
// Display to Screen
CarScores = new ObservableCollection<Car>(CarHistory);
this.listBox.ItemsSource = CarScores;// the Error appears here
}
}
}
여기에 너무 많은 코드가 있습니다. 해당 코드를 포함하는 짧고 완벽한 프로그램으로 잘라내십시오 - 실제 앱의 축소 버전, 즉 문제를 여전히 보여줍니다. –
나는 지금 게시 할 것입니다 –
오류에서 스냅 사진을 게시 할 수 없습니다 –