Skip to content

Commit

Permalink
Fixed UI crash when sensor is deployed to sensorhost
Browse files Browse the repository at this point in the history
  • Loading branch information
tylercamp committed Oct 31, 2014
1 parent 059780b commit e399b74
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,17 @@ private void InstallSensorCompleted(Guid sensorID)
{
IEnumerable<GridViewRow> sensorRows = SensorHostsGridView.ChildrenOfType<GridViewRow>()
.Where(s => s.Item is HumanReadableSensor);
Button loadButton = sensorRows.Where(s => (s.Item as HumanReadableSensor).ID == sensorID)

SensorHostsGridView.Dispatcher.BeginInvoke(new Action(() => {
Button loadButton = sensorRows.Where(s => (s.Item as HumanReadableSensor).ID == sensorID)
.First()
.ChildrenOfType<Button>()
.Where(s => s.Name == "LoadButton")
.SingleOrDefault();

loadButton.IsEnabled = true;
loadButton.Content = "Load";
loadButton.IsEnabled = true;
loadButton.Content = "Load";
}));
}

private void LoadSensor_Click(object sender, RoutedEventArgs e)
Expand Down

0 comments on commit e399b74

Please sign in to comment.