我只想在WatermarkTextbox聚焦时显示虚拟键盘(使用TabTip)。但是,在某些第三方控件中,例如wpf扩展工具箱中的datetimepicker,时间输入框似乎是一种文本框,因此,即使我专门绑定到WatermarkTextBox,也可以将焦点对准键盘时显示键盘。如何排除datetimepicker控件触发虚拟键盘?
c#绑定:
public TestEntryPage()
{
InitializeComponent();
TabTipAutomation.IgnoreHardwareKeyboard = HardwareKeyboardIgnoreOptions.IgnoreAll;
TabTipAutomation.BindTo<Xceed.Wpf.Toolkit.WatermarkTextBox>();
}
XAML:
<wpfTool:WatermarkTextBox x:Name="DescriptionEntry" Grid.Column="1" Grid.Row="1" Watermark="Enter description" HorizontalAlignment="Center" Height="30" AcceptsReturn="True" AcceptsTab="True" Foreground="White" Background="Transparent" VerticalAlignment="Top" Width="153"/>
<wpfTool:DateTimePicker x:Name ="MetaDataDateTimePicker" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="153"/>