Updating the UI components better.
This commit is contained in:
parent
b355b5b3ab
commit
65ee5009ad
2 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue