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

RadPdfViewer crashes in (custom) Metro theme

3 Answers 129 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tony
Top achievements
Rank 1
Tony asked on 20 Jul 2012, 03:14 PM
Im using a custom version of the Metro style. Ive just overridden a few colors and done very minor tweaks. Ive done this following the steps in this article http://www.telerik.com/help/silverlight/common-styling-apperance-modifying-built-in-theme.html. This has been working for months and works perfect.

Im now attempting to add the RadPdfViewer into my application. However, the software crashes when loading a valid PDF with the following error: "Set property 'Telerik.Windows.Controls.Theme.ApplicationThemeSetter' threw an exception. [Line:12 Position: 88]"

Now to test, I did not set my MetroTheme at startup (using the default theme) and it worked just fine.

Some releavant code:
public App()
{
    Startup += Application_Startup;
    Exit += Application_Exit;
    UnhandledException += Application_UnhandledException;
 
    StyleManager.ApplicationTheme = new MetroTheme();
 
}

Ive noticed when i created my custom theme following the instructions in the article, there is no XAML provided for the RadPdfViewer when i downloaded the Telerik themes. Im assuming this is ok. I looked in the other themes and there was nothing related to the pdf view ther either.

Simple xaml to display the pdf (yes its a valid pdf and yes the uri is correct).
<Grid x:Name="LayoutRoot" Background="White">
    <StackPanel>
        <TextBlock Text="Check Sheet" Style="{StaticResource H2}" />
        <telerik:RadPdfViewer DocumentSource="{Binding AttachmentUri}" />
    </StackPanel>
</Grid>

Any thoughts? It seems the exception is coming from Telerik.










3 Answers, 1 is accepted

Sort by
0
Tony
Top achievements
Rank 1
answered on 24 Jul 2012, 12:04 PM
Is this a known issue? Can i provide more info?
0
Accepted
Andrew
Telerik team
answered on 24 Jul 2012, 03:57 PM
Hello Tony,

The problem is that the style for the RadPdfViewer cannot be found. You can download our latest release dlls and run the Themes Solution where this style is present. 

You can also open a support ticket and send us a sample project reproducing the issue and we will modify it to work as expected and return it to you, if you prefer this solution.


Kind regards,
Andrew
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Tony
Top achievements
Rank 1
answered on 24 Jul 2012, 04:46 PM
Thanks!.
I apparently did not have the one XAML file in my solution... not sure how i overlooked that but your response led me down that path.
Tags
PDFViewer
Asked by
Tony
Top achievements
Rank 1
Answers by
Tony
Top achievements
Rank 1
Andrew
Telerik team
Share this question
or