59 lines
2.3 KiB
C#
59 lines
2.3 KiB
C#
//-----------------------------------------------------------------------
|
|
// <copyright file="AppSettingPage.xaml.cs" company="BTU/IIT">
|
|
// Company copyright tag.
|
|
// </copyright>
|
|
// <author>stubbfel</author>
|
|
// <sience>12.08.2013</sience>
|
|
//----------------------------------------------------------------------
|
|
namespace CampusAppWP8.Pages.Setting
|
|
{
|
|
using System.Windows.Navigation;
|
|
using Microsoft.Phone.Controls;
|
|
using CampusApp8.Model.Setting;
|
|
using System;
|
|
|
|
/// <summary>
|
|
/// Class for the AppSettingPage
|
|
/// </summary>
|
|
public partial class AppSettingPage : PhoneApplicationPage
|
|
{
|
|
#region Member
|
|
private TagHandlerListPickerItemListModel taghandlerModel;
|
|
#endregion
|
|
#region Constructor
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="AppSettingPage" /> class.
|
|
/// </summary>
|
|
public AppSettingPage()
|
|
{
|
|
this.InitializeComponent();
|
|
this.GeoWatchToggle.IsChecked = Settings.AppSetting.GeoWatchEnable;
|
|
this.OnlyWiFiToggle.IsChecked = Settings.AppSetting.OnlyWifi;
|
|
this.taghandlerModel = new TagHandlerListPickerItemListModel();
|
|
this.TagHandler.ItemsSource = this.taghandlerModel.List;
|
|
int tagselIndex = this.taghandlerModel.GetIndexOrDefault(Settings.AppSetting.TagDefaultHandler.ToString());
|
|
this.TagHandler.SelectedIndex = tagselIndex;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Method
|
|
|
|
/// <summary>
|
|
/// Override the OnNavigatedFrom method
|
|
/// </summary>
|
|
/// <param name="e">Arguments of navigation</param>
|
|
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
|
{
|
|
if (NavigationMode.Back == e.NavigationMode)
|
|
{
|
|
Settings.AppSetting.GeoWatchEnable = GeoWatchToggle.IsChecked.Value;
|
|
Settings.AppSetting.OnlyWifi = OnlyWiFiToggle.IsChecked.Value;
|
|
Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |