2011年9月19日
摘要: 为了节省文件大小,应该把多个Silverlight控件放在一个XAP文件里,例如Page1.xaml和Page2.xaml。第一次加载哪一个可以在App的Startup事件的处理事件中选择性加载。private void Application_Startup(object sender, StartupEventArgs e){ // Load the main control this.RootVisual = new Page1(); // 或者加载Page2 //this.RootVisual = new Page2();}如果要判断,可以通过StartupEventArgs对象的In 阅读全文
posted @ 2011-09-19 11:47 arong.NET 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 本文将示例如何运用前篇所写知识来建立一个用户自定义的登录控件。此控件界面非常简单,主要涉及的知识点是: 如何创建用户控件(包括对此控件的自定义事件和属性的编写,此处我们将创建一个名为LoginBox和LoginButton两个用户控件,其中,LoginBox控件内含LoginButton控件,LoginButton控件继承自Button控件。LoginBox和 LoginButton两个控件之间将通过自定义事件和自定义属性进行交互) 如何创建一个用C#编写的后台代码类(UserDetail.cs),并在 xaml文件中操作它(实例化它的一个类对象并把它和上面创建的用户LoginBox控件的.. 阅读全文
posted @ 2011-09-19 11:37 arong.NET 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 本文主要示例如何在xaml文件中操作用户使用C#代码自定义的类。主要步骤如下: 1、在VS2008中创建一个新项目CustomTypesInXaml,在此项目下我们新建两个类,一个是Client类,一个是AsiaClients类。两个类的代码分别如下: Client.cs代码:using System;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Documents;using System.Windows.Ink;using System.Windows.... 阅读全文
posted @ 2011-09-19 11:36 arong.NET 阅读(273) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// CSV格式化 /// </summary> /// <param name="data">数据</param> /// <returns>格式化数据</returns> private static string FormatCsvField(string data) { return String.Format("\"{0}\"", data.Replace("\"", "\" 阅读全文
posted @ 2011-09-19 11:12 arong.NET 阅读(220) 评论(0) 推荐(0) 编辑