0

I am new to WPF but actually I need to code in it.

I have got a **UserControl(Window)** and there is a DataGrid in it. DataGrid can be used somewhere else in the future, but not 100% sure. Me and one of my collegue need to work in the same module, the best would be if my collegue would work in the Window and I would work in the DataGrid. Btw. use MVVM pattern.

Question:

Can I - and more important -, should I separate DataGrid by creating another UserControl and there will be two UserControls(1.UserControl is Window, 2.UserControl is DataGrid) and later we integrate them. What is the practice in WPF?

  • 2
    Are you using MVVM or code behind? – JanDotNet Mar 26 at 8:59
  • Yes, using MVVM – koviroli Mar 26 at 10:13
1

Usually, I (single developer) start with putting all things into the window, and if the UI grows, I extract reasonable parts of the UI into separate views / view models. Sometimes (depending on complexity of the XAML code) I start with separating just the view models (because thats the place where the actual UI-logic is) and let the XAML code in a single file.

However, if you are working with more then one person on the UI, it makes sense to separate the parts from the beginning. Another option is (maybe that is what you mean with "integrate them later") that you implement the data grid functionality within a protoype in a completly separate project. That may be a good option if you are still experimentig with the control.

If possible, I would prefer a model where one guy implements the UI and another implements the business logic which requires that the business logic is separated from the UI ;).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.