The simplest way is to change TextBlock
to TextBox
.
<DataTemplate>
<TextBox Text="{Binding Mail}" TextDecorations="Underline" Foreground="Blue" Cursor="Hand" />
</DataTemplate>
Better way is to use DataGrid
which has CellTemplate
and CellEditingTemplate
<DataGrid>
<DataGrid.Columns>
<DataGridTemplateColumn Header="Mail">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Mail}" TextDecorations="Underline" Foreground="Blue" Cursor="Hand" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox Text="{Binding Mail}" TextDecorations="Underline" Foreground="Blue" Cursor="Hand" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…