【发布时间】:2014-11-17 18:25:36
【问题描述】:
我已经在列表框中绑定了一些图像,当我将点击一个绑定图像时,该图像将通过来自绑定图像源的源设置在主图像中。
这是我想从绑定数据中显示图像的代码。
<Grid x:Name="Icon" Margin="134,51,173,556">
<Image x:Name="MyIconImage" HorizontalAlignment="Left" Height="90" Width="93" Source="" />
</Grid>
这是我绑定数据的代码
<Grid Margin="0,366,0,0">
<ListBox x:Name="List"
ItemsSource="{Binding ListItemSource}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<Image x:Name="IconListImage" Source="{Binding IconPath}" Width="48" Height="48" Tap="IconListImage_Tap"/>
<TextBlock x:Name="appName" Text="{Binding AppName}"/>
<TextBlock Text="{Binding IconPath}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
【问题讨论】:
标签: c# xaml windows-phone-8 data-binding windows-phone-8.1