Click here to Skip to main content
15,903,012 members
Home / Discussions / C#
   

C#

 
GeneralRe: Linking the scroll bars of two controls Pin
BobJanova17-Aug-11 0:03
BobJanova17-Aug-11 0:03 
GeneralRe: Linking the scroll bars of two controls Pin
Dewald17-Aug-11 0:34
Dewald17-Aug-11 0:34 
GeneralRe: Linking the scroll bars of two controls Pin
BobJanova17-Aug-11 3:11
BobJanova17-Aug-11 3:11 
GeneralRe: Linking the scroll bars of two controls Pin
Dewald17-Aug-11 4:00
Dewald17-Aug-11 4:00 
Questionhow to send file from Windows-CE to PC Through Socket Pin
goldsoft16-Aug-11 2:55
goldsoft16-Aug-11 2:55 
AnswerRe: how to send file from Windows-CE to PC Through Socket Pin
BobJanova16-Aug-11 4:36
BobJanova16-Aug-11 4:36 
QuestionAccessing dataset throughout application. Pin
paper6716-Aug-11 2:48
paper6716-Aug-11 2:48 
AnswerRe: Accessing dataset throughout application. Pin
BobJanova16-Aug-11 4:34
BobJanova16-Aug-11 4:34 
Your application should have a data model somewhere. Ignore the UI for the moment and think about the business logic and the data layer. Typically your main application class (this is often MainForm, though if one is being strict it shouldn't be) will have a reference to a data model – for a simple application this might just be the data set.

Any UI views that refer to the data model should then be given a reference to it, possibly via a view-model (or presenter or similar) class if the binding process is more complex than being a direct editor of some part of the data model. Anything more than simple updates should be done with logic in the model layer, which is why you may need to write a class instead of just using a data set.

So the short answer is, put it in your main form class or your application class, if you have one, and pass a reference to it to the MDI children when they are created. But I would like you to understand why that is a good idea and how to extend it to more complex view/model situations.
QuestionLucene.Net:Using Whitespace analyser wildcardquery is not working Pin
NarVish16-Aug-11 1:47
NarVish16-Aug-11 1:47 
AnswerRe: Lucene.Net:Using Whitespace analyser wildcardquery is not working Pin
Mehdi Gholam6-Sep-11 17:53
Mehdi Gholam6-Sep-11 17:53 
QuestionBoolean conversion Pin
5fingers16-Aug-11 0:28
5fingers16-Aug-11 0:28 
GeneralRe: Boolean conversion Pin
Richard MacCutchan16-Aug-11 1:11
mveRichard MacCutchan16-Aug-11 1:11 
GeneralRe: Boolean conversion Pin
5fingers16-Aug-11 1:23
5fingers16-Aug-11 1:23 
GeneralRe: Boolean conversion Pin
Richard MacCutchan16-Aug-11 5:42
mveRichard MacCutchan16-Aug-11 5:42 
GeneralRe: Boolean conversion Pin
5fingers16-Aug-11 19:38
5fingers16-Aug-11 19:38 
GeneralRe: Boolean conversion Pin
Richard MacCutchan16-Aug-11 22:22
mveRichard MacCutchan16-Aug-11 22:22 
GeneralRe: Boolean conversion Pin
5fingers17-Aug-11 0:57
5fingers17-Aug-11 0:57 
GeneralRe: Boolean conversion Pin
BobJanova17-Aug-11 0:11
BobJanova17-Aug-11 0:11 
GeneralRe: Boolean conversion Pin
5fingers17-Aug-11 0:55
5fingers17-Aug-11 0:55 
AnswerRe: Boolean conversion Pin
BobJanova16-Aug-11 1:14
BobJanova16-Aug-11 1:14 
GeneralRe: Boolean conversion Pin
5fingers16-Aug-11 5:23
5fingers16-Aug-11 5:23 
AnswerRe: Boolean conversion Pin
Dan Mos16-Aug-11 1:36
Dan Mos16-Aug-11 1:36 
GeneralRe: Boolean conversion Pin
5fingers16-Aug-11 5:25
5fingers16-Aug-11 5:25 
QuestionWhy does this not change my string? Pin
stephen.darling15-Aug-11 11:44
stephen.darling15-Aug-11 11:44 
AnswerRe: Why does this not change my string? Pin
Dave Kreskowiak15-Aug-11 11:49
mveDave Kreskowiak15-Aug-11 11:49 

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.