2011年4月27日
摘要: 需求:我们需要把界面上的数据列表保存为Excel工作簿。解决方案:AutomationFactory :提供对已注册的自动化服务器的访问。CreateObject(String):激活具有指定的编程标识符 (ProgID) 的已注册自动化服务器并返回对它的引用。效果:xaml代码:(基本不需要写,全是用C#代码写的) <Grid x:Name="LayoutRoot" Background="White"> </Grid>cs代码: public MainPage() { InitializeComponent(); Loaded 阅读全文
posted @ 2011-04-27 16:26 记忆逝去的青春 阅读(1634) 评论(3) 推荐(0) 编辑
摘要: 一:不为空验证RequiredAttribute指定必须为属性提供值。代码: private string name; [Required(ErrorMessage = "姓名不能为空")] public string Name { get { return name; } set { if (name != value) { Validator.ValidateProperty(value, new ValidationContext(this, null, null) { MemberName = "Name" }); name = value; } 阅读全文
posted @ 2011-04-27 14:51 记忆逝去的青春 阅读(1753) 评论(0) 推荐(1) 编辑