RadPdfViewer crashes in (custom) Metro theme

4 posts, 1 answers
  1. Tony
    Tony avatar
    24 posts
    Member since:
    Nov 2011

    Posted 20 Jul 2012 Link to this post

    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.










  2. Tony
    Tony avatar
    24 posts
    Member since:
    Nov 2011

    Posted 24 Jul 2012 Link to this post

    Is this a known issue? Can i provide more info?
  3. DevCraft banner
  4. Answer
    Andrew
    Admin
    Andrew avatar
    140 posts

    Posted 24 Jul 2012 Link to this post

    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.

  5. Tony
    Tony avatar
    24 posts
    Member since:
    Nov 2011

    Posted 24 Jul 2012 Link to this post

    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.
Back to Top