兰保明

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

随笔分类 -  Silverlight

摘要:1 DialogResult dr = ofdAddUserPicture.ShowDialog(); 2 this.picPicture.Image = Image.FromFile(ofdAddUserPicture.FileName); //显示图片 3 if (dr == DialogResult.OK) 4 { 5 user.Picture = ofdAddUserPicture.FileName; 6 } 7 ... 阅读全文
posted @ 2011-08-27 15:12 兰保明 阅读(612) 评论(0) 推荐(0)

摘要:1 //关闭时提示“是否关闭” 2 Response.Write("<script language:javascript>javascript:window.close();</script>");3 4 //直接关闭不提示 5 //Response.Write("<script language:javascript>javascript:window.opener=null;window.close();</script>"); 阅读全文
posted @ 2011-08-25 16:53 兰保明 阅读(228) 评论(0) 推荐(0)

摘要:后台代码:View Code 1 using System; 2 using System.Windows; 3 using System.Windows.Controls; 4 using System.Windows.Documents; 5 using System.Windows.Ink; 6 using System.Windows.Input; 7 using System.Windows.Media; 8 using System.Windows.Media.Animation; 9 using System.Windows.Shapes;10 using System.Wind 阅读全文
posted @ 2011-07-23 10:55 兰保明 阅读(555) 评论(0) 推荐(0)

摘要:1 public partial class Timer : UserControl 2 { 3 public Timer() 4 { 5 // 为初始化变量所必需 6 InitializeComponent(); 7 DispatcherTimer timer = new DispatcherTimer(); 8 timer.Interval = new TimeSpan(0, 0, 1); 9 timer.Tick += new EventHandler(timer_Tick);10 timer.Start();11 }12 13 void timer_Tick(object sende. 阅读全文
posted @ 2011-07-21 09:17 兰保明 阅读(855) 评论(0) 推荐(0)

摘要:尽量使用代码控制:尽可能早的计划好所有的用户控件;这样可以提前预期控件之间相互运作情况,便于整合项。尝试分割不同功能到不同的用户控件; 现在无论国内国外,开发队伍通常来说都是3个人以上,分割不同功能到不同的用户控件,可以减少相互之间的冲突和影响; 另外,在测试的时候发现问题,对于不同的小功能区域,方便Bug定位;另外也方便功能模块的再利用。这个是现在Web项目开发的一个常用规则。 尽量少用Loaded事件; 初始化的问题; 在每个用户控件中,需要创建Initialize和Deinitialize公共方法。 在实际项目中,你可以把Event Handlers或者必须要运行一次的代码,添加到Ini 阅读全文
posted @ 2011-07-20 14:38 兰保明 阅读(541) 评论(2) 推荐(0)

摘要:在App.cs中的下面函数中改变红色标记的类即可private void Application_Startup(object sender, StartupEventArgs e) {this.RootVisual = new ToolBarWidget(); } 阅读全文
posted @ 2011-07-15 14:22 兰保明 阅读(347) 评论(0) 推荐(0)

摘要:Silverlight学习起步XAML代码<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" x:Class="HelloWorld 阅读全文
posted @ 2011-07-15 14:18 兰保明 阅读(313) 评论(0) 推荐(0)