using System.Windows;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;

namespace ConnectionSettingsTaskSample
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Initialisierung des ConnectionSettingsTask
        private ConnectionSettingsTask myConnectionSettingsTask = new ConnectionSettingsTask();

        // Hauptkonstruktor
        public MainPage()
        {
            InitializeComponent();
        }
        
        // Klickereignismethode für Bluetooth-Schaltflaeche
        private void btn_Bluetooth_Click(object sender, RoutedEventArgs e)
        {
            myConnectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.Bluetooth;
            myConnectionSettingsTask.Show();
        }

        // Klickereignismethode für Mobilfunk-Schaltflaeche
        private void btn_Cellular_Click(object sender, RoutedEventArgs e)
        {
            myConnectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.Cellular;
            myConnectionSettingsTask.Show();
        }

        // Klickereignismethode für Flugmodus-Schaltflaeche
        private void btn_Airplane_Click(object sender, RoutedEventArgs e)
        {
            myConnectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.AirplaneMode;
            myConnectionSettingsTask.Show();
        }

        // Klickereignismethode für WLAN-Schaltflaeche
        private void btn_WiFi_Click(object sender, RoutedEventArgs e)
        {
            myConnectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.WiFi;
            myConnectionSettingsTask.Show();
        }      
    }
}