/// <summary> /// The methods provided in this section are simply used to allow /// NavigationHelper to respond to the page's navigation methods. /// <para> /// Page specific logic should be placed in event handlers for the /// <see cref="NavigationHelper.LoadState"/> /// and <see cref="NavigationHelper.SaveState"/>. /// The navigation parameter is available in the LoadState method /// in addition to page state preserved during an earlier session. /// </para> /// </summary> /// <param name="e">Provides data for navigation methods and event /// handlers that cannot cancel the navigation request.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { this.navigationHelper.OnNavigatedTo(e); // set time table data Satardaylist string[] days = { "Saturday","Sunday","Monday","Tuesday","Wednesday","Thursday"}; string[] priods = { "First", "Second", "Third", "Forth", "Fifth", "Sixth" }; var saveTimeTable = new SaveTimeTable(); ////test places //saveTimeTable.deletePriodData("Saturday", "First"); //saveTimeTable.deletePriodData("Saturday", "Second"); //saveTimeTable.deletePriodData("Sunday", "First"); //saveTimeTable.deletePriodData("Monday", "First"); //saveTimeTable.SaveValues("Saturday", "Second", "probability", "l5"); //saveTimeTable.SaveValues("Sunday", "First", "modern", "l4"); //saveTimeTable.SaveValues("Monday", "First", "programming", "l4"); //saveTimeTable.SaveValues("Monday", "Second", "circuts", "l4"); foreach (var day in days) { foreach (var priod in priods) { var tableData = saveTimeTable.GetPriodData(day,priod); if (tableData != null) { var period = new period(); period.Description = saveTimeTable.description(tableData); period.Place = saveTimeTable.place(tableData); period.Day = day; period.Priod = priod; priodsData.Add(period); } } } // set list view source to priodsdata Satardaylist.ItemsSource = priodsData.Where(m => m.Day == days[0]).ToList(); Sundaylist.ItemsSource = priodsData.Where(m => m.Day == days[1]).ToList(); Mondaylist.ItemsSource = priodsData.Where(m => m.Day == days[2]).ToList(); Tuesdaylist.ItemsSource = priodsData.Where(m => m.Day == days[3]).ToList(); Wednesdaylist.ItemsSource = priodsData.Where(m => m.Day == days[4]).ToList(); Thursdaylist.ItemsSource = priodsData.Where(m => m.Day == days[5]).ToList(); }
private void NextButton_Click(object sender, RoutedEventArgs e) { PeriodCounter++; if (PeriodCounter > Periods.Length) { PeriodCounter = 0; DayCounter++; } var SaveTimeTable = new SaveTimeTable(); SaveTimeTable.SaveValues(DayLabel.Text, PeriodLabel.Text, DescriptionFeild.Text, PlaceFeild.Text); DayLabel.Text = Days[DayCounter]; PeriodLabel.Text = Periods[PeriodCounter]; PlaceFeild.Text = ""; DescriptionFeild.Text = ""; }