Custom WPF command pattern example

前端 未结 4 1014

I\'ve done some WPF programing and one thing I never got was the command pattern. Every example seems to be for built in ones, edit, cut, paste. Anyone have an example or

4条回答
  •  时光取名叫无心
    2020-12-12 18:56

    I blogged about a bunch of resources on WPF Commands along with an example last year at http://blogs.vertigo.com/personal/alanl/Blog/archive/2007/05/31/commands-in-wpf.aspx

    Pasting here:

    Adam Nathan’s sample chapter on Important New Concepts in WPF: Commands

    MSDN article: The Command Pattern In WPF

    Keyvan Nayyeri: How to Add Commands to Custom WPF Control

    Ian Griffiths: Avalon Input, Commands, and Handlers

    Wikipedia: Command Pattern

    MSDN Library: Commanding Overview

    MSDN Library: CommandBinding Class

    MSDN Library: Input and Commands How-to Topics

    MSDN Library: EditingCommands Class

    MSDN Library: MediaCommands Class

    MSDN Library: ApplicationCommands Class

    MSDN Library: NavigationCommands Class

    MSDN Library: ComponentCommands Class

    Also buried in the WPF SDK samples, there's a nice sample on RichTextBox editing which I've extended. You can find it here: RichTextEditor.zip

提交回复
热议问题