文本未显示在文本框中

时间:2018-06-13 21:29:08

标签: c# visual-studio xaml

我一直坚持这个问题,文本框中的文字显示在可视化工具中,但不是在我运行程序时。有人可以帮帮我吗?

 <TextBox x:Name="SearchKey" Text ="hello"  BorderThickness="0" Width="Auto" Background="White" Margin="21.724,4,20.999,4">
      <TextBox.InputBindings>
        <KeyBinding Key="Enter"
            Command="{Binding SearchTemplatesCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:EmailComposerWindow}}}"
            CommandParameter="{Binding Text, ElementName=SearchKey}"
         />
      <KeyBinding Key="Esc"
       Command="{Binding ResetSearchCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:EmailComposerWindow}}}"
         />
      </TextBox.InputBindings>
  </TextBox>

enter image description here

0 个答案:

没有答案