输入ctor+两次Tab键:定义类的构造函数
public Student(){}
输入prop+两次Tab键:定义不带private字段的属性
public int MyProperty { get; set; }
输入propfull+两次Tab键:定义带private字段的属性
private int myVar;public int MyProperty{get { return myVar; }set { myVar = value; }}
输入propdp+两次Tab键:定义依赖属性
public int MyProperty{get { return (int)GetValue(MyPropertyProperty); }set { SetValue(MyPropertyProperty, value); }}// Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, public static readonly DependencyProperty MyPropertyProperty =DependencyProperty.Register("MyProperty", typeof(int), typeof(ownerclass), new PropertyMetadata(0));
输入propa+两次Tab键:定义附加属性
public static int GetMyProperty(DependencyObject obj){return (int)obj.GetValue(MyPropertyProperty);}public static void SetMyProperty(DependencyObject obj, int value){obj.SetValue(MyPropertyProperty, value);}// Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, public static readonly DependencyProperty MyPropertyProperty =DependencyProperty.RegisterAttached("MyProperty", typeof(int), typeof(ownerclass), new PropertyMetadata(0));
本文发布于:2024-01-31 20:06:07,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170670276931039.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |