Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wiring up commands
Message
From
07/05/2009 14:25:18
 
 
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01398201
Message ID:
01398428
Views:
40
>Am I missing something simple?
>
>I had a form where I wired up some of the ready-built commands in the forms CommandBindings and implemented the CanExecute and Executed methods.
>
>A canvas class creates a context menu and assigns commands to MenuItems.
>All working fine.
>
>Now I've created a UserControl which contains the canvas and moved all the command related logic to it rather than the form but now the ICommand methods don't fire. Top of my head I can't see why there should be a difference but it's knocking off time and the pub beckons. Any suggestions as to the cause are welcome....
>
>TIA,
>Viv

Where are your Focus scopes set? (I know we had a long discussion of this a while back. So maybe I'm not getting the problem.)

If your menu is in the same focus scope as the form the commands are just traveling back up the path to the menu item.

I think the wording I came up with was that the command travels the path to the item with keyboard focus in the focus scope of the form.

HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform