Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在WPF中设置WinForms内容的最小高度和宽度_Wpf_Winforms_Charts_Contentcontrol - Fatal编程技术网

在WPF中设置WinForms内容的最小高度和宽度

在WPF中设置WinForms内容的最小高度和宽度,wpf,winforms,charts,contentcontrol,Wpf,Winforms,Charts,Contentcontrol,我有一个正在WPF中使用的WinForms图表 我无法轻松访问WinForms图表代码,因此我试图通过WPF.xaml代码找到解决方案 内容大小由网格拆分器的移动决定 问题是WinForms图表中可能有一个最小高度,这会导致WinForms图表覆盖我的WPF窗口内容 以下是我在WPF中使用WinForms图表的方式: <UserControl x:Class="Gui.Modules.Common.Chart.ChartSeriesView" xmlns="htt

我有一个正在WPF中使用的WinForms图表

我无法轻松访问WinForms图表代码,因此我试图通过WPF.xaml代码找到解决方案

内容大小由
网格拆分器的移动决定

问题是WinForms图表中可能有一个最小高度,这会导致WinForms图表覆盖我的WPF窗口内容

以下是我在WPF中使用WinForms图表的方式:

<UserControl x:Class="Gui.Modules.Common.Chart.ChartSeriesView"
             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:attachedProperties="clr-namespace:Gui.Core.AttachedProperties;assembly=Gui.Core"
             xmlns:common="clr-namespace:Gui.Modules.Common" mc:Ignorable="d"
             d:DataContext="{x:Static common:DesignData.ChartSeriesViewModel}"
             d:DesignHeight="300" d:DesignWidth="300"
             >
  <Grid>
    <ContentControl x:Name="ChartContentControl" attachedProperties:Win32Keeper.Control="{Binding Chart}"/>    
  </Grid>
</UserControl>


尝试将图表控件放置在不熟悉“attachedProperties”行为的ViewBox中,但。。。为什么要将WinForms控件放入WPF ContentControl?为什么不使用WindowsFormsHost控件?