private void Page_Loaded(object sender, RoutedEventArgs e) { if (IsFirstTime) { LoadConSettings(); } service_cs = AzureConnections.MyConnections.IoTHubConnectionString; device_id = AzureConnections.MyConnections.DeviceId; device_cs = AzureConnections.MyConnections.DeviceConnectionString; if (IsFirstTime) { AppBarButton_Click(BtnFeatureMode, null); AppBarButton_Click(BtnFeatureMode2, null); ListviewTransports2.ItemsSource = ListEnum; ListviewTransports2.SelectedItem = AzIoTHubDeviceStreams.DeviceStreamingCommon.device_transportType; ListviewTransports2.ScrollIntoView(ListviewTransports2.SelectedItem); AzureConnections.MyConnections.OnStatusUpdateD = OnDeviceSvcUpdate; LstDeviceAction.ItemsSource = ListEnum2; LstDeviceAction.SelectedItem = ListEnum2[1]; LstDeviceAction.ScrollIntoView(ListEnum2[1]); if (autoStartDevice) { Button_Click_Device(null, null); } } IsFirstTime = false; }
private void Page_Loaded(object sender, RoutedEventArgs e) { mainPage = this; if (IsFirstTime) { LoadConSettings(); } service_cs = Azure_IoTHub_Connections.MyConnections.IoTHubConnectionString; device_id = Azure_IoTHub_Connections.MyConnections.DeviceId; device_cs = Azure_IoTHub_Connections.MyConnections.DeviceConnectionString; if (IsFirstTime) { AppBarButton_Click(BtnFeatureMode, null); AppBarButton_Click(BtnFeatureMode2, null); ListviewTransports2.ItemsSource = ListEnum; ListviewTransports2.SelectedItem = Azure_IoTHub_DeviceStreaming.DeviceStreamingCommon.device_transportType; ListviewTransports2.ScrollIntoView(ListviewTransports2.SelectedItem); Azure_IoTHub_Connections.MyConnections.OnStatusUpdateD = OnSvcStatusUpdate; LstDeviceAction.ItemsSource = ListEnum2; LstDeviceAction.SelectedItem = ListEnum2[1]; LstDeviceAction.ScrollIntoView(ListEnum2[1]); if (Azure_IoTHub_Toolbox_App.AppSettingsValues.Settings.AutoStartDevice) { Button_Click_Device(null, null); } if (Azure_IoTHub_Toolbox_App.AppSettingsValues.Settings.AutoStartSvc) { Button_Click_Svc(null, null); } IsFirstTime = false; //tbTelemetryDelay.DataContext = Azure_IoTHub_Connections.MyConnections.TelemetryDelayBtwReadings; this.DataContext = Azure_IoTHub_Toolbox_App.AppSettingsValues.Settings; } }