Relatively new to windows programming especially in WPF for office's in-house application. Would like to know for those who have done WPF, is it normal to have MainWindow.xaml.cs to be a huge file (probably more than a thousand lines of code) due to validation rules and some computation for display?
Am coming from J2EE background on servlet and some simple .Net mobile apps so not sure if I'm doing right, since for web-app validation can be done on the webpage itself than throwing everything to classes.
The need to factorise your codes and also to be modular are practices in any proper development exercises. It is not just Java or .NET. It is also not limited to web development or native application or even firmware development.
Using any encapsulating constructs offered by the programming languages may it be structure, classes, different modules, libraries and so forth are encouraged if you want your codes to be easily maintained and easy for other developers to follow up or even for yourself to carry on after weeks or months of not working on it.
Any web development not following these practices are either sloppy works, patchy works or just not doing it right. If you want your validation routines to be usable across various entry points of your web frameworks, you should consider placing them in libraries or different classes. Any programming languages that able reference to other codes via import or include or any form of modular programming will make it possible for you to do so.
If your validation codes are copy and paste across various webpages, then you should consider refactorise them.
A class having a few thousands lines is not wrong, but you have to ask yourself if you have did all you can within reasonable time frame and effort to refactor as and when possible. At the end of the day, it is about operational efficiency and on-going development works that makes you required to spend extra effort to maintain the readability of your codes.
I hope it is clear for you