我有一个列表框中的数据模式生成的图像控件。我如何通过代码访问此图像?我尝试了this,但由于我在城域应用程序上工作,因此无法设置IsSynchronizedWithCurrentItem。在列表框中访问数据元素?
XAML中我已经是:
<ListBox x:Name="options_stack" HorizontalAlignment="Left" Margin="198,569,0,33" Width="603" Background="#FF603C74" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollMode="Auto" >
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Image x:Name="options_image" Source = "{Binding}" Stretch="Fill" Width="166" MaxHeight="156" MaxWidth="166" MinHeight="156" MinWidth="166" Tapped="apply_image_tapped" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
我可以展开更多对这些或链接一个更多一些信息,如果我知道更多的上下文。 – 2013-03-22 20:26:50
该列表框在运行时由不同的图像填充。我想要做的是在用户点击时找出特定图像的路径。你现在会建议什么? – Tehreem 2013-03-23 04:22:32
我解决了它!谢谢你的帮助.. – Tehreem 2013-03-23 05:19:46