Updating the UI components better.

This commit is contained in:
Tadas Baltrusaitis 2018-01-15 08:02:34 +00:00
parent b355b5b3ab
commit 65ee5009ad
2 changed files with 5 additions and 2 deletions

View File

@ -101,6 +101,7 @@ namespace OpenFaceOffline
foreach (var value in data)
{
BarGraph newBar = new BarGraph();
newBar.SetValue(value);
graphs.Add(newBar);
barGrid.ColumnDefinitions.Add(new ColumnDefinition());
Grid.SetColumn(newBar, graphs.Count);

View File

@ -131,18 +131,20 @@ namespace OpenFaceOffline
foreach (var label in data_labels)
{
BarGraphHorizontal newBar = new BarGraphHorizontal(label + " - " + mapping[label]);
newBar.SetValue(data[label]);
barGrid.RowDefinitions.Add(new RowDefinition());
Grid.SetRow(newBar, graphs.Count);
graphs.Add(label, newBar);
barGrid.Children.Add(newBar);
}
}
}
// Update the bars
foreach (var value in data)
{
graphs[value.Key].SetValue(value.Value);
}
}
}
}
}