刚开始学习c#和windows phone, 我的问题我似乎无法将我的图像(绑定图像)显示出来并滚动水平,如果我在xaml中硬编码,我可以让它们正常工作,这是我的代码...
<!-- row 4 start -->
<Grid x:Name="row3" Grid.Row="3">
<ScrollViewer HorizontalScrollBarVisibility="Auto">
<StackPanel x:Name="imgStackPanel" Orientation="Horizontal" ScrollViewer.HorizontalScrollBarVisibility="Auto">
<!--<Image Source="{Binding Path=DvdPhoto}" Width="150" Height="150" Margin="5"/>-->
<Image Source="/GmanDVDStore;component/Images/rain.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/snow.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/sun.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/wind.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/rain.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/snow.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/sun.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/wind.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/rain.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/snow.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/sun.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/wind.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/rain.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/snow.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/sun.jpg" Width="150" Height="150" Margin="5"/>
<Image Source="/GmanDVDStore;component/Images/wind.jpg" Width="150" Height="150" Margin="5"/>
</StackPanel>
</ScrollViewer>
</Grid>
这可以显示图像,我可以从左向右滚动,注释掉的代码,我有图像绑定不起作用。
如果我做它垂直它会工作正常,因为我有一个列表框,我已经尝试水平列表框。
有没有人能解决这个问题。
提前致谢
GMAN
PS:对我很轻松,因为我说我刚刚开始学习Windows手机。 :)答案 0 :(得分:0)