我有一个名为 FlipView 的控件
图像翻转视图
它位于其父 FlipView 的 DataTemplete 下,名为
翻转视图
我有一个控件,它是名为 imageFlipView 的兄弟控件
图像指标
现在,imageIndicator 需要 Element-to-Element 绑定,但不能在 DataTemplate 中工作。这是代码
<FlipView
x:Name="flipView"
AutomationProperties.AutomationId="ItemsFlipView"
AutomationProperties.Name="Item Details"
TabIndex="1"
Grid.RowSpan="2"
ItemsSource="{Binding Source={StaticResource itemsViewSource}}">
<FlipView.ItemContainerStyle>
<Style TargetType="FlipViewItem">
<Setter Property="Margin" Value="0,137,0,0"/>
</Style>
</FlipView.ItemContainerStyle>
<FlipView.ItemTemplate>
<DataTemplate>
<UserControl Loaded="StartLayoutUpdates" Unloaded="StopLayoutUpdates">
<ScrollViewer x:Name="scrollViewer" Style="{StaticResource HorizontalScrollViewerStyle}" Grid.Row="1">
<StackPanel Orientation="Vertical" Grid.Column="0" Loaded="StackPanel_Loaded_1">
<TextBlock FontSize="30" FontFamily=" Tahoma" FontWeight="Normal" Text="{Binding Title}" TextWrapping="Wrap"/>
<FlipView x:Name="imageFlip" Loaded="imageFlip_Loaded_1" Visibility="Visible" Margin="0,0,0,10" VerticalAlignment="Top" Height="515" >
<Image x:Name="image1" Width="400" HorizontalAlignment="Left" Margin="0,0,0,10" Stretch="Uniform" Source="{Binding ImagePath1}" VerticalAlignment="Top"/>
<Image x:Name="image2" Width="350" HorizontalAlignment="Left" Margin="0,0,0,10" Stretch="Uniform" Source="{Binding ImagePath1}" VerticalAlignment="Top"/>
<Image x:Name="image3" Width="300" HorizontalAlignment="Left" Margin="0,0,0,10" Stretch="Uniform" Source="{Binding ImagePath1}" VerticalAlignment="Top"/>
<Image x:Name="image4" Width="250" HorizontalAlignment="Left" Margin="0,0,0,10" Stretch="Uniform" Source="{Binding ImagePath1}" VerticalAlignment="Top"/>
</FlipView>
<callisto:FlipViewIndicator x:Name="imageIndicator" FlipView="{Binding ElementName=imageFlip}"/>
</StackPanel>
</ScrollViewer>
</UserControl>
</DataTemplate>
</FlipView.ItemTemplate>
</FlipView>
任何帮助将不胜感激