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) foreach (var value in data)
{ {
BarGraph newBar = new BarGraph(); BarGraph newBar = new BarGraph();
newBar.SetValue(value);
graphs.Add(newBar); graphs.Add(newBar);
barGrid.ColumnDefinitions.Add(new ColumnDefinition()); barGrid.ColumnDefinitions.Add(new ColumnDefinition());
Grid.SetColumn(newBar, graphs.Count); Grid.SetColumn(newBar, graphs.Count);

View file

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