Created
November 19, 2016 14:42
-
-
Save backsy/94fa0e5ff7882e6479b236fccf0d4111 to your computer and use it in GitHub Desktop.
Bindings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MainWindow.xaml | |
<wpf:LineSeries x:Name="LineSeries" PointGeometrySize="18" StrokeThickness="4" /> | |
MainWindow.xaml.cs | |
this.OneWayBind(ViewModel, vm => vm.ChartValues, v => v.LineSeries.Values); | |
MainWindowViewModel.cs | |
public double Point { | |
get { return _point; } | |
set { | |
_point = value; | |
var now = DateTime.Now; | |
ChartValues.Add(new MeasureModel | |
{ | |
DateTime = now, | |
Value = value | |
}); | |
SetAxisLimits(now); | |
if (ChartValues.Count > 30) ChartValues.RemoveAt(0); | |
} | |
} | |
parser | |
.SensorValues | |
.Select(values => values.Temp1) | |
.Subscribe(val => Point = val); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment