Ejemplo n.º 1
0
        void LoadModel(string fileName)
        {
            ControlLoader loader  = new ControlLoader(fileName);
            Control       control = loader.LoadControl();

            _currentViewModel = new ViewModel(loader.DesignerFilename, control);

            if (control is Form form)
            {
                form.TopLevel = false;
                form.Left     = 0;
                form.Top      = 0;
                form.Show();
            }

            formPanel.Controls.Add(control);

            _currentViewModel.CurrentSelectionChanged += OnCurrentSelectionChanged;
        }