Wednesday, August 27, 2014

How to add image to FlipView control?

Hi!



I'm trying to add images to a FlipView control by code, but I only got text showing. What am I doing wrong?

The first item is using the same path as the second item, but just another color.


Windows Phone 8.1 (universal app)



<Grid>
<FlipView x:Name="flipView" SelectionChanged="FlipView_SelectionChanged"/>
</Grid>


protected override void OnNavigatedTo(NavigationEventArgs e)
{
BitmapImage img = new BitmapImage(new Uri(param.Split('#')[0]));
flipView.Items.Add(img);
flipView.Items.Add("ms-appx:///Assets/Products/621245_DNAVY.png");
flipView.Items.Add("Assets/Products/621245_HCORA.png");
flipView.Items.Add("Assets/Products/621245_Rpink_big.png");

}

Thanks, Sigurd F




No comments:

Post a Comment