Silverlight gridsplitter不向左滑动

时间:2014-02-21 00:06:14

标签: silverlight xaml

这是axml。当我向右滑动左侧网格宽度变化时,它有一种奇怪的行为。但是,我似乎无法向左滑动。

 <Grid x:Name="LayoutRoot" Background="White">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.35*" />
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>



        <Grid Width="auto" Grid.Row="0" Grid.Column="0">
            <ListBox  Style="{StaticResource ListBoxStyle1}" ItemContainerStyle="{StaticResource ListBoxItemStyleWhite}"  x:Name="listbox" Grid.Row="1" ItemsSource="{Binding Documents}" 
                      HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch" VerticalContentAlignment="Stretch" VerticalAlignment="Stretch" ItemTemplate="{StaticResource ListboxTempalte}" >
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                        </StackPanel>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
            </ListBox>
        </Grid>

        <sdk:GridSplitter Grid.Row="0" Grid.Column="1"
                           HorizontalAlignment="Right" 
            VerticalAlignment="Stretch"                         
                          ></sdk:GridSplitter>

            <Grid  Grid.Row="0"  x:Name="targetPanel" Grid.Column="2" Canvas.ZIndex="5" Background="White">
            <ig:DragDropManager.DropTarget>
                <ig:DropTarget IsDropTarget="True" />
            </ig:DragDropManager.DropTarget>
            <controls:BusyIndicator IsBusy="{Binding IsBusy, Mode=OneWay}"
                                    BusyContent="{Binding ConverterParameter=BusyIndicator_Content, Converter={StaticResource Localization}, Source={StaticResource Localization}}">

                <divElement:HtmlHost x:Name="HtmlViewer" SourceUri="{Binding SourceUri,Mode=OneWay}" DocumentReady="HtmlViewer_DocumentReady"/>
            </controls:BusyIndicator>

        </Grid>
    </Grid>

1 个答案:

答案 0 :(得分:0)

尝试将Horizo​​ntalAlignment设置为Stretch:

    <sdk:GridSplitter Grid.Row="0" Grid.Column="1"
        HorizontalAlignment="Stretch" 
        VerticalAlignment="Stretch">
    </sdk:GridSplitter>