心澄欲遣

不践迹,亦不入于室

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

06 2013 档案

摘要:简单的定义下面的路由事件类,死东西,敲熟练 public class MyRoutedEvents : UIElement { public static readonly RoutedEvent ButtonClickEvent = EventManager.RegisterRoutedEvent("ButtonClick", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MyRoutedEvents)); public event RoutedEventHandler ButtonC... 阅读全文
posted @ 2013-06-24 10:09 心澄欲遣 阅读(251) 评论(0) 推荐(0)

摘要:下面代码是常用的包装方式,是死的,好好练熟,使劲敲。 public static readonly DependencyProperty NameProperty = DependencyProperty.Register("Name",typeof(string),typeof(Student),new UIPropertyMetadata("王俊鹏")); public string Name { get { return (string)GetValue(NameProperty); } set { SetValue... 阅读全文
posted @ 2013-06-24 09:48 心澄欲遣 阅读(349) 评论(0) 推荐(0)

摘要:1.新建一个继承Image的基类,因为要在Image对象上画图,所以下面的代码必须放入基类中,如果放在加载图片的主窗体上,背景会变成黑色。 protected override Visual GetVisualChild(int index) { return visuals[index]; } protected override int VisualChildrenCount { get { return visuals.Count; } }下面是新建的基类代... 阅读全文
posted @ 2013-06-13 10:57 心澄欲遣 阅读(2907) 评论(0) 推荐(1)

欢迎第myspace graphics个访客