Changing Styles using ImplicitStyleManager
A bunch of new controls were released yesterday as part of silverlight toolkit. One of new Items is ImplicitStyleManager which simplifies changing styles. You can download the sample here. It doesnt do anything meaningful but shows how we can dynamically change styles in the application.
Here are some screenshots



[...] Lee gives us a really nice and simple demo on Changing Styles using ImplicitStyleManager [...]
2008 October 30 - Links for today « My (almost) Daily Links
October 30, 2008
Hi.Lee
Could you give us a toolkit datagrid sample please?
I found that the themes doesn’t style the datagrid,Why?
Ak
November 13, 2008
[...] 13, 2008 by lee In an earlier post we saw it was easy to change styles using ImplicitStyleManager. But TabControl and DataGrid were [...]
Changing Styles using ImplicitStyleManager-2 « Lee’s Corner
November 13, 2008
Super cool, I have a web site(http://www.xamltemplates.net) were i sell themes (skins) for all the WPF controls, now i cand make also for silverlight
, thanks again.
XAML Templates
November 21, 2008
Hi Lee, I have gone thru ur application and the code behind for it. I am new to Silverlight toolkit and Themes. Could you kindly explain ur code step by step if possible.
Thanks
Anubandh
May 11, 2009
what piece(s) of code are you having difficulty with
lee
May 11, 2009
Hi Lee. Understood ur code well thoroughly. Was a little mentally tired yesterday, so probably the code could not register properly. Well I am working with “Microsoft.Cui.Controls”(http://www.mscui.net/Components/PatientBanner.aspx) Patient Banner control.
Is there anyway I can apply the theme styling(from ur code sample) to the Patientbanner control. Have been on this issue for a week now.
I tried using it as one of the child controls inside ur application, but the control did not reflect the required styles of the theme selected.
Anubandh
May 12, 2009
I would try to explicity set the theme on the child control and see
lee
May 12, 2009
Hi currently this is the “xaml file”
xmlns:theming=”clr-namespace:Microsoft.Windows.Controls.Theming;assembly=Microsoft.Windows.Controls.Theming”>
<!–
–>
By explicitly setting the theme you mean setting it in the XAML code is it or in the C# backend code. Can u plz reply back with a sample code for the same.
Anubandh
May 13, 2009
you could replace the “this” with the control name
ImplicitStyleManager.SetResourceDictionaryUri(this, new Uri(@”projname;component/Theme.xaml”, UriKind.Relative));
ImplicitStyleManager.SetApplyMode(this, ImplicitStylesApplyMode.Auto);
ImplicitStyleManager.Apply(this);
lee
May 13, 2009
No Lee,
Adding ‘this’ keyword instead of the control name gives the same result i.e. ‘Silverlight XAML Controls’ are coming out properly skinned/themed by the applied theme. Its just the PatientBanner control which is not complying to the Theme set by me.
Can u try this out if possible and let me know. I really think that Silverlight toolkit which supports common Silverlight XAML controls does not support Microsoft.Cui.Controls. Lemme know ur thoughts on the same. Thanks for ur time
Anubandh
May 13, 2009