我的应用程序中有一个数据绑定列表框和一个listpicker。我隐藏了listpicker,只有在触发事件时才会打开。
最初,列表框将填充一些值(超过10个值)。我试图滚动列表。但我不能。当我单击列表并向上拖动鼠标时,列表会进一步下降。效果更多或者就像拉下列表一样。
xaml代码如下。请帮忙。
<StackPanel>
<toolkit:ListPicker x:Name="List" ItemsSource="{Binding List_OC}" Visibility="Collapsed" SelectionChanged="List_SelectionChanged">
<toolkit:ListPicker.FullModeItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding NAME}" FontSize="{StaticResource PhoneFontSizeLarge}" />
</DataTemplate>
</toolkit:ListPicker.FullModeItemTemplate>
</toolkit:ListPicker>
<ListBox x:Name="Requests1" ItemsSource="{Binding Details_OC}" SelectionChanged="Requests_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Stretch" Width="450">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox x:Name="CheckBox1" Grid.Column="0" IsChecked="{Binding Path=IsComplete, Mode=TwoWay}" Grid.RowSpan="3" Checked="CheckBox1_Checked" Unchecked="CheckBox1_Unchecked" />
<StackPanel Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="4">
<TextBlock x:Name="WorkOrderID" HorizontalAlignment="Left" Text="{Binding WORKORDERID}" VerticalAlignment="Top"/>
<TextBlock x:Name="date" Text="{Binding Path=DUEBYTIME, Converter={StaticResource dateConverter}}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
</StackPanel>
<TextBlock x:Name="Subject" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" HorizontalAlignment="Left" Text="{Binding SUBJECT}" VerticalAlignment="Top" />
<TextBlock x:Name="Requester" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" Text="{Binding REQUESTER}" VerticalAlignment="Top" />
<TextBlock x:Name="PriorityLabel" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Left" Text=" * Priority : " VerticalAlignment="Top" />
<TextBlock x:Name="Priority" Grid.Row="2" Grid.Column="3" HorizontalAlignment="Left" Text="{Binding PRIORITY}" VerticalAlignment="Top" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
谢谢。
答案 0 :(得分:1)
我测试了您的代码,我通过网格替换包含列表框的Stackpanel来解决问题。
它对我有用。
希望它会有所帮助!