command in WPF

Source: Internet
Author: User

The Meaning of command:

  1. In the development process, there will be many buttons to achieve the same function. So you can use command to bind many operations to unified logic.
  2. Disable/enable controls can be implemented via CanExecute

The four main concepts of command

  1. Command
  2. Command Source
  3. Command Target
  4. Command Binding

Command: Is the action to be performed. Implemented via the ICommand interface (method: Execute/canexecute, Event: Canexecutechange) Note: The command itself does not contain processing logic. The processing logic is contained in the command binding.

Command Source: Is the object that invokes the command. Implemented through the ICommandSource interface. The main three properties are: Command,command target (the object on which to execute the command), command Parameter (user-defined parameters).

Command Binding: Associates a command with an event handler that implements the command.

command in WPF

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.