【发布时间】:2010-10-05 13:01:59
【问题描述】:
当绑定源的值为 156 时,有人可以帮我找出为什么 l.X1 设置为默认值(0.0)。下图可能是不言自明的。
【问题讨论】:
-
所有东西都声明并运行在同一个线程上吗?我的猜测可能不是,这就是你看到这种行为的原因。需要更多代码来帮助 - 抱歉。
-
所有东西都被声明并且在同一个线程上。
-
如果我在 MyObj 类中注释掉以下行,一切都会按预期工作。但我需要这个属性是依赖属性。公共静态只读 DependencyProperty CenterXProperty = DependencyProperty.Register("CenterX", typeof(double), typeof(MyObj), null); public static readonly DependencyProperty CenterYProperty = DependencyProperty.Register("CenterY", typeof(double), typeof(MyObj), null);
-
向我们展示您对 X1Property DependencyProperty 的声明。此外,向我们展示与 CenterX DependencyProperty 的绑定。
-
我正在使用框架提供的相同 Line 类。我使用的唯一绑定在我的问题的图像中。
标签: c# silverlight-3.0 windows-phone-7