c# - Start controller from Program.cs instead of form -
i want build application in c#, using mvc pattern. want first create instance of controller , pass form parameter.
here normal c# way (default):
static void main() { application.enablevisualstyles(); application.setcompatibletextrenderingdefault(false); application.run(new mainform(new controller())); }
the problem don't want mainform class able access controller. want controller "see" other objects.
i want this:
static void main() { controller cnt = new controller(new mainform()); application.enablevisualstyles(); application.setcompatibletextrenderingdefault(false); application.run(cnt); }
this doesn't work though, because method run takes either form argument or applicationcontent. how can this?
Comments
Post a Comment