I'm working on a project using RadPDFViewer. We've implemented multiple Windows 8 style themes with the following code snippet:
...in which the color brushes above are swapped out at runtime inside merged resource dictionaries.This gives us the ability to create a Light/Dark theme controlled by a dropdown.
However, we're finding that the colors used in some of the controls aren't acting the way we want (focus color in one control seems be be used for content elswhere), so we're customizing the templates. We've had good success with this approach so far, but the PDFViewer is being difficult.
Specifically, we want to force the page of the pdf (ie: just the area under the pdf itself, not the border around the page) to be white regardless of what background color we're using in other controls.
There seem to be a few possibilities for achieving this:
- Using a different theme (Office Dark, Vista etc...) for the PDFViewer and applying it explicitly. The downside is that we will no longer be able to apply an application wide theme and will have to specify the Windows 8 theme on all other controls.
- Figuring out how to override the template of the PDFViewer in a way that provides access to the page background. I haven't been able to figure this out.
- Applying different values for the Windows 8 palette for just the PDFViewer. As near as I can tell, the palette is global so no way to do it.
Is there a smarter way to go about this?
Windows8Palette.Palette.MainColor = ((SolidColorBrush)dictionary[
"BasicControlBackground"
]).Color;
Windows8Palette.Palette.AccentColor = ((SolidColorBrush)dictionary[
"BasicDarkAccentColor"
]).Color;
Windows8Palette.Palette.BasicColor = ((SolidColorBrush)dictionary[
"BasicHighlightColor"
]).Color;
Windows8Palette.Palette.StrongColor = ((SolidColorBrush)dictionary[
"BasicControlForegroundColor"
]).Color;
Windows8Palette.Palette.MarkerColor = ((SolidColorBrush)dictionary[
"BasicDarkAccentColor"
]).Color;
StyleManager.ApplicationTheme =
new
Windows8Theme();
...in which the color brushes above are swapped out at runtime inside merged resource dictionaries.This gives us the ability to create a Light/Dark theme controlled by a dropdown.
However, we're finding that the colors used in some of the controls aren't acting the way we want (focus color in one control seems be be used for content elswhere), so we're customizing the templates. We've had good success with this approach so far, but the PDFViewer is being difficult.
Specifically, we want to force the page of the pdf (ie: just the area under the pdf itself, not the border around the page) to be white regardless of what background color we're using in other controls.
There seem to be a few possibilities for achieving this:
- Using a different theme (Office Dark, Vista etc...) for the PDFViewer and applying it explicitly. The downside is that we will no longer be able to apply an application wide theme and will have to specify the Windows 8 theme on all other controls.
- Figuring out how to override the template of the PDFViewer in a way that provides access to the page background. I haven't been able to figure this out.
- Applying different values for the Windows 8 palette for just the PDFViewer. As near as I can tell, the palette is global so no way to do it.
Is there a smarter way to go about this?