Built-in command libraries in WPF

Aside from supporting the overall concept of commands, WPF has five built-in libraries of commands.

  • ApplicationCommands  this library contains commonly used commands such as Cut, Copy, paste, new, Open, Save, Undo, Close and many others.
  • ComponentCommands   these are commands for moving around inside an application. these can easily be confused with some of the editing commands as well as navigation commands. The commands in this library are for more general use than the other two. here you will find commands such as moveDown.ExtendSelectionLeft.ScrollbyLine, SelectToEnd, and many others.
  • EdtiingCommands this library is helpfu for dealing with text. it includes commands for alignment, formatiing, and the navigation of text. some exampls of command names are toggleBold, alignLeft, and DecreaseFontSize.
  • MediaCommands these are commands for controlling audio and video in your applications. some typical commands are play, pause, and increaseVolume.
  • NavigationCommands these commands are most useful for navigating in an application built around a web browser metahpor. commands include browseForward, nextpage, previouspage, refresh, and search.

Command bindings raise an event called CanExecute. We can handle this event and inform the binding if the command is available.

UIElement defines a collection of input bindings that are automatically avaiable to all of the element’s children. Usually, you’ll create your input bindings at the windows level of your applications.

There are two types of input binding: keyBinding and MouseBinding. As you might have guessed, KeyBinding is for activating commands with the keyboard, and mouseBinding is for activating them with the mouse.

From Sams.Teach.Yourself.WPF.in.24.Hours.Jun.2008.pdf

 

转载于:https://www.cnblogs.com/sunshinefly128/archive/2011/12/29/2306615.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值