WPF If a user control needs to be provided with a ViewModel

I am going to use a user control developed by another team (in the same company), and for the developed application we are trying to describe all the data bindings in XAML.

Now, if I use a third-party user control, should I expect them to provide the underlying ViewModel with hooks for my code, or should I write code to bind the user control to the ViewModel of my choice?

Greetings

AWC

+3
source share
3 answers

UserControl. , , , ViewModel.

ViewModel, , , , . ViewModel , . - WPF .

, ViewModel - . , .

+3

. , , . :)

+1

. viewmodel , , , , .

, , ( ) ( ). - , .

But, saying that not every control will need its own viewmodel, you should instead use the provided control as part of a larger user control and write a view model for that larger control.

+1
source

Source: https://habr.com/ru/post/1726226/


All Articles