Questions tagged [commandbinding]

Binds a RoutedCommand to the event handlers that implement the command.

201 questions
1
vote
1 answer

WPF ComamndBinding Help on MenuItem

New to WPF...was reading this WPF Routed Command with Bindings per-Tab and am close to getting it working. The MenuItem is disabled until my RuleTab (tabitem) is selected but rather than pop my Find Dialog it shows…
1
vote
1 answer

Call default WPF Textbox Paste handler from my command binding

I have declared a WPF Textbox with a command binding for Paste:
David Ching
  • 1,903
  • 17
  • 21
1
vote
1 answer

WPF Command Binding of ContextMenu Item inside ItemsControl

My Application consists of a MainWindow with a ContentControl and I change the ViewModel depending on the selected menu. One of the UserControls I display as content contains the following WrapPanel:
Elsbeth
  • 75
  • 5
1
vote
1 answer

WPF EditingCommands Command Binding

The Situation: I have some Editing commands in WPF window, and a close command (Application.CloseCommand) and have some bindings like this View:
Bhanu Chhabra
  • 474
  • 1
  • 6
  • 22
1
vote
2 answers

WPF Application Command Bindings doesn't work

Hi I have a strange problem with CommandBindings in WPF. I add CommandBindings in constructor of object. The command bindings looks like that CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy,Copy_Executed,Copy_Enabled)); …
losieko
  • 271
  • 3
  • 5
1
vote
1 answer

WPF C# UserControl DependencyProperty Command Binding is null

I created a UserControl as a file browsing tool and I wanted to implement Commands as DependencyProperties for loading and saving so that I can bind Commands from my ViewModel in order to handle them. The problem now is that if I use the predefined…
dukemadcat
  • 23
  • 1
  • 5
1
vote
1 answer

Bind to a UserControl RoutedCommand from parent window

I'm trying to create a UserControl that displays a multi-page image and allows the user to zoom, rotate, and browse an image. The one part I'm having a problem with is getting the keyboard shortcuts setup properly. I figured out I need to have the…
Gariig
  • 131
  • 1
  • 8
1
vote
1 answer

How to force a RibbonButton to be alway enabled?

I have a Microsoft Ribbonbar inside a Window, and every RibbonButton is associated to a specific command like this:
NinjaCross
  • 784
  • 2
  • 9
  • 20
1
vote
1 answer
1
vote
1 answer

Is it ok to have RelayCommand in View?

I have been in WPF for past few years but haven't done any of my projects from the scratch. Now, I got a chance to do so. I have started to put some base before moving into project. I have created a separate WPF project for view and class library…
Gopichandar
  • 2,742
  • 2
  • 24
  • 54
1
vote
1 answer

CanExecute method going to false problem

Well, in our application this usually works fine. But at some point, none of the CanExecute methods fire (even if I explicitly call CommandManager.InvalidateRequerySuggested(), the CanExecute methods don't run). Anyway, despite the fact that they…
Carlo
  • 25,602
  • 32
  • 128
  • 176
1
vote
2 answers

Alternatives for bind an event to a property

I've a list box but if I click on an item, I must see the details of that item. I've made this code where I try to bind the SelectionChanged event to a property whit type RelayCommand and mode is two way.
H. Pauwelyn
  • 13,575
  • 26
  • 81
  • 144
1
vote
2 answers

Binding a button command to a non static property

I would like to bind my button to a non static ICommand property. But it would seem all examples I've found are only relevant to static properties. For example. Here's what I've managed thus far
1
vote
3 answers

WPF Routed Command with Bindings per-Tab

I intended to disable and enable the Buttons outside the TabControl, just like those inside the TabItem when the current tab is changed. But the CommandBindings of the TabItem do not seem to impact "up" the visual tree. What is the right way to do…
Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233
1
vote
1 answer

MVVM - In a list of objects, each containing a command, how can I get the appropriate command to fire?

Maybe I'm going about this the wrong way but in my view model I have a list of objects (CGCAppSwitchboardItem) that each contain a DelegateCommand property. My intention here is that each item (CGCAppSwitchboardItem) in my list would represent a…
user134363