Removing codebehind files from WPF MVVM projects -
I'm coding a WPF application using the MVVM pattern. I do not need codebind files for my user controls. What's the best way to get these files beautifully?
I can create a user control class, then I can use this class for all my ideas. (For more information :)
Are there any alternative ways?
Thank you.
I do not think you call the initialize component (answering your question about alternate options) Can not use reflection to do. There are advantages and drawbacks to avoid code-back, I see that one of the benefits is that double-clicking on any control does not work, neither in Blend or Visual Studio. This "army" is not enough to "make it" quickly for some "actions".
On the other hand, it is difficult to "fix" correctly to verify something, so it is your business to decide on.
Code-laying around the back is wrong, I have almost no code in my current major projects- 20% of XALM files, in the remaining I have not removed them yet (yet) .
You can apply drag-and-drop depending on the code-behind logic, I 've done it with my Silverlight 4 project, which used to be out- Some actions need to be handled when running a browser.
Depending on your MVVM-implementation and framework, you can visualize your visualization. However, if possible, it should be avoided, sometimes it is not a viable solution. For example, Calibern.micro provides you with a clear way of implementing the Viviewware interface and seeing the GetView method.
Comments
Post a Comment