Reputation: 176
I have general question about binding in the view of the view model.
We are working on wizard and in the initialize page all the pages are called
before the wizard starts (see the code below) so in the view we are using the following code to do the relation with this.Datacontext = mvm;
, currently when this code is called the objects in the view model which bind to the screen (from the viewModel
) is empty since this called in the beginning of the pages creation but the view model will be updated with data later in the program.
Will the screen be updated with the data when the bounded items are filled?
public partial class EPreviewGraphSelector : UserControl
{
MyViewModel mvm = new viewModel();
public EPreviewGraphSelector()
{
InitializeComponent();
this.Datacontext = mvm;
}
}
Upvotes: 1
Views: 325
Reputation: 564333
does the screen will be updated with the data when the bounded items is filled ?
Provided your ViewModel implements INotifyPropertyChanged
correctly, the UI should update.
Upvotes: 1