public MainPage()
{
this.InitializeComponent();
// Restore local settings
if (localSettings.Values.ContainsKey("DeviceId"))
{
deviceId = (string)localSettings.Values["DeviceId"];
this.TBDeviceID.Text = deviceId;
}
if (localSettings.Values.ContainsKey("HostName"))
{
hostName = (string)localSettings.Values["HostName"];
this.TBHostName.Text = hostName;
}
if (localSettings.Values.ContainsKey("DeviceKey"))
{
deviceKey = (string)localSettings.Values["DeviceKey"];
this.TBDeviceKey.Text = deviceKey;
}
ConnectToggle.IsEnabled = checkConfig();
deviceId = this.TBDeviceID.Text;
hostName = this.TBHostName.Text;
deviceKey = this.TBDeviceKey.Text;
Task.Run(SendDataToAzure);
}
private bool checkConfig()