每当有水平滚动时,UWP Splitview都不响应

时间:2019-04-26 09:22:44

标签: xaml uwp

我有一个拆分视图(UWP),该视图位于启用水平滚动的scrollviewer中。下面显示的代码具有一个用户控件,该控件嵌入了以水平堆叠方式显示的数据。我有一个标题菜单,单击该菜单应从右到左打开一个拆分视图。但是,无论何时进行水平滚动,打开的拆分视图都不会响应。在打开splitview并启用水平滚动的情况下调整窗口大小时,我看到该应用程序没有响应。我应该怎么做才能使分割视图响应。

默认情况下,只要没有水平滚动,我就会看到splitview响应。

下面显示的用户控件(KanbanControl)基本上是一个Gridview,它使用ItemsWrapGrid作为水平堆叠的面板模板

尝试的方法:- a)试图在要打开拆分视图时禁用水平滚动,但这没有帮助。

有什么想法的人吗?

<ScrollViewer VerticalScrollBarVisibility="Auto" 
                  HorizontalScrollBarVisibility="Auto" Height="Auto" 
                  x:Name="ContentView">
        <Grid Name="ProjectKanbanGrid">
            <kanban:KanbanControl x:Name="KanbanCtrl"/>
<SplitView Name="SplitViewPane" 
               IsPaneOpen="false"
               DisplayMode="Overlay"
               OpenPaneLength="500" HorizontalAlignment="Right"
               FlowDirection="RightToLeft" PaneBackground="White"
               BorderBrush="Red" BorderThickness="10"
               PaneClosing="SplitViewPane_PaneClosing">               
        <SplitView.Pane>
            <Border BorderThickness="1" CornerRadius="4" BorderBrush="LightGray">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="50"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <StackPanel Background="#FAFAFB"  Height="50" BorderBrush="#f0f0f0" 
                                    CornerRadius="4" BorderThickness="1">
                        <TextBlock Text="Edit a Task List" FontWeight="Bold" 
                                       HorizontalAlignment="Right" Margin="0,10,20,0"/>
                    </StackPanel>
                    <Grid Grid.Row="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="60"/>
                            <RowDefinition Height="50"/>
                            <RowDefinition Height="30"/>
                            <RowDefinition Height="50"/>
                            <RowDefinition Height="60"/>
                        </Grid.RowDefinitions>
                        <TextBlock Text="Task List" Foreground="Red" 
                                       HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,20,0"/>
                        <TextBox  Name="TaskListName"  HorizontalAlignment="Right" 
                                     Margin="0,0,20,0" Grid.Row="1" VerticalAlignment="Top" BorderThickness="1" 
                                     BorderBrush="LightGray" Width="250"/>
                        <TextBlock Text="Related Milestone" Grid.Row="2"
                                       HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0"/>
                        <ComboBox Name="MilestoneList" Width="250" IsTextSearchEnabled="True" BorderThickness="1" 
                                      BorderBrush="LightGray" Grid.Row="3" Margin="0,0,20,0"  
                                      HorizontalAlignment="Right" VerticalAlignment="Center" >
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>
                        <StackPanel Orientation="Horizontal" Grid.Row="4" 
                                        HorizontalAlignment="Right" Margin="0,0,20,0" VerticalAlignment="Center">
                            <Button Background="White" Margin="20,0,0,0" Content="Cancel" Click="Cancel_Click"/>
                            <Button Background="#1e5598" Foreground="White" Content="Update" Margin="5,0,0,0"/>
                        </StackPanel>
                    </Grid>
                </Grid>
            </Border>
        </SplitView.Pane>
    </SplitView>
            <RelativePanel Visibility="{x:Bind kanban.IsShowResultGrid,Mode=TwoWay}"
                   HorizontalAlignment="Center">
                <ProgressRing x:Name="LoadProgressRing"
                              Width="25"
                              Height="25"
                              RelativePanel.AlignVerticalCenterWithPanel="True"
                              Visibility="{x:Bind kanban.IsShowProgressRing,Mode=TwoWay}"
                              IsActive="True" />
                <TextBlock x:Name="LoadingMessage" Margin="10,0,0,0" HorizontalAlignment="Center"
                            Text="Fetching your project layouts"
                            RelativePanel.AlignVerticalCenterWithPanel="True"
                            RelativePanel.RightOf="LoadProgressRing"                   
                            Visibility="{x:Bind kanban.IsShowProgressRing,Mode=TwoWay}"/>
                <TextBlock x:Name="DisplayMsg" Margin="0,0,0,0" 
                            RelativePanel.AlignHorizontalCenterWithPanel="True"
                            RelativePanel.AlignVerticalCenterWithPanel="True"
                            Text="{x:Bind kanban.DisplayMessage,Mode=TwoWay}"/>
            </RelativePanel>
        </Grid>
    </ScrollViewer>

1 个答案:

答案 0 :(得分:0)

从splitview中移除外部滚动查看器,并将其包装在用户控件看板控件中。这将使该应用程序具有响应能力。

代码段如下

FindItem()