Monday, April 29, 2013

Controls that implement WPF Commanding

I was trying to find a quick list of the basic WPF controls that support commanding (so that I could expose a DelegateCommand from my ViewModel to which I could bind the view). What I found out was that “generally” commands that support commanding implement ICommandSource. Based on that info, I was able to generate the following list of controls that implement ICommandSource:

System.Windows.Input.InputBinding
System.Windows.Input.KeyBinding
System.Windows.Input.MouseBinding
System.Windows.Controls.MenuItem
System.Windows.Controls.Button
System.Windows.Controls.Primitives.ToggleButton
System.Windows.Controls.CheckBox
System.Windows.Controls.GridViewColumnHeader
System.Windows.Controls.Primitives.CalendarButton
System.Windows.Controls.Primitives.CalendarDayButton
System.Windows.Controls.Primitives.DataGridColumnHeader
System.Windows.Controls.Primitives.DataGridRowHeader
System.Windows.Controls.Primitives.RepeatButton
System.Windows.Controls.RadioButton
System.Windows.Documents.Hyperlink
System.Windows.Shell.ThumbButtonInfo

MS.Internal.Documents.DocumentGridContextMenu+EditorMenuItem
System.Windows.Documents.TextEditorContextMenu+EditorMenuItem
System.Windows.Documents.TextEditorContextMenu+ReconversionMenuItem

More info:

MSDN: commanding overview: http://msdn.microsoft.com/en-us/library/ms752308.aspx