Jump to content

Avoiding Circular Dependency

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
USSDeveloper

USSDeveloper

    Newbie

  • Members
  • Pip
  • 1 posts
I have a four projects in a solution AllianceControl
-MainMenu
-BackflowControl
-UMS
-CounterReceipts

MainMenu Serves as launchboard for all the different projects as refrences them all to get at the controls to launch in a tab control:
BackflowControl -> MainMenu
UMS -> MainMenu
CounterReceipts -> MainMenu


EX:
Datagrid picture by USSDeveloper - Photobucket

This setup worked perfectly while I had just needed the refrence one way. But I came across a problem when I needed to add a new feature. Say I'm in BackflowControl
and want to load account information off of a datagrid double click. This double click would open a new tab in the collection I have going on. My problem is that the
functionality and collection is stored in my main menu since that is the launching point. I understand of course that you can't refrence the Mainmenu from the controls
(this would cause circular dependancy) but how would I be able to get at the function (or collection of tabs) to create a new tab in that collection?

#2
gokuajmes

gokuajmes

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 518 posts
I coudn't get a clear understanding of what was the problem or I seem to be too dumb for such a question as these :p
Could you please attach the file with the above post

#3
Davide

Davide

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 506 posts
Create a method in MainMenu that returns what you need, then use it to get the values from MainMenu to you BackflowControl.
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics

#4
Davide

Davide

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 506 posts
Create a method in MainMenu that returns what you need, then use it to get the values from MainMenu to your BackflowControl.
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics