Я столкнулся с проблемой в синхронизации FlipView с Page Indicator, это мой код:FlipView и индикатор Page UWP
<Grid>
<FlipView x:Name="flipView1">
<FlipView.ItemTemplate>
<DataTemplate >
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Button Grid.Column="0" Grid.Row="0">
<Image Source="{Binding Image}"/>
</Button>
</Grid>
</DataTemplate>
</FlipView.ItemTemplate>
</FlipView>
<ItemsControl ItemsSource="{Binding ItemsSource, ElementName=flipView1}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Style="{StaticResource TextBlockButtonStyle}"
CommandParameter="{Binding}"
Command="{Binding DataContext.SelectCommand, ElementName=grid, Mode=OneWay}">
<Grid Height="30" Width="30" Margin="10,10">
<Ellipse Fill="#2c3389" RenderTransformOrigin="0.5,0.5" >
<Ellipse.RenderTransform>
<CompositeTransform ScaleX="1.25" ScaleY="1.25"/>
</Ellipse.RenderTransform>
</Ellipse>
<Ellipse Fill="Gray" Stroke="#2c3389" />
</Grid>
и это, как я получаю ItemSource к FlipView в коде позади:
var tests = new List<SampleItem>()
{
test1,
test2
};
flipView1.ItemsSource = tests;
}
Я могу переходить от одной страницы к другой с моей FlipView, но индикатор страницы не работает:/ любая помощь, пожалуйста, как я могу связан Оба FlipView и ItemsControl к той же коллекции
спасибо за помощь
Ваш вопрос немного неясен. Вы должны привязать список к ItemsSource, но что такое «привязка данных»? Что вы имеете в виду? Почему вы не использовали ListView, как в примере из ссылки? – marcinax