Ejemplo n.º 1
0
        public WpfHost(string controlName)
        {
            InitializeComponent();

            // Could this be from a list of supported PlugIns ???
            switch (controlName)
            {
            case "UserControl1":
                UserControl1 _uc1 = new UserControl1();
                _uc1.InputValue = "Hello #1";
                _uc1.InitializeComponent();
                elementHost1.Child    = _uc1;
                _uc1.OnOkButtonClick += OnWpfOkButtonClick;
                break;

            case "UserControl2":
                UserControl2 _uc2 = new UserControl2();
                _uc2.InputValue = "Hello #2";
                _uc2.InitializeComponent();
                elementHost1.Child    = _uc2;
                _uc2.OnOkButtonClick += OnWpfOkButtonClick;
                break;
            }
            this.Text = $"WpfHost for {controlName}";
        }