WPF和WINFORM的互操作
在WPF中使用Winform控件 <Window x:Class= "WPFApplication.Window1" xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x= "http://schemas.microsoft.com/winfx/2006/xaml" xmlns:winforms= "clr-namespace:WindowsFormsControl;assembly=WindowsFormsControl" xmlns:my= "clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" Title= "Window1" Height= "300" Width= "300" > <Grid> <my:WindowsFormsHost Name= "windowsFormsHost1" > <winforms:UserControl1 x:Name= "myControl" ButtonText= "Click me!" /> </my:WindowsFormsHost> </Grid> </Window> 其中xmlns:winforms=…为导入命名空间和程序集名称