简体   繁体   English

创建一个可编辑的WPF Treeview项目

[英]Create an editable wpf treeview item

I'm checking this page and I like the only answer there is. 我正在检查此页面,我喜欢那里的唯一答案。

Editable WPF treeview item on doubleclick? 双击可编辑的WPF树视图项目? (with styles?) (有样式吗?)

But I don't like the idea to use c# lines, Might there be a possible to write that code using XAML? 但是我不喜欢使用c#行的想法,也许可以使用XAML编写该代码吗?

You can use EventSetter , or AttachedBehavior . 您可以使用EventSetterAttachedBehavior But they are assumes that you need c# code-behind. 但是它们是假设您需要c#代码隐藏的。

How to do it in XAML - hard to say. 如何在XAML中做到这一点-很难说。 One more possible way - to use x:Code clause to write c# code inside xaml. 另一种可能的方式-使用x:Code子句在xaml中编写c#代码。

您可以在XAML中使用CheckBox,并使用其IsChecked属性将Style更改为Editable模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM