コード例 #1
0
        private async void SaveRaceButton_Click(object sender, RoutedEventArgs e)
        {
            Race   race   = (Race)this.DefaultViewModel["Race"];
            string raceId = race.Id.ToString();
            string response;

            if (this.pageMode == HelperClass.PageMode.Add)
            {
                response = await SampleDataSource.AddRace(race);

                raceId = response;
            }
            else
            {
                response = await SampleDataSource.UpdateRace(race);
            }

            MessageDialog msgbox = new MessageDialog("Chequered flag! Race saved!");
            await msgbox.ShowAsync();

            Frame.Navigate(typeof(ViewRacePage), raceId);
        }