最近在学silverlight toolkit控件,看到代震军老师写的的东东不错,网址:http://www.cnblogs.com/daizhj/archive/2009/02/09/1376181.html
可是当我编程时这段代码老出错误:
Action<Chart> chartModifier = (chart) =>
{
Axis dateAxis = new Axis { Orientation = AxisOrientation.Horizontal, Title = "雇员名称", FontStyle = FontStyles.Normal, FontSize = 12f, ShowGridLines = true};
EmployeeChart.Axes.Add(dateAxis);
Axis valueAxis = new Axis { Orientation = AxisOrientation.Vertical, Title = "薪水", Minimum = -1000, Maximum = 3000, ShowGridLines = true};
EmployeeChart.Axes.Add(valueAxis);
};
就是当编码时new Axis {};老提示我:无法创建抽象类和接口。好郁闷不知怎么回事,那位高手能给解释下不盛感激。不知我是什么环境没配好,还是命名空间没有引用好。我现有的命名空间为:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.Windows.Controls.DataVisualization;
using System.Windows.Controls.Primitives;
using lightdong.DataService;//自定义wcfweb
using Microsoft.Windows.Controls.DataVisualization.Charting;
using Microsoft.Windows.Controls.DataVisualization;