I have done quite a bit of research in the last few months and haven't been able to really find a good answer for my question yet:
A little background info: I am new to WPF and was asked to create a project using it. I learned most of the concepts on my own, but am struggling with one major issue. There is just too much code in the MainWindow
class.
The reason there is too much code: There is too much code because all of the events for my UI Elements must be controlled in this one class.
Now I just recently discovered the use of partial classes. So I plan to split the events off into a seperate file. I am just wondering if there is any better way to decrease the size of my MainWindow
class? I haven't been able to find a way to pass controls between classes, because I know it is not good to pass TextBoxes
, or ListBoxes
etc. between classes or methods. (I do understand, however, that you can pass parameters such as textBox1.Text
or similar properties, but that doesn't fix my issue.