摘要:简单的定义下面的路由事件类,死东西,敲熟练 public class MyRoutedEvents : UIElement { public static readonly RoutedEvent ButtonClickEvent = EventManager.RegisterRoutedEvent("ButtonClick", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MyRoutedEvents)); public event RoutedEventHandler ButtonC...
阅读全文
06 2013 档案
摘要:下面代码是常用的包装方式,是死的,好好练熟,使劲敲。 public static readonly DependencyProperty NameProperty = DependencyProperty.Register("Name",typeof(string),typeof(Student),new UIPropertyMetadata("王俊鹏")); public string Name { get { return (string)GetValue(NameProperty); } set { SetValue...
阅读全文
摘要:1.新建一个继承Image的基类,因为要在Image对象上画图,所以下面的代码必须放入基类中,如果放在加载图片的主窗体上,背景会变成黑色。 protected override Visual GetVisualChild(int index) { return visuals[index]; } protected override int VisualChildrenCount { get { return visuals.Count; } }下面是新建的基类代...
阅读全文

浙公网安备 33010602011771号