예제 #1
0
        private void WpfPropertyPage_Load(object sender, EventArgs e)
        {
            SuspendLayout();

            host          = new PropertyPageElementHost();
            host.AutoSize = false;
            host.Dock     = DockStyle.Fill;

            if (control == null)
            {
                control = CreatePropertyPageControl();
            }

            ScrollViewer viewer = new ScrollViewer
            {
                VerticalScrollBarVisibility   = ScrollBarVisibility.Auto,
                HorizontalScrollBarVisibility = ScrollBarVisibility.Auto
            };

            viewer.Content = control;
            host.Child     = viewer;

            wpfHostPanel.Dock = DockStyle.Fill;
            wpfHostPanel.Controls.Add(host);

            ResumeLayout(true);
            control.StatusChanged += OnControlStatusChanged;
        }
예제 #2
0
        protected async override Task OnSetObjectsAsync(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.UnconfiguredProject = UnconfiguredProject;
            await viewModel.InitializeAsync().ConfigureAwait(false);

            control.InitializePropertyPage(viewModel);
        }