Managing Custom Add/Edit Modal Windows. Revised with IOC extension class.

After posting and commenting on the previous sample I knew it should be improved as the term "Worker Class" used in the introduction was killing me. Worker Class is so not compatible with extensibility, at least in my head. So here is the same logic implemented as an extension

C# (1.5 MB)
4.6 Star
2,434 times
Add to favorites
E-mail Twitter Digg Facebook
Sign in to ask a question

  • More than one modal dialog per LS screen
    2 Posts | Last post August 30, 2011
    • I'm still building my understanding of your solution and have the following question. With your solution could I on a single screen have your solution support more than one dialog box? For example let say that we have a screen that keeps track of companies, with fields like city, province/state and country. Each of those fields would be combo box with a link that would allow the user to add a new city without first having to jump to a different screen and add the city there.
    • Hi Terry
      I see your point. In order to achieve this you will have to make some modifications that might need to use reflection and change the whole concept, but it's not very hard to do. Actually if you see the other similar post that is not implemented with IOC extensions but using a helper class you will get the idea.
      A solution like the one you are asking for would have to dinamically pass the object to be edited and the name of the control to be used to the manipulation class/methods instead of having the screen implement a specific interface.
      In general it's quite a different implementation, quite interesting though. I might try implementing this in the near future as apart from being very usefull, working on issues like this one makes one's understanding of LightSwitch better. Right now I am working on a small project having to do with LS security and screen permissions, but as soon as I am done with this I see into this issue and depending on my availability and usefullness of something like that to my projects I might implement it.
  • CurrentColor object
    2 Posts | Last post August 29, 2011
    • Kostas
      I'm trying to understand your solution, and have a question reguarding what I think is a table called "CurrentColor" found on the screen ColorListWithDetail.
      How did you create that table ?
      I have tried using Add Data Item, with the result that my table is read only which causes the method CurrentObject to error. 
    • Kostas
      I answered my own question about 2 seconds after I posted  :)
      I'm sure that I'll have other questions as I dive more into your solution to the model window
  • Blank Extension is Missing Unable to RUN
    5 Posts | Last post August 28, 2011
    • Hi,
      I am unable to run the downloaded project as blank extension is missing.
      Please sugegst how to include.
    • Hi Rama
      The blank extension is not needed by the project. Maybe it's left-over from expirimenting. You can download the black extension solution, here
    • The above link is wrong, sorry for that, try this one
    • VB 
    • Is this a question? VB? If so, I don't know in what language is the link I sent, but you shouldn't care. You just build and install. Either way there is a much easier way to build as I have already explained this is not needed in the project, it was left over as inclusion so all you have to do is go to properties and uncheck.