WPF 动态加载用户控件
//这里可以动态加载其他dll文件中的组件 Assembly assem = Assembly.LoadFile($"{Directory.GetCurrentDirectory()}\\{data.DllName}"); var onePage = assem.CreateInstance(data.ClassName); ClosableTab theTabItem = new ClosableTab(); theTabItem.Content = onePage; theTabItem.Title = data.Title; myTabControl.Items.Add(theTabItem); theTabItem.Focus();