59 lines
2.6 KiB
C#
59 lines
2.6 KiB
C#
//-----------------------------------------------------------------------
|
|
// <copyright file="AppSettingPage.xaml.cs" company="BTU/IIT">
|
|
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
|
// </copyright>
|
|
// <author>Stubbfel</author>
|
|
// <date>15.10.2013</date>
|
|
// <summary>Implements the application setting page.xaml class</summary>
|
|
//-----------------------------------------------------------------------
|
|
namespace CampusAppWP8.Pages.Setting
|
|
{
|
|
using System;
|
|
using System.Windows.Navigation;
|
|
using CampusApp8.Model.Setting;
|
|
using Microsoft.Phone.Controls;
|
|
|
|
/// <summary> Class for the AppSettingPage. </summary>
|
|
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
|
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
|
|
public partial class AppSettingPage : PhoneApplicationPage
|
|
{
|
|
#region Member
|
|
/// <summary> The TagHandler model. </summary>
|
|
private TagHandlerListPickerItemListModel taghandlerModel;
|
|
#endregion
|
|
#region Constructor
|
|
|
|
/// <summary> Initializes a new instance of the <see cref="AppSettingPage" /> class. </summary>
|
|
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
|
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>
|
|
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
|
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedFrom(NavigationEventArgs)"/>
|
|
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
|
|
}
|
|
} |