1

I have a program that at its heart is just a fancy Keyboard hook and wedge. The keyboard hook portion is a separate library from the main program. In the main program I gather all the keys that i want to monitor from a config file and instantiate the keyboard hook. The keys that I am monitoring have tasks that they can perform when the key is pressed and/or when it is released. (Tasks such as open a program, turn on a scanner..etc) Since the project started in Winforms I felt that it would be a good idea to make a folder in this library called Controls. I made a dialog Form that a user could select what task they wanted to perform. There has been a need for me to switch from Winforms to WPF. So it is nothing to add Winform controls to a class library. From trial and error it appears that doing the same thing for WPF user controls is a different story. So I decided it would be easier to just created a new WPF Usercontrol project. (If it is possible can you please leave a comment about how to?)

So I am new to WPF, and decided that this particular library would be good to use the MVVM pattern to get my feet wet. It is small in that I only have 6 subclasses of Type AbstractTask. Part of me is itching to use Abstract Task my Model. I'm not sure how yet, but I think that it is my Model. I'll have to add a description string field to it for my View, but that shouldn't be a problem. Since atleast one of my Tasks needs extra information (such as RunProgramTask) I figure I should also put a ?Action? in to "verify" that all the correct information is given. again.. that should be easy.

So in the end I have 2 questions.

  1. Does my theory comply with the MVVM pattern?
  2. Should I move all my Hooks and Tasks and such over to the new WPF project and delete the old project? Or should I just delete the Winforms controls out of my library and just imagine that it is one project?
Robert Snyder
  • 2,399
  • 4
  • 33
  • 65
  • 1
    2 - Your application logic should remain independent from the presentation framework, therefore you may just reuse the exsting logic and create a new UI layer. – Federico Berasategui Aug 23 '13 at 15:28
  • 1 - I couldn't tell unless I see some real code and XAML. – Federico Berasategui Aug 23 '13 at 15:28
  • @HighCore Thank you for your insight. The problem with showing code at this point is I have none. I wanted to get some feedback before I spent a long time working just to throw away my code. – Robert Snyder Aug 23 '13 at 15:40
  • 1
    I suggest you read up on [Rachel's Excellent Post](http://stackoverflow.com/a/15684569/643085) and related links about the mind shift required from moving to ancient winforms to WPF. – Federico Berasategui Aug 23 '13 at 15:42

0 Answers0