public CloudToDeviceViewModel(
     IOptions <ConnectionStrings> connectionStrings,
     FilteredDeviceListViewModel filteredDeviceListViewModel)
 {
     _filteredDeviceListViewModel = filteredDeviceListViewModel;
     _jobClient     = JobClient.CreateFromConnectionString(connectionStrings.Value.IoTHub);
     ExecuteCommand = new RelayCommand(async() => await ExecuteCommandAsync());
 }
Esempio n. 2
0
        public BulkUpdateViewModel(
            IOptions <ConnectionStrings> connectionStrings,
            FilteredDeviceListViewModel filteredDeviceListViewModel)
        {
            _registryManager = RegistryManager.CreateFromConnectionString(connectionStrings.Value.IoTHub);

            _overheatThreshold           = "60";
            OverheatThresholdCommand     = new RelayCommand(async() => await UpdateThresholdAsync());
            _filteredDeviceListViewModel = filteredDeviceListViewModel;
        }
 public MainWindowViewModel(
     QueryInputViewModel queryInputViewModel,
     FilteredDeviceListViewModel filteredDeviceListViewModel,
     BulkUpdateViewModel bulkUpdateViewModel,
     ScheduleJobsViewModel scheduleJobsViewModel,
     CloudToDeviceViewModel cloudToDeviceViewModel)
 {
     QueryInputViewModel                     = queryInputViewModel;
     FilteredDeviceListViewModel             = filteredDeviceListViewModel;
     BulkUpdateViewModel                     = bulkUpdateViewModel;
     ScheduleJobsViewModel                   = scheduleJobsViewModel;
     CloudToDeviceViewModel                  = cloudToDeviceViewModel;
     queryInputViewModel.QueryResultUpdated += OnQueryUpdated;
     // initial query
     queryInputViewModel.ExecuteDeviceQueryCommand.Execute(null);
     queryInputViewModel.QueryError += OnQueryError;
 }
Esempio n. 4
0
 public ScheduleJobsViewModel(
     IOptions <ConnectionStrings> connectionStrings,
     FilteredDeviceListViewModel filteredDeviceListViewModel)
 {
     _filteredDeviceListViewModel = filteredDeviceListViewModel;
     _jobClient     = JobClient.CreateFromConnectionString(connectionStrings.Value.IoTHub);
     _targetVersion = "1.1";
     _updateTimes   = new ObservableCollection <string>(new[]
     {
         "immediately",
         "5 seconds from now",
         "10 seconds from now",
         "30 seconds from now",
         "1 minute from now"
     });
     _selectedUpdateTime   = _updateTimes[1];
     UpdateFirmwareCommand = new RelayCommand(async() => await UpdateFirmwareAsync());
     _timer = new Timer(OnTick, null, Timeout.Infinite, 1000);
 }