コード例 #1
0
        protected override async Task OnSetObjects(bool isClosing)
        {
            if (isClosing)
            {
                _control?.DetachViewModel();
                return;
            }

            //viewModel can be non-null when the configuration is changed.
            _control ??= CreatePropertyPageControl();

            _viewModel         = CreatePropertyPageViewModel();
            _viewModel.Project = UnconfiguredProject;
            await _viewModel.InitializeAsync();

            _control.InitializePropertyPage(_viewModel);
        }
コード例 #2
0
        protected async override Task OnSetObjects(bool isClosing)
        {
            if (isClosing)
            {
                _control.DetachViewModel();
                return;
            }
            else
            {
                //viewModel can be non-null when the configuration is chaged.
                if (_control == null)
                {
                    _control = CreatePropertyPageControl();
                }
            }

            _viewModel         = CreatePropertyPageViewModel();
            _viewModel.Project = UnconfiguredProject;
            await _viewModel.Initialize().ConfigureAwait(false);

            _control.InitializePropertyPage(_viewModel);
        }