在代码隐藏中使用附加属性进行控制 (WPF)
我有 UserControl1,我想创建它的实例并在另一个 UserControl2 后面的代码中为其设置附加属性。 换句话说,我在 UserControl2 中有:
<UserControl2>
<Canvas>
</Canvas>
</UserControl2>
我想做:
<UserControl2>
<Canvas>
<UserControl1 Canvas.Left="100" ... />
</Canvas>
</UserControl2>
如何在 UserControl2 的代码后面创建带有附加属性的 UserControl1?
I have UserControl1 and I want to create it's instance and set attached property for it in the code behind of the other UserControl2.
The other words, I have in the UserControl2:
<UserControl2>
<Canvas>
</Canvas>
</UserControl2>
And I want to do:
<UserControl2>
<Canvas>
<UserControl1 Canvas.Left="100" ... />
</Canvas>
</UserControl2>
How can I create UserControl1 with attached property in code behind of the UserControl2?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)