Hi All,
About setting themes and styling WPF controls using implicit styles, I set Dark style to Rad controls successfully but about RadChart , it doesn’t work. indeed I set dark theme to RadChart successfully using StyleManager.
I apply implicit styles for the Dark theme in code below,
Regards
About setting themes and styling WPF controls using implicit styles, I set Dark style to Rad controls successfully but about RadChart , it doesn’t work. indeed I set dark theme to RadChart successfully using StyleManager.
I apply implicit styles for the Dark theme in code below,
Regards
private
static
void
SetTelerikTheme()
{
//Style tbstyle = null;
string
themeName =
"Expression_Dark"
;
telerikResources =
new
List<ResourceDictionary>();
AddTelerikTheme(themeName,
"System.Windows.xaml"
);
AddTelerikTheme(themeName,
"Telerik.ReportViewer.Silverlight.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.Data.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.DataVisualization.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.Diagrams.Extensions.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.Diagrams.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.Docking.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.Expressions.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.FixedDocumentViewers.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.FixedDocumentViewersUI.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.GanttView.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.GridView.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.ImageEditor.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.Input.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.Navigation.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.Pivot.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.PivotFieldList.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.RibbonView.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.RichTextBoxUI.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.ScheduleView.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.Spreadsheet.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Documents.Proofing.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Documents.xaml"
);
AddTelerikTheme(themeName,
"Telerik.Windows.Controls.Chart.xaml"
);
AddTelerikTheme(themeName,
"Expression/Dark/ReportViewer.xaml"
);
AddTelerikTheme(themeName,
"Expression/Dark/ReportViewerDialogBox.xaml"
);
AddTelerikTheme(themeName,
"Expression/Dark/ReportViewerErrorStatus.xaml"
);
foreach
(var res
in
telerikResources)
App.Current.Resources.MergedDictionaries.Add(res);
}
private
static
List<ResourceDictionary> telerikResources =
new
List<ResourceDictionary>();
private
static
void
AddTelerikTheme(
string
themeName,
string
dictionaryName)
{
try
{
telerikResources.Add(
new
ResourceDictionary()
{
Source =
new
Uri(
"/Telerik.Windows.Themes."
+ themeName +
";component/Themes/"
+ dictionaryName,
UriKind.RelativeOrAbsolute)
});
}
catch
(Exception ex)
{
MessageBox.Show(
dictionaryName +
"\r\n"
+
ex.Message);
}
}