zoukankan      html  css  js  c++  java
  • 虚拟键盘输入之回车事件绑定与鼠标点击事件绑定

    用到了telerik:

    <telerik:RadWatermarkTextBox BorderThickness="0" Name="txtSearch" Background="{x:Null}" ClipToBounds="True" TextWrapping="Wrap" BorderBrush="#FFCCCCCC" >
      <telerik:RadWatermarkTextBox.InputBindings>
        <KeyBinding Key="Enter" Command="{Binding SearchCommand}" CommandParameter="{Binding ElementName=txtSearch}"></KeyBinding>
        </telerik:RadWatermarkTextBox.InputBindings>
      <telerik:RadWatermarkTextBox.WatermarkContent>
      <StackPanel>
        <TextBlock Text="测试" />
      </StackPanel>
      </telerik:RadWatermarkTextBox.WatermarkContent>
    </telerik:RadWatermarkTextBox>

    注意<i:Interaction>需要使用Blend的System.Windows.Interactivity.dll文件。

    <Button Content="确&#x0a;定" IsDefault="True" Grid.Row="2" Grid.Column="3" Grid.RowSpan="2" Style="{StaticResource Win8StyleBtn}" >
      <i:Interaction.Triggers>
        <i:EventTrigger EventName="Click">
          <i:InvokeCommandAction Command="{Binding SearchCommand}" CommandParameter="{Binding ElementName=txtSearch}">                    </i:InvokeCommandAction>
        </i:EventTrigger>
      </i:Interaction.Triggers>
    </Button>

    DelegateCommand需要Prism中的Microsoft.Practices.Prism.dll

    public void ExecuteSearch(Telerik.Windows.Controls.RadWatermarkTextBox radWatermarkTextBox)
    {
      MessageBox.Show(radWatermarkTextBox.Text);
    }

  • 相关阅读:
    ASP.NET Razor
    ASP.NET Razor
    ASP.NET Razor
    ASP.NET Razor C# 和 VB 代码语法
    ASP.NET Razor 简介
    aspnet_regiis -i VS 20XX 的开发人员命令提示符
    web.config
    Java_Freemarker
    SQL SELECT INTO 语句
    SQL UNION 和 UNION ALL 操作符
  • 原文地址:https://www.cnblogs.com/gnsds/p/3623217.html
Copyright © 2011-2022 走看看