I have a strange problem with a listbox which is in a flipview.
<FlipView
x:Name="flipView"
ItemsSource="{Binding Source={StaticResource itemsViewSource}}" Padding="0">
<FlipView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" FontSize="32" Text="{Binding Question.OrginalWord}" HorizontalAlignment="Center"></TextBlock>
<TextBlock Grid.Row="1" FontSize="18" Text="{Binding Question.Clue}"></TextBlock>
<TextBlock Grid.Row="2" x:Uid="ExamPage_OptionLabel"></TextBlock>
<ListBox x:Name="ListofOptions" Tag="{Binding Question.Id}" Grid.Row="3" ItemsSource="{Binding Options}" Padding="15" Width="280"
Height="200" SelectionChanged="OptionsChange" Loaded="ListofOptions_Loaded"></ListBox>
</Grid>
</DataTemplate>
</FlipView.ItemTemplate>
</FlipView>
in listbox’s SelectionChanged event handler I disable the listbox
private void OptionsChange(object sender, SelectionChangedEventArgs e)
{
((ListBox)sender).IsEnabled = false;
}
so the problem is that imagine the flipview has 6 items. when I click listbox’s items in first flipview’s item(each listbox has four own items), the listbox in the first flipview’s item is disabled but the listbox for the last flipview’s item is also disabled. Moreover, when you flip to the last item in flipview and then comeback to the first item the listbox is shown as un-selected lisbox. this problem is not only for first and last flipview’s item but also for 2th and 5th , 4th and 3th flipview’s item.
It is much strange 🙂 😐
the answer is quite tricky
Answer from MSDN forum