我有一个简单的WPF组件,我在定制的行业应用程序中生成并用作插件。但是,我希望用户可以在设计模式下对WPF组件进行扩展。基本上,通过导入WPF组件,用户可以拖放它,但到目前为止它无法调整大小。
这是我的代码:
<base:Element x:Class="ControlForm.TEST"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:base="clr-namespace:TEST.HMI.Controls;assembly=TEST.HMI"
xmlns:dc="clr-namespace:TEST.Controls.Display;assembly=TEST.Controls.Display"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
mc:Ignorable="d"
>
<Grid Height="840" Width="890">
<StackPanel Background="White">
<TextBlock x:Name="Name1" Text="..." FontSize="14"></TextBlock>
<TextBlock x:Name="Name2" Text="..." FontSize="14"></TextBlock>
</StackPanel>
<UserControl Height="600" Width="750" Name="MyControl" Background="Black" Grid.Row="2" Grid.Column="1" >
<WindowsFormsHost Name="Host" Background="Black" Height="500" >
<dc:Display Name="Control2" ShowScrollBars="True" Enabled="true" AutoScroll="True" ShowCustomView="False" />
</WindowsFormsHost>
</UserControl>
</Grid>
</base:Element>