Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在wpf中编辑树视图中的项目_Wpf_Mvvm_Wpf Controls_Wpf 4.0_Treeviewitem - Fatal编程技术网

如何在wpf中编辑树视图中的项目

如何在wpf中编辑树视图中的项目,wpf,mvvm,wpf-controls,wpf-4.0,treeviewitem,Wpf,Mvvm,Wpf Controls,Wpf 4.0,Treeviewitem,我的TreeViewItemTemplate如下所示 <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Connections}"> <WrapPanel > <CheckBox VerticalAlignment="Center" Command="{Binding UpdateConnections}" Co

我的
TreeView
ItemTemplate
如下所示

<TreeView.ItemTemplate>
    <HierarchicalDataTemplate ItemsSource="{Binding Connections}">
        <WrapPanel >
            <CheckBox  VerticalAlignment="Center" Command="{Binding UpdateConnections}" CommandParameter="{Binding}" IsChecked="{Binding Status,  Mode=TwoWay}" Focusable="False"  Style="{StaticResource ResourceKey=TreeView_CheckBox_Style}"></CheckBox>
             <TextBlock Text="{Binding Name}"  Style="{StaticResource ResourceKey=treeTextBoxStyle}"  />
         </WrapPanel>
    </HierarchicalDataTemplate>
</TreeView.ItemTemplate>

我正在使用MVVM。如果我的树项目以“s”开头,我想编辑
文本框

我基本上是双击我的
treevieItem
,我应该能够输入它


如何操作?

我可以看到
文本块
,但没有任何
文本框
。好的。我想编辑tat textBlock。如何操作。
TextBlock
是只读的。您最好使用
TextBox
并操作其
IsReadOnly
属性。