Xamly begin a storyboard when a RoutedCommand is called?
Is there a way to begin a storyboard wen an ICommand is executed WITH XAML? ...
Is there a way to begin a storyboard wen an ICommand is executed WITH XAML? ...
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 like routed events. So how can the CanExecute fire once the element with the command bindi...
Please excuse me if this is a dumb question - I have read a dozen articles on the WPF command infrastructure and I am more confused than ever. I understand that I can use the built-in commands to implement (for example) a toolbar that will apply standard cut/copy/paste functionality to any focused textbox: <ToolBar> <Button Command...
I am having trouble with the MVVM pattern and Commands in my WPF app. The problem is not so much the MVVM pattern, but more the stuff that is going on on my GUI. I'll explain the situation: My app can DoStuff to some files. I have a class with a function DoStuff(int limit). My user user interface has the following items: A Button DoSt...
Hi I have the following listbox template within a WPF Page I want the search button to only be enabled when a checkbox in the listbox has been checked. I am using the MVVM and have a seperate commands class Unfortunately the Canexecute method for my Search button is not being fired Mycommand is defined as public static readonly Rou...
Hi, is there anyway for DelegateCommand's to support gestures when building a composite WPF app? I'm trying to create a command used by a MenuItem and also a Button, which can be accessed through a keyboard shortcut, but which sits inside a class in a separate assembly. I can use a RoutedCommand, but I want to minimise any code-behind....
Im deriving from a third party control. It is implementing ApplicationCommands.SelectAll. However the behaviour i want is slightly different. there is no virtual method i can override, and when i register a class handler, like so CommandManager.RegisterClassCommandBinding(typeof(MyDerivedControl), new CommandBinding(ApplicationComm...
I'm trying to implement a highly responsive UI for my MVVM application, so I've chosen to have all command handlers automatically execute in a BackgroundWorker so they don't block the UI. But at the same time, I don't want the user to be able to execute the same command while it is still executing in the background. The solution seems o...
I am using wpf Custom Commands. While writing a custom Command, one need to define the owner type. It's Description says that it is the type that is registering the command. I was seeing some sample of custom commands and there the Owner type was UIElement and in some others it was the class name itself. Whats the difference? What should...
Hello, I've a simple question about commands in WPF : I have a button with an ICommand bound to the Command property, and when I click on this button, the command is started, and wow it works :) Now I whant to start a particular command when I'm just pushing down the button (MouseLeftButtonDown event I think), but I don't know how can...
I'm getting weird behavior with command propagation from MenuItems of ContextMenu. I have the following kind of layout: ContextMenu is set for each DataGridRow of DataGrid inside UserControl, which in its turn is inside DockableContent of AvalonDock. If I get rid of either docking or UserControl around my grid there are no problems. Lis...
I have a static class called commands. One the RoutedCommands in it is called ConfirmNoPrint. I want to Execute it in code behind from my custom control like this: Commands.ConfirmNoPrint.Execute(null, [WHAT_DO_I_PUT_HERE]); In the custom control class I have an instance of Binding whose RelativeSource property is set like this: _mai...
I have a multiple windows in an application, for instance, window1, window2 and window3. one RoutedCommand (with KeyGesture F11) was binded in window1. How to launch that routed command by pressing F11, while window2 had input focus ? In WinForm application, i use MessageFilter to detect F11, but in WPF, how to do that ? ...
In a WPF / MVVM application, I am trying to find a code-efficient way to set the main view cursor to Cursors.Wait prior to any lengthy operation and to restore it to the default cursor after completion. Since all operations are invoked using routed commands, I'd like to find a way of intercepting command execution, ideally by creating a...
(Background: I'm porting a WinForms app to WPF in stages. At the present time, I still have a WinForms main form with an ElementHost that has WPF content in it.) I'd like my app to be told when certain ApplicationCommands such as Cut, Copy, and Paste change the value of their .CanExecute. I thought it'd be a simple matter of subscribing...
Hi, When will the CanExecute event be ideally raised by the control that realizes the ICommandSource interface?? I tried to add a breakpoint to the handler to check when it is getting raised and it seems to be executed whenever the control is rendered on the screen. Can someone explain when exactly it will be raised and how to raise ...
What's the best way to use WPF's built-in RoutedCommands with Caliburn? For example, in my shell I have an Edit menu with a Copy item in it attached to the standard command found in ApplicationCommands: <Menu> <MenuItem Header="Edit"> <MenuItem Header="Copy" Command="ApplicationCommands.Copy" /> </Menu...
When I execute a routed command, let's say: ApplicationCommands.Undo.Execute(null, this); WPF does some magic to find the proper CommandBinding on which it executes the ExecutedRoutedEventHandler. Is there a way to get a reference to the CommandBinding (or at least to the handler) that would be executed? It would sometimes be nice...