Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Wiring up commands
Message
De
07/05/2009 14:25:18
 
 
À
06/05/2009 14:51:28
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01398201
Message ID:
01398428
Vues:
41
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform