/// <summary>
        /// Main page constructor
        /// </summary>
        public MainPage()
        {
            this.InitializeComponent();
            this.NavigationCacheMode = NavigationCacheMode.Required;
            Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;

            // Update ScrollViewer sizew
            this.ScrollViewer.Height = Window.Current.Bounds.Height;

            ctdHelper = new ConnectTheDotsHelper(sensorList: this.sensors);

            // Get app settings
            if (!ctdHelper.localSettings.SettingsSet)
            {
                this.SetAppSettings();
            }
            else
            {
                // Setup sensor objects
                ctdHelper.ApplySettingsToSensors();

                // Initialize Event Hub connection
                if (!ctdHelper.InitEventHubConnection())
                {
                    this.SetAppSettings();
                }
            }

            // Init sensors
            this.InitSensors();

            // Start 1 second timer for sending simulated temp and humidity data every second
            timer          = new DispatcherTimer();
            timer.Tick    += Timer_tick;
            timer.Interval = TimeSpan.FromMilliseconds(SimulatedDataTick);
            timer.Start();
        }
        /// <summary>
        /// Main page constructor
        /// </summary>
        public MainPage()
        {
            this.InitializeComponent();
            this.NavigationCacheMode = NavigationCacheMode.Required;
            Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
            
            // Update ScrollViewer sizew
            this.ScrollViewer.Height = Window.Current.Bounds.Height;

            ctdHelper = new ConnectTheDotsHelper(sensorList: this.sensors);

            // Get app settings
            if (!ctdHelper.localSettings.SettingsSet)
            {
                this.SetAppSettings();
            }
            else
            {
                // Setup sensor objects
                ctdHelper.ApplySettingsToSensors();

                // Initialize Event Hub connection
                if (!ctdHelper.InitEventHubConnection()) this.SetAppSettings();
            }

            // Init sensors
            this.InitSensors();
            
            // Start 1 second timer for sending simulated temp and humidity data every second
            timer = new DispatcherTimer();
            timer.Tick += Timer_tick;
            timer.Interval = TimeSpan.FromMilliseconds(SimulatedDataTick);
            timer.Start();
        }
        /// <summary>
        /// Main page constructor
        /// </summary>
        public MainPage()
        {
            this.InitializeComponent();
            this.NavigationCacheMode = NavigationCacheMode.Required;
            Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
            
            // Update ScrollViewer sizew
            this.ScrollViewer.Height = Window.Current.Bounds.Height;

            ctdHelper = new ConnectTheDotsHelper(serviceBusNamespace: "smarthomecloud2-ns",
                    eventHubName: "ehdevices",
                    keyName: "D1",
                    key: "hmc/OlZBDYll46ZgfXAxzTZ+oj1gmXSJaqVydFBq9Bo=",
                    displayName: "RPI",
                    organization: "FH Hagenberg",
                    location: "Hagenberg",
                    sensorList: sensors);

            // Get app settings
            if (!ctdHelper.localSettings.SettingsSet)
            {
                this.SetAppSettings();
            }
            else
            {
                // Setup sensor objects
                ctdHelper.ApplySettingsToSensors();

                // Initialize Event Hub connection
                if (!ctdHelper.InitEventHubConnection()) this.SetAppSettings();
            }

            // Init sensors
            this.InitSensors();
            
            // Start 1 second timer for sending simulated temp and humidity data every second
            timer = new DispatcherTimer();
            timer.Tick += Timer_tick;
            timer.Interval = TimeSpan.FromMilliseconds(SimulatedDataTick);
            timer.Start();
        }