Binds a RoutedCommand to the event handlers that implement the command.
Questions tagged [commandbinding]
201 questions
4
votes
1 answer
How to Bind Button to DataGrid Delete Command in WPF
I'd like to delete rows from a WPF DataGrid by clicking a button above (not inside) the DataGrid, following the MVVM pattern. Although delete buttons within a row itself work, they are kind of ugly (one has to select the row first) and as there are…

THW
- 55
- 1
- 2
- 6
4
votes
5 answers
Keybinding in WPF
I'm new to WPF and in an application i'm building I'd like to show the main menu when the alt key is pressed just like windows explorer in vista and windows 7. I've tried using a keybinding with just the modifier set but that doesn't seem to work.…

jamier
- 802
- 1
- 8
- 9
4
votes
1 answer
UI action in middle of MvxCommand
I am using MvvmCross, but this may be general command binding.
When user click a button, the application require an extra input data before proceed to what I want to do in the actual command. The problem that I cannot call an UI action in middle of…

user2418216
- 141
- 1
- 10
4
votes
2 answers
How can a CanExecute of a commandBinding fire once the element has been removed from the visual tree?
I have a related question here where i have a user control with a command binding. The user control has being removed from the visual tree, yet the canExecute is still firing. My understanding of the Commanding model was that it bubbles and tunnels…

Aran Mulholland
- 23,555
- 29
- 141
- 228
4
votes
1 answer
Command Binding to Usercontrol Drag/Drop
How can I create a UI that responds to Drag/Drop events of a usercontrol by usinng the Command pattern in WPF?

Marcelo de Aguiar
- 41
- 1
- 2
4
votes
2 answers
WPF ToggleButton and DelegateCommand
Is there a way to determine if a ToggleButton is Checked/Unchecked via DelegateCommands?
TIA,
mike
XAML code below. I'm using ItemsControl and binding to a collection. I'm basically wanting a way to get the toggle status of each button when it's…

Mike
- 41
- 1
- 3
4
votes
2 answers
How do I clear Command bindings registered by CommandManager?
I have this control (WPF) that uses a CommandBinding and it gets registered like this:
CommandBinding binding = new CommandBinding(ApplicationCommands.Delete, OnDeleteExecuted,…

Carlo
- 25,602
- 32
- 128
- 176
3
votes
1 answer
InputBinding and WebBrowser control
I have a very simple application where I'm trying to bind keyboard shortcuts to a WPF command that is bound to a menu item. The application itself consists of just a Menu and a WebBrowser control.
When I'm within the WebBrowser, the keyboard…

sohum
- 3,207
- 2
- 39
- 63
3
votes
1 answer
Multiple parameters with Command binding
I have a textblock with command binding and using Prism library.
this is the XAML parth:
SocialSecurityNumer:

aghaux
- 729
- 4
- 14
- 38
3
votes
1 answer
How do you prevent the VS Shell from getting priority on key/command bindings in a VSPackage ToolWindow?
I have wpf a user control that accepts input gestures to perform various commands. In the example image below, the user can press Ctrl+N to execute the New command to create a new item in the TreeView.
When this user control is hosted within a WPF…

Dave Clemmer
- 3,741
- 12
- 49
- 72
3
votes
0 answers
Can I Raise CanExecute on MediaCommands without using InvalidateRequerySuggested()?
I have some custom CommandBindings that determine the CanExecute status of various MediaCommands (Play, Pause, etc). I'd like to trigger the CanExecute handler to be called at certain points. However, the only way I can figure out how to do this is…

JacobJ
- 3,677
- 3
- 28
- 32
3
votes
1 answer
Command Binding not working when the host control is added programatically in wpf
This is weird. I have a UserControl (MyControl) with a button inside. I have added a command to this button whose command target is another user control which is again added to the same window.
When I add the UserControl statically in xaml to the…

sudarsanyes
- 3,156
- 8
- 42
- 52
3
votes
1 answer
CommandBinding question. How to enable command button
My code is here>>
public class Player:INotifyPropertyChanging
{
string addressBar;
public string Url
{
get {
return addressBar;
}
set { addressBar = value;…

ebattulga
- 10,774
- 20
- 78
- 116
3
votes
1 answer
MVVM Light canExecute always false with RelayCommand not RelayCommand
Do anyone know why being specific with the MVVM Light RelayCommand generic type would cause its canExecute to always resolve to false for the binding? In order to get the correct behavior I had to use an object and then convert it to the desired…

Rock
- 182
- 11
3
votes
1 answer
Navigate to other page IocContainers and MVVM light
I'm making a windows universal 10 application with MVVM light.
But now I will, if I click on an item on the ShowWeatherPage be navigate to ShowWeatherDetailPage for more details about the clicked item. But I don't know how I can do this. Can you…

H. Pauwelyn
- 13,575
- 26
- 81
- 144