免费教程_免费网赚教程_破解版软件-寂涯网络学习基地

当前位置: 主页 > 系统综合 > 各类编程 > 浅谈WPF中的命令(3)

浅谈WPF中的命令(3)

时间:2012-01-22 19:46来源:未知 整理:寂涯网络 点击:

 Margin="8,0,0,0" Text="文本框二" Width="120"/>  
  •         </StackPanel>  
  •         <Button x:Name="btnTest" Grid.Row="1"  
  •                 Margin="80,5,80,0" Height="25" Content="执行命令"  
  •                 Command="{x:Static c:MainWindow.MyCommand}"/>  
  •     </Grid>  
  • </Window>  

  • 在上面的XAML中,我们要注意的是,要引入我们定义了路由命令的类所在的命名空间。
     
    接下来,我们要编写两个事件处理程序——CanExecute确定命令是否可用;Executed命令逻辑应写在这里。
     
    1. // 命令   
    2. public static RoutedCommand MyCommand = new

    本页地址 http://www.jybase.net/biancheng/20120122758.html

    百度搜索更多

    谷歌搜索更多

    顶一下
    (0)
    0%
    踩一下
    (0)
    0%
    ------分隔线----------------------------
    
    评价:
    昵称: 验证码:点击我更换图片
    推荐内容
    赞助商
    赞助商
    

    关于本站免责声明视频更新google百度地图视频地图RRS订阅

    如有什么问题请在本站留言,或发邮件到 hxt167#foxmail.com