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

Weird Exception while applying Custom Theme.

1 Answer 50 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Ariel Ben Horesh
Top achievements
Rank 1
Ariel Ben Horesh asked on 01 Nov 2011, 02:39 PM
Hi,
I've added to my solution a custom theme based on the summer theme.
It all works well with other controls, but when I render out a Chart control it throws an exception:

{System.Windows.ApplicationUnhandledExceptionEventArgs}
    base {System.EventArgs}: {System.Windows.ApplicationUnhandledExceptionEventArgs}
    ExceptionObject: {MS.Internal.WrappedException:  [Line: 0 Position: 0] ---> System.Windows.Markup.XamlParseException:  [Line: 0 Position: 0] ---> System.InvalidOperationException: Operation is not valid due to the current state of the object.
   ב System.Windows.Duration.get_TimeSpan()
   ב Telerik.Windows.Controls.Charting.BaseChartItem2D.ConfigureLinearLabelAnimation(Storyboard storyboard)
   ב Telerik.Windows.Controls.Charting.BaseChartItem2D.ConfigureLabelAnimation(Boolean shouldApplyAnimation)
   ב Telerik.Windows.Controls.Charting.BaseChartItem2D.ShowLabel(Boolean shouldApplyAnimation)
   ב Telerik.Windows.Controls.Charting.BaseChartItem2D.ShowLabelWithAnimation()
   ב Telerik.Windows.Controls.Charting.BaseChartItem2D.OnApplyTemplate()
   ב Telerik.Windows.Controls.Charting.BasePointMarkChartItem.OnApplyTemplate()
   ב System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)

   ב MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
   ב MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
   ב MS.Internal.XcpImports.FrameworkElement_ApplyTemplate(FrameworkElement frameworkElement)
   ב System.Windows.Controls.ItemContainerGenerator.LayoutStatesManager.GetElementRoot(Boolean templatesAreGenerated)
   ב System.Windows.Controls.ItemContainerGenerator.LayoutStatesManager.Load()
   ב System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
   ב System.Windows.Controls.ItemsControl.AddVisualChild(Int32 containerIndex, DependencyObject container, Boolean needPrepareContainer)
   ב System.Windows.Controls.ItemsControl.AddContainers()
   ב System.Windows.Controls.ItemsControl.RecreateVisualChildren(IntPtr unmanagedObj)

    Handled: false

Any ideas ? 
Thanks 
Ariel

1 Answer, 1 is accepted

Sort by
0
Accepted
Sia
Telerik team
answered on 03 Nov 2011, 09:59 AM
Hello Ariel Ben Horesh,

When you have a custom theme applied to RadChart, there is one step in addition which needs to be done with the chart xaml. More information can be found in our help, and this help topic in particular. You need to add storyboards for your custom theme in the Chart.xaml file.

Kind regards,
Sia
the Telerik team

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

Tags
Chart
Asked by
Ariel Ben Horesh
Top achievements
Rank 1
Answers by
Sia
Telerik team
Share this question
or