Images don't get displayed in the items

May 10, 2010 at 5:51 PM
Hi, Maybe I am doing something wrong, but when I even hardcode inside the Data Template the image control with Source property the images are not displayed inside the items. Here is my code: <DataTemplate x:Key="productFlowTemplate"> <Grid> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> </Grid.RowDefinitions> <StackPanel> <Image Height="130" VerticalAlignment="Center" HorizontalAlignment="Center" Width="200" Source="/cake.png" ></Image> </StackPanel> </Grid> </DataTemplate> <fl:FlowItemsControl2D x:Name="productFlow" ItemsSource="{Binding Items}" ItemTemplate="{StaticResource productFlowTemplate}" Grid.Column="1" Margin="0,198,0,0" /> In VS2010 and Expression Belnd 4 the control preview displays the images correctly, but when I run the app the images are gone. Any suggestion? Thank you.
May 10, 2010 at 7:35 PM

If the images are out of the coverflow, do they show correctly at runtime ?

May 10, 2010 at 8:32 PM
Edited May 11, 2010 at 12:17 AM

 

Hello Simon,

thank you for you quick replay.

I hope I understand your question correctly. Well, if I bind the coverflow to the List, then the list collection is bind correctly. The another "string" values are displayed correctly in the coverflow. I assign the Context value (the URL) at runtime to the Image control in the data template but the images don't get displayed.

That's why I hardcoded the Context value directly to the data Template to test the result. But still nothing.  I get the same "default" result what you have on your website without the image display. But the design time shows the picture correctly.

So , if you mean "images are out of the coverflow" loaded from my project folder (images) dynamically, then no, they don't show at runtime at all.

You can replicate the same issue what I have if you just add image file to your project (what you share with us) and add hardcoded image control to the item datatemplate in your project. You will see exactly what I mean.

Thank you for your help.

Any more suggestions what is wrong or what I am doing wrong?

Dec 10, 2010 at 7:06 PM

You can always set the background property to an Image Brush. Then you'll have the image properly shown in the reflection. You'll need a converter to make an ImageBrush out of your image.