0

我无法在 SplitPane 中设置 ContentPane 的高度。我正在使用自动,但它无法相应地设置高度。我在拆分窗格中有 2 个内容窗格。我需要两个相对大小的内容窗格。高度应取决于内容窗格的内容。有什么建议么?请看我的代码:

         <igDock:XamDockManager Theme="Office2010Blue" Height="Auto">
            <igDock:XamDockManager.Panes>
                <igDock:SplitPane Name="dockedLeft" igDock:XamDockManager.InitialLocation="DockedLeft" Height="Auto">
                    <igDock:ContentPane x:Name="leftEdgeDock" Header="Reports">
                        <TreeView Width="Auto" DockPanel.Dock="Left" ItemsSource="{Binding Folders}" Height="Auto" Padding="0,0,20,20" MinWidth="100">
                            <TreeView.ItemContainerStyle>
                                <!-- 
                                    This Style binds a TreeViewItem to a TreeViewItemViewModel. 
                                    -->

                                <Style TargetType="{x:Type TreeViewItem}">
                                    <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
                                    <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
                                    <Setter Property="FontWeight" Value="Normal" />
                                    <Style.Triggers>
                                        <Trigger Property="IsSelected" Value="True">
                                            <Setter Property="FontWeight" Value="Bold" />
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </TreeView.ItemContainerStyle>

                            <TreeView.Resources>

                                <HierarchicalDataTemplate DataType="{x:Type vm:ReportFolderViewModel}" ItemsSource="{Binding Children}">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Width="16" Height="16" Source="/InsurableRisk.Reporting;component/Resources/Images/foldr_16.gif" />
                                        <Label Content="{Binding FolderName}" />
                                    </StackPanel>
                                </HierarchicalDataTemplate>

                                <HierarchicalDataTemplate DataType="{x:Type vm:ReportInfoViewModel}" ItemsSource="{Binding Children}">

                                    <StackPanel Orientation="Horizontal">
                                        <Image Width="16" Height="16" Source="/InsurableRisk.Reporting;component/Resources/Images/reports_16.gif" />
                                        <TextBlock Text="{Binding ReportName}" Margin="0,4,0,4" Padding="4,0,4,0" />
                                    </StackPanel>

                                </HierarchicalDataTemplate>

                            </TreeView.Resources>

                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="SelectedItemChanged">
                                    <i:InvokeCommandAction Command="{Binding SelectReportCommand}" CommandParameter="{Binding Path=SelectedItem, RelativeSource={RelativeSource AncestorType={x:Type TreeView}}}"/>
                                </i:EventTrigger>
                            </i:Interaction.Triggers>

                        </TreeView>
                    </igDock:ContentPane>
                </igDock:SplitPane>
                <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedTop" SplitterOrientation="Horizontal">
                    <igDock:ContentPane x:Name="centerDock" Header="Controls" Height="Auto">
                        <StackPanel Name="controlStackPanel" DockPanel.Dock="Top" Orientation="Horizontal">
                            <ContentControl Height="Auto" Content="{Binding Path=CurrentReport}" />
                            <Button Margin="10,0,0,0" Content="Run Report" Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" Command="{Binding RunReportCommand}" Width="80" />
                            <Button Margin="10,0,0,0" Content="Data To Excel" Height="23" VerticalAlignment="Top" Name="ExportToExcel" Width="110" Command="{Binding RunExcelCommand}" Visibility="{Binding Path=ButtonExportVisibility, Converter={StaticResource BoolToVis}}" />
                        </StackPanel>
                    </igDock:ContentPane>
                    <igDock:ContentPane x:Name="bottomDock" Height="Auto" AllowDocking="False" AllowPinning="False" AllowClose="False" CloseButtonVisibility="Collapsed" WindowPositionMenuVisibility="Collapsed">
                        <ContentControl Name="reportContentControl" Content="{Binding ReportHost}"  />
                    </igDock:ContentPane>
                </igDock:SplitPane>
            </igDock:XamDockManager.Panes>
        </igDock:XamDockManager>         
4

2 回答 2

2

我们的开发人员对此进行了进一步调查,并表示这种行为是预期的,因为 SplitPane 会根据每个窗格的 RelativeSize 的比率来调整和排列窗格。此处的解决方法是为您要使用的每个 ContentPane 使用不同的 SplitPane。这是一个简单的 XAML 代码片段:

<igDock:XamDockManager >
    <igDock:XamDockManager.Panes>
        <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedTop" >
            <igDock:ContentPane x:Name="centerDock" />
        </igDock:SplitPane>
        <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedTop" >
            <igDock:ContentPane x:Name="bottomDock">
                <Button Content="Data To Excel" Height="23" Name="ExportToExcel" Width="110"  />
            </igDock:ContentPane>
        </igDock:SplitPane>
    </igDock:XamDockManager.Panes>
</igDock:XamDockManager>
于 2013-09-04T06:23:00.340 回答
0

我一直在研究这个问题,并在我们的跟踪系统中与我们的开发人员记录了这种行为。如果您没有,我可以建议您在 Infragistics 社区中创建一个帐户:

http://www.infragistics.com/community/

并发布您与 Infragistics 控件相关的问题,以便您可以从 Infragistics 专家那里获得答案。

此外,一旦在这个问题上有任何进展,我会更新你。

于 2013-09-02T13:01:11.150 回答