string message = "Do You Want To Use Seleted Data ?";
string title = "Slected Files:" + item.Content.ToString();
MessageBoxResult result = MessageBox.Show(message, title, MessageBoxButton.YesNo);
if (result == MessageBoxResult.Yes)
{
SetItemsListWithSelectedFile(selected_file_path, rat);
}
using System.Data;
DataTable处理函数
//new 新的datatable
DataTabledt = new DataTable();
// 插入列
DataColumndd = new DataColumn("Item", typeof(string));
dt.Columns.Add(dd);
DataColumndd1 = new DataColumn("File", typeof(string));
dt.Columns.Add(dd1);
//插入新行
DataRowdr = dt.NewRow();
dr["Item"] = "File0";
dr["File"] = 0;
dt.Rows.Add(dr);
DataRowdr1 = dt.NewRow();
dr1["Item"] = "File1";
dr1["File"] = 1;
dt.Rows.Add(dr1);
//插入新行到特定行
DataRowdr2 = dt.NewRow();
dr2["Item"] = "File2";
dr2["File"] = 2;
dt.Rows.InsertAt(dr2,1);
//修改已有行内容
DataRowdrr = dt.Rows[1];
drr.BeginEdit();
drr["File"] = 3;
drr.EndEdit();
使用功能: LineAnnotation
解释: Acomment on a line in a verbatim listing
代码设置:
lineAnnotation_Max = new OxyPlot.Annotations.LineAnnotation();
lineAnnotation_Max.Type = OxyPlot.Annotations.LineAnnotationType.Horizontal;
lineAnnotation_Max.Color = OxyPlot.OxyColors.Red;
lineAnnotation_Max.LineStyle = OxyPlot.LineStyle.Solid;
lineAnnotation_Max.MaximumX = 40;
lineAnnotation_Max.MinimumX = 0;
Model.Annotations.Add(lineAnnotation_Max);
lineAnnotation_Min = new OxyPlot.Annotations.LineAnnotation();
lineAnnotation_Min.Type = OxyPlot.Annotations.LineAnnotationType.Horizontal;
lineAnnotation_Min.MaximumX = 40;
lineAnnotation_Min.MinimumX = 0;
lineAnnotation_Min.Color = OxyPlot.OxyColors.Red;
lineAnnotation_Min.LineStyle = OxyPlot.LineStyle.Solid;
Model.Annotations.Add(lineAnnotation_Min);
使用功能: LinearAxis
代码设置:
LineAxisY = new OxyPlot.Axes.LinearAxis();
LineAxisY.Angle = 1;
LineAxisY.Title = "Y axis";
LineAxisY.TitleColor = OxyColor.FromRgb(20, 120, 220); ;
LineAxisY.TitleFontSize = 15;
LineAxisY.AxisDistance = 0;
LineAxisY.AxislineStyle = OxyPlot.LineStyle.None;
LineAxisY.AxislineThickness = 1;
LineAxisY.AxisTickToLabelDistance = 5;
LineAxisY.AxisTitleDistance = 5;
LineAxisX = new OxyPlot.Axes.LinearAxis();
LineAxisX.Angle = 1;
LineAxisX.Title = "X axis";
LineAxisX.TitleColor = OxyColor.FromRgb(20, 120, 220);
LineAxisX.TitleFontSize = 15;
LineAxisX.AxisDistance = 0;
LineAxisX.AxislineStyle = OxyPlot.LineStyle.None;
LineAxisX.AxislineThickness = 1;
LineAxisX.AxisTickToLabelDistance = 5;
使用工具:ScatterSeries
代码设置:
ScatterSeries series1 = new ScatterSeries { MarkerType = MarkerType.Circle };
List<double> datas = GetDatas(node, dt);
x_point = 1;
foreach (double data in datas)
{
series1.Points.Add(new ScatterPoint(x_point, data));
x_point++;
}
Model.Series.Add(series1);
//修改完数据后更新UI
Model.InvalidatePlot(true);