infragistics - xamDockManager - ContentPane - 高度未调整

时间:2013-08-30 00:11:28

标签: infragistics contentpane splitpane

我无法在SplitPane中设置ContentPane的高度。我正在使用Auto,但无法相应地设置高度。 我在splitpane中有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>         

2 个答案:

答案 0 :(得分: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>

答案 1 :(得分:0)

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

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

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

此问题一旦有任何进展,我会更新你。