自定义控件的属性问题
public double X
{
get { return (double)GetValue(XProperty); }
set { SetValue(XProperty, value); }
}
public static readonly DependencyProperty XProperty = DependencyProperty.Register(
"X", //属性名
typeof(double), //属性类型
typeof(QX), //属性主人类型
null);
/// <summary>
/// 精灵Y坐标(关联属性)
/// </summary>
public double Y
{
get { return (double)GetValue(YProperty); }
set { SetValue(YProperty, value); }
}
public static readonly DependencyProperty YProperty = DependencyProperty.Register(
"Y",
typeof(double),
typeof(QX),
null);
public BitmapImage Source { get; set; } //图片地址
我这里 写错了吗 我每次用这些属性的时候 页面会无法显示
{
get { return (double)GetValue(XProperty); }
set { SetValue(XProperty, value); }
}
public static readonly DependencyProperty XProperty = DependencyProperty.Register(
"X", //属性名
typeof(double), //属性类型
typeof(QX), //属性主人类型
null);
/// <summary>
/// 精灵Y坐标(关联属性)
/// </summary>
public double Y
{
get { return (double)GetValue(YProperty); }
set { SetValue(YProperty, value); }
}
public static readonly DependencyProperty YProperty = DependencyProperty.Register(
"Y",
typeof(double),
typeof(QX),
null);
public BitmapImage Source { get; set; } //图片地址
我这里 写错了吗 我每次用这些属性的时候 页面会无法显示
...全文


