This project is read-only.

Applying different Styles to the Patient Banner Control

May 14, 2009 at 7:02 AM

I have a Silverlight application page which has a  Microsoft.Cui.Controls.PatientBanner control, Silverlight XAML Radiobuttonlist (to be clicked to change the theme) which I am implementing wherein, I need to change the theme on selecting a particular option.

Initially, I have tried implementing the application using the 'Style' property, but I understand from reading other forums/sites that the 'Style' property can be set only once in the application and trying to reset it again(even to null) throws a runtime exception: "catastrophic failure exception from hresult 0x8000ffff e_unexpected" 

I found out the alternative option for changing themes was using the 'Template' property. But using Control Templates in the XAML file was also giving me some errors. I'm still working on this approach though. Will post updates, if I have any queries.

Also using Microsoft.Windows.Theming reference and applying ImplicitStyleManager and URI classes, I've applied the required theme to the Patient Banner control. I added some of the common Silverlight Xaml Controls to the page also. On runtime when I select a particular theme (from the list available in the Silverlight toolkit) the theme gets applied to only the Silverlight Xaml controls and not to the Patient Banner control. Is this an issue of Silverlight toolkit not supporting Microsoft.Cui.Controls.

Kindly reply to the above queries with appropriate sample codes or links which provide a clear explanation for the same.

Thanks & Regards,


Jun 4, 2009 at 4:10 PM


We have written a blog post including sample code to demonstrate how the Silverlight Toolkit ImplicitStyleManager can be used with the MSCUI PatientBanner control.