Click here to Skip to main content
15,888,527 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: designing a good way enable/disable controls Pin
Giorgi Dalakishvili13-Nov-08 0:46
mentorGiorgi Dalakishvili13-Nov-08 0:46 
GeneralRe: designing a good way enable/disable controls Pin
giddy_guitarist13-Nov-08 4:39
giddy_guitarist13-Nov-08 4:39 
GeneralRe: designing a good way enable/disable controls Pin
Ray Cassick14-Nov-08 9:56
Ray Cassick14-Nov-08 9:56 
AnswerRe: designing a good way enable/disable controls Pin
Jani Giannoudis15-Nov-08 5:32
Jani Giannoudis15-Nov-08 5:32 
GeneralRe: designing a good way enable/disable controls Pin
Mycroft Holmes15-Nov-08 23:31
professionalMycroft Holmes15-Nov-08 23:31 
AnswerRe: designing a good way enable/disable controls Pin
CodingYoshi15-Nov-08 7:38
CodingYoshi15-Nov-08 7:38 
GeneralRe: designing a good way enable/disable controls Pin
giddy_guitarist15-Nov-08 19:27
giddy_guitarist15-Nov-08 19:27 
GeneralRe: designing a good way enable/disable controls Pin
CodingYoshi15-Nov-08 22:12
CodingYoshi15-Nov-08 22:12 
UI controls, whether the main form or the User Control is just a mechanism to allow a user to interact with the underlying. What I do not understand is why you want the user control to enable/disable main forms controls: They must know about each others controls and adds to coupling which is not ideal. If you want a menu item to enable/disable based on customer's last day or whatever, then have both the main form and the user control subscribe to the customer. UserControl will do what it is supposed to do and main form will do what it is supposed to do. Now these UI elements only know about the "thing", in this case the Customer, they are displaying but not about each other.

It will be like this: Customer is loaded and obviously properties will change, then the UI Control will subscribe to an event from customer--you have to create the events based on your requirements. In this handler, the control will ask the customer for whatever it is interested in, for example, IsLastDayOfStay, if true will enable itself and false otherwise. The main form will also subscribe, and ask for something else and mold itself accordingly. You can also design it so the form does not need to ask the Customer, but the event arguments can have the information in it. For this, you would need to create a simple class to encapsulate even arguments.

The only problem is the controls are tied to your object.

If I am not understanding what you want to do, then just write in plain English with no code what it is you want to achieve and hopefully I or someone else can give you a suggestion.
GeneralRe: designing a good way enable/disable controls Pin
giddy_guitarist15-Nov-08 22:25
giddy_guitarist15-Nov-08 22:25 
QuestionDatabase Engine Independant Data Modelling Pin
Brady Kelly7-Nov-08 5:03
Brady Kelly7-Nov-08 5:03 
AnswerRe: Database Engine Independant Data Modelling Pin
User 17164927-Nov-08 8:00
professionalUser 17164927-Nov-08 8:00 
AnswerRe: Database Engine Independant Data Modelling Pin
Eduardo B16-Nov-08 13:51
Eduardo B16-Nov-08 13:51 
GeneralPart One of a Series on Replicating Validation Logic Between Client and Server [modified] Pin
Brady Kelly7-Nov-08 3:42
Brady Kelly7-Nov-08 3:42 
QuestionHi there :) Please help me Pin
viashivan5-Nov-08 5:05
viashivan5-Nov-08 5:05 
AnswerRe: Hi there :) Please help me Pin
Vimalsoft(Pty) Ltd17-Nov-08 19:55
professionalVimalsoft(Pty) Ltd17-Nov-08 19:55 
QuestionData structure design Pin
hpjchobbes3-Nov-08 5:57
hpjchobbes3-Nov-08 5:57 
AnswerRe: Data structure design Pin
Ray Cassick3-Nov-08 6:13
Ray Cassick3-Nov-08 6:13 
GeneralRe: Data structure design Pin
hpjchobbes3-Nov-08 6:51
hpjchobbes3-Nov-08 6:51 
GeneralRe: Data structure design Pin
Ray Cassick3-Nov-08 7:04
Ray Cassick3-Nov-08 7:04 
AnswerRe: Data structure design Pin
Mark Churchill3-Nov-08 13:56
Mark Churchill3-Nov-08 13:56 
GeneralRe: Data structure design Pin
hpjchobbes4-Nov-08 16:55
hpjchobbes4-Nov-08 16:55 
GeneralRe: Data structure design Pin
Mark Churchill4-Nov-08 17:19
Mark Churchill4-Nov-08 17:19 
AnswerRe: Data structure design Pin
Arash Partow4-Nov-08 23:04
Arash Partow4-Nov-08 23:04 
AnswerRe: Data structure design Pin
CodingYoshi15-Nov-08 8:21
CodingYoshi15-Nov-08 8:21 
QuestionBest Practices for Code Organization Pin
minus_one30-Oct-08 21:37
minus_one30-Oct-08 21:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.