I understand that commands can be triggered off certain events of certain controls. For example, specifying a Command for a Button will trigger it off the Click event. But what if I wanted to trigger a command off of a different event -- like a Load event Is there a way to do this at all If so, can I do it from XAML only

Executing Commands from *any* event
hfann
MarilynJ
Yes, that would be a very useful utility. Thanks Mike!
Gilles Lafreniere
Yabadabadooo
Create a handler for the event and call RoutedCommand.Execute within your handler. I'm not sure if you should call CanExecute first or if Execute will check for you. (To err on the safe side call CanExecute first.)
If you want this to be done strictly through XAML, you would need to derive a class from TriggerAction that fires a command and add it to an EventTrigger within XAML. If people think this utility would be useful, I could add it as a WorkItem for the WPF Toolbelt project.
mig16
This is the feedback from Msft on the issue
Looks like we won't get it with V1
remedios_
I would find this useful...
Maciej Koper
I looked into this further, and it doesn't seem that deriving from TriggerAction will work, since TriggerAction class is "public abstract" but it has 2 "internal abstract" methods [2 overloads for Invoke].
Any plans from MS to change this This could be really useful...
arch_angel81
Pure Krome