如何将 IsSelected 属性绑定到文本块
我的树视图填充了文本块项目。 如果用户单击文本块,我想在模型中设置一个名为“isSelected”的属性。 但是:文本块没有属性 IsSelected。 我怎样才能实现这个? 从文本块派生并添加属性?
my treeview is populated with textblock items.
If a user clicks on a textblock, i want to set a property in my model called "isSelected".
But : the textblock have no Property IsSelected.
How can i Implement this ?
Derive from textblock and add a Property ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须使用 TreeViewItem.IsSelected 财产。您必须为树视图的所有项目指定自定义样式。
You have to use the TreeViewItem.IsSelected property. You will have to specify the custom style for all items of the tree view.