RadSlideView ImageFailed

Thread is closed for posting
2 posts, 0 answers
  1. Derek
    Derek avatar
    39 posts
    Member since:
    Aug 2012

    Posted 14 Nov 2012 Link to this post

    Using a RadSlideView with an ItemTemplate that contains a PanAndZoomImage, what would you recommend as the best way to handle the ImageFailedEvent and display a different image when this event fires?

    I've tried a couple different things:

    I've tried having a Image and PanAndZoomImage element in the template and binding the Visibility to IsFailedImage for both, one having an Inverse property passed to the converter, so if the ImageFailedEvent fires I set IsFailedImage and the Image element is visible, if IsFailedImage is false the PandAndZoomImage will be visible.  In theory this should work but when IsFailedImage is true, the screen is blank.

    I've also tried changing the PandAndZoomImage Source after ImageFailed fires but again, the ImageFailed image won't display.

    I've thought about using a TemplateSelector but I'm not sure that would work as ImageFailed would be firing in one of the template selections.

    Am I missing something?  It would be nice to have something built in for this, similar to the DataboundListbox display a message when there isn't any data to display.

  2. Lance
    Lance avatar
    15 posts
    Member since:
    May 2012

    Posted 14 Nov 2012 Link to this post

    Hi Derek,

    You could place a Border above the SlideView in the Visual Tree on that page. Inside the Border have a textblock with something like "We're sorry, there was a problem getting the image. Slide to the next image"

    Then tie the visibility of the Border to whether or not an image loaded similar to what you already attempted. You shouldn't need to tie in the visibility of the PanAndZoomImage. That way you have a completely independent item in the tree that collapses and shows itself according to your IsFailedImage property

    Also, if you are using MVVM, you will need a BooleanToVisibility converter, as Visibility isnt a bindable property.

    If I misunderstood the question or if you'd like a sample converter, let me know. I'm more than happy to oblige.

    Good Luck,
Back to Top