public void TryAddToolbox(T key, System.Windows.Controls.UserControl data)
 {
     if (data != null && data.DataContext is DataModel == false)
     {
         throw new ArgumentException($"The plug-in ({data.GetType().Assembly.FullName}) is not compatible with this framework");
     }
     __toolbox_collection.TryAdd(key, data);
     __tooldata_collection.TryAdd(key, data.DataContext as DataModel);
 }
Esempio n. 2
0
        public WpfHostingWinForm([NotNull] UserControl wpfControl)
        {
            _wpfControl = wpfControl;

            InitializeComponent();

            string contextId = _wpfControl.GetType().Name;

            _formStateManager = new FormStateManager <FormState>(this, contextId);
            _formStateManager.RestoreState();
        }
Esempio n. 3
0
        public TaskPaneControl(System.Windows.Controls.UserControl userControl, string name)
        {
            var controlHost = new TaskPaneWpfControlHost();

            this.userControl = userControl;
            if (userControl.GetType().Name.Equals("Settings"))
            {
                var control = userControl as UI.Settings.Settings;
                control.ParentControl = this;
            }

            controlHost.WpfElementHost.HostContainer.Children.Add(userControl);
            control   = controlHost;
            this.name = name;
        }