FixedPageViewer not showing document

Apr 7, 2014 at 11:13 AM
Document preview inside FixedPageViewer it is shown only when debugger is attached. It is license related problem ?
Coordinator
Apr 8, 2014 at 12:15 PM
No, the evaluation edition is fully functional. Are you using a custom style document viewer?
Apr 9, 2014 at 9:39 AM
Edited Apr 9, 2014 at 10:08 AM
It is almost identical like SampleSinglePage.xaml from samples, I'm using FixedPageViewer control without templating. Any ideas ?

Silverlight 5.
Coordinator
Apr 9, 2014 at 10:16 AM
Can you share some source code?
Apr 9, 2014 at 1:20 PM
Of course, here is my xaml (with debugger attached to process everything works fine):
<doc:PageNavigator Grid.Column="0" Grid.Row="0" x:Name="PageNavigator" Visibility="Collapsed"
                PageCount="{Binding PageCount, ElementName=Viewer}"                              
                PageIndex="{Binding PageIndex, ElementName=Viewer, Mode=TwoWay}"
                               PageIndexChanged="PageNavigator_PageIndexChanged"
                               />
            <doc:ThumbnailListBox Grid.Column="0" Grid.Row="0" x:Name="Thumbnails" VerticalAlignment="Stretch"
                Visibility="{Binding IsDocumentLoaded, Converter={StaticResource BoolToVisibilityConverterCollapsedWhenFalse}}" 
                PageIndex="{Binding PageIndex, Mode=TwoWay, ElementName=PageNavigator}"
                DocumentDataSource="{Binding Path=DocumentToolkitDataSource, Mode=TwoWay}" />

            <ScrollViewer x:Name="ScrollViewer" HorizontalScrollBarVisibility="Auto" 
                          VerticalScrollBarVisibility="Auto" 
                          Grid.Column="1" Grid.Row="0"
                          BorderThickness="0" >
                <Border x:Name="PageViewerBorder" 
                        Background="White" BorderBrush="Transparent" BorderThickness="1" Margin="4" HorizontalAlignment="Center" VerticalAlignment="Center"
                        Visibility="{Binding Document, ElementName=DataSource}" 
                        MouseLeftButtonDown="PageViewerBorder_MouseLeftButtonDown" MouseRightButtonUp="PageViewerBorder_MouseLeftButtonUp"
                        MouseMove="PageViewerBorder_MouseMove" LostMouseCapture="PageViewerBorder_LostMouseCapture">

                    <toolkit:LayoutTransformer LayoutTransform="{Binding DataContext.RotateTransform, ElementName=LayoutRoot}">
                        <doc:FixedPageViewer x:Name="PageViewer"
                                 FixedPage="{Binding FixedPage}"
                                 FixedPageSize="{Binding FixedPageSize}"
                                 FixedPageError="{Binding FixedPageError}"
                                 Scale="{Binding SelectedViewMode.Scale, ElementName=ViewModePicker}"
                                         >
                            <i:Interaction.Behaviors>
                                <doc:NavigationBehavior TextContainer="{Binding TextContainer}" />
                            </i:Interaction.Behaviors>
                        </doc:FixedPageViewer>
                    </toolkit:LayoutTransformer>
                </Border>
            </ScrollViewer>
Coordinator
Apr 9, 2014 at 1:31 PM
Is the DataContext of the FixedPageViewer set at all? Check the Visual Studio output window for binding errors. The PageViewBorder for instance has an invalid binding on the Visibility property; that binding can't work unless you provide a ConverterParameter.
Apr 10, 2014 at 6:28 AM
Edited Apr 10, 2014 at 7:41 AM
Is the DataContext of the FixedPageViewer set at all?
I see document when debugger is attached so it should be set correctly.

Viewer does not work if debugger is detached, so I cannot check the output window without having debugger attached.

I have removed PageViewBorder and still can't see Document.

I could also log some info to isolated storage...
Apr 14, 2014 at 11:33 AM
Edited Apr 14, 2014 at 11:33 AM
I removed visibility from PageViewerBorder so the visibility binding will not fail. I also dumped some data to file.

Without debugger attached (datacontext_changed in FixedPageViewer):

FixedPageSize: 816,1056, inUse: True. FixedPageError: , FixedPage:
DataContextChanged

FixedPageSize: 816,1056, inUse: True. FixedPageError: , FixedPage:
DataContextChanged

Thanks!

PS. I bought license for your product
Coordinator
Apr 14, 2014 at 10:48 PM
Maybe the source of the problem lies somewhere else; do you happen to handle to DocumentDataSource.LoadError event? It's possible a load error occurs in release mode.

This is fairly hard to debug; is it possible I get access to (part of) the source of this app, so I can reproduce on my end? You can send it to info [at] firstfloorsoftware.com
Apr 15, 2014 at 5:52 AM
Edited Apr 15, 2014 at 5:53 AM
Yes I catch load error. There are two main difference between sample code and my. DocumentDataSource is in view model and I'm loading images from database with DotNetZipPackageReader.

unfortunately I cannot give you the sources..
Apr 16, 2014 at 6:03 AM
I solve this problem, thanks for support !