开发者

Binding to images

I'm using a listbox with a template like the following.

<ListBox.ItemTemplate>
    <DataTemplate>
        <Ima开发者_StackOverflow社区ge Source="{Binding}" Width="100" />
    </DataTemplate>
</ListBox.ItemTemplate>

I bind this to an observable collection conataining 130 paths to images (all do exist, read out using System.IO.Directory) but only a few get really displayed. No exceptions that come up. Only white places where the images should be. Has anybody seen something else.

Sascha


Never seen this before but Binding is suppressing errors by default. When there are errors you can see them when you run in debug en watch in the output window of visual studio and make sure the option of the combobox "Show output from:" is set to "Debug"

Hope that this will help you to the real problem.

EDITED:

If you don't see a problem may you can find it out by hooking into the Image.ImageFailed Event. More help can be found here :

http://msdn.microsoft.com/en-us/library/system.windows.controls.image.imagefailed%28v=VS.95%29.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜