This project is read-only.

Thumbnail viewer and visible converter

Sep 28, 2010 at 10:15 AM

Hi,

  I'm using the thumbnail viewer, works great and it calculated the optimal width and height of the thumbs automatically, that's great.

  Now I'm facing an small issue, I want to display the thumbnail view just only when a document contains more than one page, I just set up the Visibility option and created a converter, when the number of pages is 1 visiblity is collapsed, ... when I try to use it, if I load a document that contains more than one page the thubnail sizes are set to 1x1 pixel or something like that.

        
<doc:ThumbnailListBox x:Name="Thumbnails" Margin="0,0,-1,0" DocumentDataSource="{Binding ElementName=DataSource}" PageIndex="{Binding PageIndex, ElementName=Viewer, Mode=TwoWay}" Visibility="{Binding PageCount, Converter={StaticResource PageCountConverter}, ElementName=Viewer}"  Width="130" />
Sep 28, 2010 at 12:49 PM

Try moving the listbox out of sight using a TranslateTransform with X set to -10000 (or something similar), instead of toggling the Visibility. I think the issue is related to controls not having their OnApplyTemplate invoked because they are initially invisible.

This may indicate a bug in the ThumbnailListBox, I will look into it.

- Koen