SettingsPage.xaml.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Diagnostics;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Runtime.InteropServices.WindowsRuntime;
  8. using Breda_Tour;
  9. using Breda_Tour.HelpScreen;
  10. using Breda_Tour.Data;
  11. using Windows.Foundation;
  12. using Windows.Foundation.Collections;
  13. using Windows.UI.Xaml;
  14. using Windows.UI.Xaml.Controls;
  15. using Windows.UI.Xaml.Controls.Primitives;
  16. using Windows.UI.Xaml.Data;
  17. using Windows.UI.Xaml.Input;
  18. using Windows.UI.Xaml.Media;
  19. using Windows.UI.Xaml.Navigation;
  20. using Windows.Globalization;
  21. // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
  22. namespace Breda_Tours.SettingsScreen
  23. {
  24. /// <summary>
  25. /// An empty page that can be used on its own or navigated to within a Frame.
  26. /// </summary>
  27. public sealed partial class SettingsPage : Page
  28. {
  29. public ObservableCollection<HelpItem> HelpItems
  30. {
  31. get { return (ObservableCollection<HelpItem>)GetValue(HelpItemProperty); }
  32. set { SetValue(HelpItemProperty, value); }
  33. }
  34. public static readonly DependencyProperty HelpItemProperty =
  35. DependencyProperty.Register("HelpItems", typeof(ObservableCollection<HelpItem>), typeof(SettingsPage), null);
  36. public SettingsPage()
  37. {
  38. this.InitializeComponent();
  39. DefaultPivot.SetCheckedButton(Breda_Tour.CustomControls.DefaultPivotControl.Tab.Settings);
  40. HelpPageDatabase helpDatabase = new HelpPageDatabase();
  41. HelpItems = helpDatabase.GetCurrentHelpItems();
  42. DataContext = this;
  43. }
  44. private void ListView_ItemClick(object sender, ItemClickEventArgs e)
  45. {
  46. HelpItem helpitem = (HelpItem)e.ClickedItem;
  47. MainPage.RootFrame.Navigate(typeof(HelpPage), helpitem);
  48. }
  49. private void listViewItemSetupLanguage_Tapped(object sender, TappedRoutedEventArgs e)
  50. {
  51. if (App.Language == App.Languages[0])
  52. {
  53. App.Language = App.Languages[1];
  54. Frame.Navigate(typeof(MainPage));
  55. }
  56. else
  57. {
  58. App.Language = App.Languages[0];
  59. Frame.Navigate(typeof(MainPage));
  60. }
  61. }
  62. }
  63. }