public MainWindowViewModel(IDialogManager _dialogManager, SensorReadoutValues _sensorReadoutValues, AxisValues _axisValues) { dialogManager = _dialogManager; sensorReadoutValues = _sensorReadoutValues; axisValues = _axisValues; openedGraphicWindowsParams = new List <string>(); }
public GraphicViewModel(ChartValues <SensorValue> values, AxisValues _axisValues, string graphicTitle) { DateTimeFormatter = value => new DateTime((long)value).ToString("mm:ss:ms"); mapper = Mappers.Xy <SensorValue>() .X(model => model.GeneratingTime.Ticks) .Y(model => model.Magnitude); Charting.For <SensorValue>(mapper); axisValues = _axisValues; axisValues.PropertyChanged += AxisPropertyChanged; Values = values; GraphicTitle = graphicTitle; }
protected override void OnStartup(StartupEventArgs e) { try { AxisValues axisValues = new AxisValues(); SensorReadoutValues sensorReadoutValues = new SensorReadoutValues(axisValues); var dialogManager = new DialogManager(); dialogManager.Register <GraphicViewModel, GraphicView>(); var mainWindow = new MainWindow() { DataContext = new MainWindowViewModel(dialogManager, sensorReadoutValues, axisValues), }; mainWindow.Show(); } catch (Exception ex) { Log.Write(ex); } }