先增加DLL 支持
使用 WindowsFormsHost 来加载Forms的控件
引用命名空间
xmlns:forms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
<WindowsFormsHost Grid.Column="1">
<forms:PropertyGrid x:Name="Property">
</forms:PropertyGrid>
</WindowsFormsHost>
效果
代码
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="322*"/>
<ColumnDefinition Width="195*"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="TextBlock" TextWrapping="Wrap" Text="TextBlock" />
<WindowsFormsHost Grid.Column="1">
<forms:PropertyGrid x:Name="Property">
</forms:PropertyGrid>
</WindowsFormsHost>
</Grid>
public MainWindow()
{
InitializeComponent();
Property.SelectedObject = TextBlock;
}