Microsoft.VisualStudio.R.Package.ProjectSystem.PropertyPages.PropertyPageControl.InitializePropertyPage C# (CSharp) Method

InitializePropertyPage() public method

public InitializePropertyPage ( PropertyPageViewModel viewModel ) : void
viewModel PropertyPageViewModel
return void
        public virtual void InitializePropertyPage(PropertyPageViewModel viewModel) {
            _ignoreEvents = true;
            IsDirty = false;
            ViewModel = viewModel;
            ViewModel.PropertyChanged += ViewModel_PropertyChanged;
            ViewModel.ParentControl = this;
            _ignoreEvents = false;
        }

Usage Example

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

            _viewModel = CreatePropertyPageViewModel();

            await _viewModel.Initialize();

            _control.InitializePropertyPage(_viewModel);
        }