|
using System.Windows.Controls;
using SilverTrack.Telemetry;
using SilverTrack.ViewModel;
namespace SilverTrack
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
//Limits the frame rate to 20fps to lower CPU usage.
App.Current.Host.Settings.MaxFrameRate = 20;
//Create a TelemetryDataProvider, and create a new TelemetryViewModel based on this.
TelemetryDataProvider provider = new TelemetryDataProvider("data.csv");
TelemetryViewModel vm = new TelemetryViewModel(provider);
//Set the DataContext to the TelemetryViewModel.
DataContext = vm;
//Add a default chart to the TelemetryViewModel.
vm.AddChartCommand.Execute("");
Dispatcher.BeginInvoke(() =>
{
vm.ChannelViewModelCollection.ChannelViewModels[0].SelectedPrimaryIndex = 1;
vm.ChannelViewModelCollection.ChannelViewModels[0].SelectedSecondaryIndex = 2;
});
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.