From 65ee5009ad1896715b791d47bbb9c4e8b857d944 Mon Sep 17 00:00:00 2001 From: Tadas Baltrusaitis Date: Mon, 15 Jan 2018 08:02:34 +0000 Subject: [PATCH] Updating the UI components better. --- gui/OpenFaceOffline/UI_items/MultiBarGraph.xaml.cs | 1 + gui/OpenFaceOffline/UI_items/MultiBarGraphHorz.xaml.cs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gui/OpenFaceOffline/UI_items/MultiBarGraph.xaml.cs b/gui/OpenFaceOffline/UI_items/MultiBarGraph.xaml.cs index 9a25a6d..5e4b0c6 100644 --- a/gui/OpenFaceOffline/UI_items/MultiBarGraph.xaml.cs +++ b/gui/OpenFaceOffline/UI_items/MultiBarGraph.xaml.cs @@ -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); diff --git a/gui/OpenFaceOffline/UI_items/MultiBarGraphHorz.xaml.cs b/gui/OpenFaceOffline/UI_items/MultiBarGraphHorz.xaml.cs index c0bf035..0ba76fc 100644 --- a/gui/OpenFaceOffline/UI_items/MultiBarGraphHorz.xaml.cs +++ b/gui/OpenFaceOffline/UI_items/MultiBarGraphHorz.xaml.cs @@ -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); - } + } } } }