This is a migrated thread and some comments may be shown as answers.

Display image inside VirtualizingWrapPanel

1 Answer 146 Views
VirtualizingWrapPanel
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Alan asked on 11 Jun 2012, 02:06 AM

i want to display image in each item on VirtualizaingWrapPanel.
I try to modify the sample code VirtualizingWrapPanel.WPF Example.xml
by adding a line (bold below) to show a image

< DataTemplate x:Key="dataTemplate">
..........................
< TextBlock FontWeight="Bold" Text="Discontinued:" Grid.Row="4"/>
<TextBlock Text="{Binding Discontinued}" Grid.Row="4" Grid.Column="1" />

<TextBlock FontWeight="Bold" Text="Image:" Grid.Row="5"/>
<Image Source="{Binding Image}" Grid.Row="5" Grid.Column="1" />
</Grid>

the Image is a property with BitmapImage Type.
After recomplie the sample and i can see the image shown.
However,when i resize the sample window.the app seems hang.
I would like to known the properly way to display a image in VirtualizingWrapPanel?

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 11 Jun 2012, 05:43 AM
Hi,

As far as we know there is nothing special in this case and your code should work normally if the image (and binding) is valid. Please make sure also that you have enough space for the image (ItemHeight/ItemWidth settings for the panel). 

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
VirtualizingWrapPanel
Asked by
Alan
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or