Exemple #1
0
 public MainWindow(RaceInfo raceInfo)
 {
     mRaceInfo = raceInfo;
     Title = raceInfo.Name;
     mAccess = new DataAccess();
     mAccess.Open();
     InitializeComponent();
     FillDataGrid();
     Closed += OnClosed;
 }
 private void CanOpenExec(object sender, CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = mSelected.Count == 1;
     if (e.CanExecute)
     {
         object Item = mSelected.First();
         mRace = new RaceInfo();
         mRace.Name = (Item as DataRowView).Row.ItemArray[0].ToString();
         mRace.Laps = (Item as DataRowView).Row.ItemArray[1].ToString();
         mRace.Type = (Item as DataRowView).Row.ItemArray[2].ToString();
         mRace.Id = mAccess.GetRaceId(mRace.Name);
     }
     else
     {
         mRace = null;
     }
 }