public override void CreateViewModel() { if (UseEmptyViewModel || string.IsNullOrEmpty(ViewModelInitValueJson)) { VM = new FirstViewModel(); } else { VM = JsonConvert.DeserializeObject <FirstViewModel> (ViewModelInitValueJson); ViewModelPropertyRef(); } VM.AddHostView(ViewModelBase.DefaultViewBaseKey, this); }
public override void Initialize(ViewModelBase viewModel) { if (viewModel != null) { VM = (FirstViewModel)viewModel; VM.AddHostView(ViewModelBase.DefaultViewBaseKey, this); } else { if (AutoCreateViewModel && VM == null) { CreateViewModel(); } } base.Initialize(VM); }