예제 #1
0
        public override void CreateViewModel()
        {
            if (UseEmptyViewModel || string.IsNullOrEmpty(ViewModelInitValueJson))
            {
                VM = new FirstViewModel();
            }
            else
            {
                VM = JsonConvert.DeserializeObject <FirstViewModel> (ViewModelInitValueJson);
                ViewModelPropertyRef();
            }

            VM.AddHostView(ViewModelBase.DefaultViewBaseKey, this);
        }
예제 #2
0
        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);
        }