This is a migrated thread and some comments may be shown as answers.

Windows 7 theme problem with Silverlight 5

3 Answers 100 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Krasimir
Top achievements
Rank 1
Krasimir asked on 10 Jan 2012, 03:42 PM
Hello Telerik team,
I've just upgraded my application to Silverlight 5, but I have this error with Windows 7 theme. The problem doesn't occure with any of the other themes.

{Telerik.Windows.Controls.Charting.ChartException: Theming: Required resource not found. Please, make sure you referenced all necessary themes and resources.
   at Telerik.Windows.Controls.Charting.BaseSeriesConverter`1.GetThemeStyle(Object chartItem, Object parameter)
   at Telerik.Windows.Controls.Charting.BaseSeriesConverter`1.Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
   at Telerik.Windows.Controls.Charting.StaticConverter`2.Convert(Object value, Object parameter, CultureInfo culture)
   at Telerik.Windows.Controls.Charting.StaticConverter`2.Convert(Object value, Object parameter)
   at Telerik.Windows.Controls.Charting.ChartLegend.CalculateLegendItemStyle(ChartLegendItem item)
   at Telerik.Windows.Controls.Charting.ChartLegend.CreateLegendItem(DataSeries series, Int32 index)
   at Telerik.Windows.Controls.Charting.ChartLegend.<CreateSeriesLegendItems>d__3.MoveNext()
   at Telerik.Windows.Data.RadObservableCollection`1.AddRange(IEnumerable`1 items)
   at Telerik.Windows.Controls.Charting.ChartLegend.CreateLegendItems(ChartArea chartArea)
   at Telerik.Windows.Controls.Charting.ChartLegend.UpdateLegendItems(ChartArea chartArea)
   at Telerik.Windows.Controls.Charting.ChartArea.UpdateLegend()
   at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
   at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadObservableCollection`1.ResumeNotifications()
   at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.AddRange(IEnumerable`1 items)
   at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ChartArea chartArea)
   at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData)
   at Telerik.Windows.Controls.RadChart.Rebind(Object originalData)
   at Telerik.Windows.Controls.RadChart.Rebind()
   at Telerik.Windows.Controls.RadChart.NotifyCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)
   at Silver.Presentation.Silverlight.ViewModels.Reports.FranchiseBillingTemplateViewModel`1.InitPieChart(String sourceColumn)}
 
I'm receiving this exception as well if it helps 

System.Windows.Markup.XamlParseException occurred
  Message=Set property 'System.Windows.FrameworkElement.Style' threw an exception. [Line: 331 Position: 54]
  LineNumber=331
  LinePosition=54
  StackTrace:
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at Silver.Presentation.Silverlight.Reports.FranchiseBillingPage.InitializeComponent()
       at Silver.Presentation.Silverlight.Reports.FranchiseBillingPage..ctor()
  InnerException: System.Windows.Markup.XamlParseException
       Message=Failed to create a 'System.Type' from the text 'grid:GridViewFilteringDropDown'. [Line: 17 Position: 30]
       LineNumber=17
       LinePosition=30
       StackTrace:
            at MS.Internal.XcpImports.CreateFromXaml(UnmanagedMemoryStream stream, String sourceAssemblyName, Boolean createNamescope, Boolean requireDefaultNamespace, Boolean allowEventHandlers, String xamlResourceUriString, Boolean isBinaryContent)
            at System.Windows.Controls.Control.GetBuiltInStyle(IntPtr nativeTarget, IntPtr& nativeStyle)
       InnerException:
            Message=Error HRESULT E_FAIL has been returned from a call to a COM component.
            StackTrace:
                 at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
                 at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, String s)
                 at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
                 at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
                 at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
                 at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
                 at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter)
                 at System.Windows.ResourceDictionary.set_Source(Uri value)
                 at Telerik.Windows.Controls.Theme.CreateResourceDictionaryForApplicationTheme(Theme theme, String controlAssembly)
                 at Telerik.Windows.Controls.Theme.AddMergedDictionaryFromApplicationTheme(ResourceDictionary generic, String assemblyName)
                 at Telerik.Windows.Controls.Theme.OnApplicationThemeSetterChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
                 at Telerik.Windows.PropertyMetadata.PropertyChangeHook.OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
                 at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
                 at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
                 at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter)
                 at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
                 at Telerik.Windows.Controls.Theme.SetApplicationThemeSetter(DependencyObject obj, String value)
            InnerException:

3 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 13 Jan 2012, 09:43 AM
Hello Krasimir,

The experienced issue is due to some changes in the styling mechanism in the latest version of the control. When creating the chart instance in code-behind you would need to move the configuration code to the RadChart.Loaded event handler.
RadChart chart = new RadChart();
chart.Loaded += (sender, args) =>
{
    ....
   chart.DefaultView.ChartArea.DataSeries.Add(series);
};
Please excuse us for the inconvenience caused and let us know whether this solves your problem.

Greetings,
Sia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Krasimir
Top achievements
Rank 1
answered on 13 Jan 2012, 02:18 PM
Thank you Sia,
Unfortunately this doesn't help me. I'm binding the series in xaml or in loaded event and neither works. Actually the silverlight doesn't reach to the xaml at all. It breaks up in App.xaml.cs file in Application_UserLoaded event.
0
Giuseppe
Telerik team
answered on 16 Jan 2012, 12:57 PM
Hello Krasimir,

This is quite odd as databound scenarios should not require additional changes related to the theming changes introduced in Q3 2011.

Could you open a formal support ticket and send us a runnable sample application that we can investigate locally so we can advise you properly how to proceed (the attached application works here with instance/application theme applied).


Greetings,
Giuseppe
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
General Discussions
Asked by
Krasimir
Top achievements
Rank 1
Answers by
Sia
Telerik team
Krasimir
Top achievements
Rank 1
Giuseppe
Telerik team
Share this question
or