Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我在一个对象上有两个附加属性
是否可以从目标属性的属性更改方法中查询到源附加属性的值,还是它们彼此不知道?
当然,我一直在为需要检索 CommandParameter 对象的附加 ICommand 属性执行此操作。
例如:
private static void HandleKeyDown(object sender, KeyEventArgs e) { var param = sender.GetValue(CommmandParameterProperty); GetKeyDownCommand((UIElement)sender).Execute(param); }