添加项目文件。
This commit is contained in:
132
CapMachine.Wpf/ViewModels/RealTimeChartViewModel.cs
Normal file
132
CapMachine.Wpf/ViewModels/RealTimeChartViewModel.cs
Normal file
@@ -0,0 +1,132 @@
|
||||
using CapMachine.Core;
|
||||
using Prism.Commands;
|
||||
using Prism.Services.Dialogs;
|
||||
using SharpDX.Direct3D9;
|
||||
using System;
|
||||
using System.Windows;
|
||||
|
||||
namespace CapMachine.Wpf.ViewModels
|
||||
{
|
||||
public class RealTimeChartViewModel : NavigationViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 实例化函数
|
||||
/// </summary>
|
||||
public RealTimeChartViewModel(IDialogService dialogService, IFreeSql freeSql)
|
||||
{
|
||||
DialogService = dialogService;
|
||||
FreeSql = freeSql;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 弹窗服务
|
||||
/// </summary>
|
||||
public IDialogService DialogService { get; }
|
||||
|
||||
/// <summary>
|
||||
/// FreeSQL 实例
|
||||
/// </summary>
|
||||
public IFreeSql FreeSql { get; }
|
||||
|
||||
private DelegateCommand _ChartConfigCmd;
|
||||
/// <summary>
|
||||
/// 编辑曲线数据
|
||||
/// </summary>
|
||||
public DelegateCommand ChartConfigCmd
|
||||
{
|
||||
set
|
||||
{
|
||||
_ChartConfigCmd = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
if (_ChartConfigCmd == null)
|
||||
{
|
||||
_ChartConfigCmd = new DelegateCommand(() => ChartConfigCmdMethod());
|
||||
}
|
||||
return _ChartConfigCmd;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑曲线数据执行方法
|
||||
/// </summary>
|
||||
private void ChartConfigCmdMethod()
|
||||
{
|
||||
//弹窗
|
||||
DialogService.ShowDialog("DialogChartRtConfigView", new DialogParameters() { { "Name", "" } }, (par) =>
|
||||
{
|
||||
if (par.Result == ButtonResult.OK)
|
||||
{
|
||||
//程序名称
|
||||
var ReturnValue = par.Parameters.GetValue<string>("Name");
|
||||
|
||||
|
||||
}
|
||||
else if (par.Result == ButtonResult.Cancel)
|
||||
{
|
||||
//取消
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//#region 曲线配置
|
||||
|
||||
//private LightningChart _LightningChartInstance;
|
||||
///// <summary>
|
||||
///// LightningChart 实例
|
||||
///// </summary>
|
||||
//public LightningChart LightningChartInstance
|
||||
//{
|
||||
// get { return _LightningChartInstance; }
|
||||
// set { _LightningChartInstance = value; RaisePropertyChanged(); }
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// 获取实例
|
||||
///// </summary>
|
||||
///// <param name="chart"></param>
|
||||
//public void SetChart(LightningChart chart)
|
||||
//{
|
||||
// LightningChartInstance = chart;
|
||||
//}
|
||||
|
||||
|
||||
//private AxisYCollection _YAxes=new AxisYCollection();
|
||||
///// <summary>
|
||||
///// Y轴配置
|
||||
///// </summary>
|
||||
//public AxisYCollection YAxes
|
||||
//{
|
||||
// get { return _YAxes; }
|
||||
// set { _YAxes = value; RaisePropertyChanged(); }
|
||||
//}
|
||||
|
||||
|
||||
//private AxisXCollection _XAxes = new AxisXCollection();
|
||||
///// <summary>
|
||||
///// X轴配置
|
||||
///// </summary>
|
||||
//public AxisXCollection XAxes
|
||||
//{
|
||||
// get { return _XAxes; }
|
||||
// set { _XAxes = value; RaisePropertyChanged(); }
|
||||
//}
|
||||
|
||||
|
||||
//private SampleDataSeriesCollection _ChartDataSeries;
|
||||
///// <summary>
|
||||
///// 曲线集合数据
|
||||
///// </summary>
|
||||
//public SampleDataSeriesCollection ChartDataSeries
|
||||
//{
|
||||
// get { return _ChartDataSeries; }
|
||||
// set { _ChartDataSeries = value; RaisePropertyChanged(); }
|
||||
//}
|
||||
|
||||
|
||||
//#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user