在另一个 WPF 控件事件上触发属性
假设我有一个 ListView 和 TextBox,它们位于 在同一窗口的不同容器中。
在列表视图中选择项目我希望更新 TextBox Text 属性 按照listview数据绑定选中的item。 在 XAML 中可以吗?
Suppose I have a ListView and TextBox and they are located
in different containers in the same Window.
Selecting items in the listview I want the TextBox Text property to be updated
in accordance with the listview data bound selected item.
Is it possible in XAML?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然...检查一下
您可以绑定到 SelectedItem。在这种情况下,我在作弊,因为我知道它是一个 TextBlock,但在现实世界中,您必须编写一个 DataTemplate(最有可能)。
Sure... Check this out
You can bind to SelectedItem. In this case, I'm cheating, because I know it's a TextBlock, but in the real world you'll have to write a DataTemplate (most likely).