我的 WPF 应用程序需要一个 propertyGrid。经过大量搜索后,我发现了这一点 ,当我将 propertyGrid 添加到表单并运行它时,我添加了程序集(exe 文件)并在表单中看不到它。xml代码:
<Window x:Class="propertyGridTest.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpg="clr-namespace:Deepforest.WPF.Controls;assembly=WPGDemo"
Title="Window1" Height="300" Width="300">
<Grid>
<Button x:Name="btn" Click="btn_Click" Height="35.5" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="55"></Button>
<wpg:PropertyGrid x:Name="property" Width="100" Height="100"> </wpg:PropertyGrid>
</Grid>
</Window>
后面的代码:
private void btn_Click(object sender, RoutedEventArgs e)
{
property.Instance = btn;
}
请帮我找出为什么它不可见