-1
当我在wpf文本框控件中输入spacebar (" ")
时,它从视图中返回double spacebar
。来自输入的WPF双空格键
如何配置文本框发回原始输入文本不与double spacebar
。
<DataTemplate x:Key="TextBoxDataTemplate">
<StackPanel Orientation="Horizontal" Background="AntiqueWhite">
<Label Name="lblTabTitle"
Content="{Binding TextForLabel}"
VerticalAlignment="Center"
Margin="4 4 2 4"
HorizontalAlignment="Left" Padding="0" />
<TextBox Name="inputText" Width="100" Margin="5" Text ="{Binding Text}" helpers:InputTextBoxBindingsManager.UpdatePropertySourceWhenKeyPressed="TextBox.Text"/>
<Button Name="btn"
Margin="2 0 0 0"
Padding="0"
Height="16"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding DataContext.DeleteItemCommand, ElementName=tagsList}"
CommandParameter="{Binding}">
<Image Name="img" Source="/Unive.Net;component/Images/GeneralIcons/16x16/quit.png" Width="16" Height="16" />
</Button>
</StackPanel>
</DataTemplate>
什么是您当前的代码来获得这个问题呢? – WiiMaxx
要清楚,如果单击一次空格键,会得到双倍的空间! – Akrem
UpdatePropertySourceWhenKeyPressed怎么样? – Akrem