c# - Referencing a different project in the same assembly, different namespaces -


I have two projects: menus and modules and they are both in the same namespace Fobourg.

i is currently referring to the module project from the menu project to open some controls on the tab control in my menu, although I need to launch a new control from one of my controls that is located in the module project is.

When I try to reference the menu project, then when I try it does not appear in my intelligence, to use it, to give context, do I have to do something wrong I am doing here? Here is what it is:

Project menu

 
P> Project Module / P>
  // What I would like to do but work in using the menu does not; ... ... ... Private Zero dgModule_MouseDoubleClick (Object Sender, MouseButtonEventArgs E) {Menu.LaunchWPFControl ("Accounts", "AccountsControl"); }  

If you talk about different projects If you are trying to do here is a circular reference, this is not allowed if the project menu references the project module, then the project module can not reference the project menu.

If you need a category in the project module to trigger something in the menu project, then you need to find an alternate way of doing it. To achieve this, a possible technique is to create an event in the class in the module project that can subscribe to the Menu Project and take necessary action.

For example in the Project Module:

  Private zero dgModule_MouseDoubleClick (Object Sender, MouseButtonEventArgs e) {OnMyEvent (); } Private Zero OnMyEvent () {EventHandler localEvent = MyEvent; If (local event! = Null) {local avent (this, event.release.apt); }}  

Then you can subscribe to this event in the Project menu and take your actions:

  ... ... .. .moduleClass.MyEvent + = SomeHandler; ... ... ... Private Zero SomeHandler (Object Sender, EventArgs e) {Menu.LaunchWPFControl ("Accounts", "AccountsControl"); }  

Ray Burn is mentioned as (see comments) Another way to share the interface of the menu share class to some shared space (either project referred to or any other shared project) You have to define that you can implement the module project of that interface.

The way that is better, depends on what you are trying to achieve with each project.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -