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

Exception

3 Answers 74 Views
TransitionControl
This is a migrated thread and some comments may be shown as answers.
Daní
Top achievements
Rank 1
Daní asked on 23 Apr 2012, 05:07 PM
Hi,

One of my users has detected an extrange exception. I don't know exactly how to report it and neither is related with TransitionControl. I'm using a RadTransitionControl to switch between diferent contents. On each content, I have several controls and I'm using ScreenTips in place of regular Tooltips as I prefer them.

Randomly, when user switches between contents, application halts with an InvalidCastException: "Unable to cast object of type 'MS.Internal.ManagedObjectReference' to type 'System.String'.

Using Intellitrace and Visual Studio Debug, I can break the execution whenever an exception occurs, even if it occurs out of my code. Watching Call Stack window on the exception break I can see the following call stack. It seems is related with TransitionControl and/or ScreenTip. Hope someone has experienced this error before or can help me:

> Telerik.Windows.Controls.RibbonView!Telerik.Windows.Controls.ScreenTip.GetTitle(System.Windows.UIElement element) + 0xa0 bytes
  Telerik.Windows.Controls.RibbonView!Telerik.Windows.Controls.ScreenTip.UpdateScreenTip(System.Windows.UIElement element) + 0x3b bytes
  Telerik.Windows.Controls.RibbonView!Telerik.Windows.Controls.ScreenTip.OnScreentTipInfoChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e) + 0x7c bytes
  Telerik.Windows.Controls!Telerik.Windows.PropertyMetadata.PropertyChangeHook.OnPropertyChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e) + 0x98 bytes
  System.Windows.dll!System.Windows.DependencyObject.RaisePropertyChangeNotifications(System.Windows.DependencyProperty dp, object oldValue, object newValue) + 0x53 bytes
  System.Windows.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.DependencyProperty property, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, System.Windows.DependencyObject.ValueOperation operation) + 0xf3 bytes
  System.Windows.dll!System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty property) + 0xd3 bytes
  System.Windows.dll!MS.Internal.FrameworkCallbacks.InvalidateProperty(System.IntPtr nativeTarget, uint propertyId) + 0xb1 bytes
  [Managed to Native Transition]
  System.Windows.dll!MS.Internal.XcpImports.UIElement_Measure(System.Windows.UIElement element, System.Windows.Size availableSize) + 0x43 bytes
  System.Windows.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) + 0x47 bytes
  System.Windows.dll!System.Windows.Controls.ScrollViewer.MeasureOverride(System.Windows.Size constraint) + 0x1bf bytes
  System.Windows.dll!System.Windows.FrameworkElement.MeasureOverride(System.IntPtr nativeTarget, float inWidth, float inHeight, out float outWidth, out float outHeight) + 0x9e bytes
  [Managed to Native Transition]
  System.Windows.dll!MS.Internal.XcpImports.FrameworkElement_MeasureOverride(System.Windows.FrameworkElement element, System.Windows.Size availableSize) + 0x62 bytes
  System.Windows.dll!System.Windows.FrameworkElement.MeasureOverride(System.Windows.Size availableSize) + 0x18 bytes
  Telerik.Windows.Controls!Telerik.Windows.Controls.TransitionControl.TransitionPresenter.MeasureOverride(System.Windows.Size availableSize) + 0x63 bytes
  System.Windows.dll!System.Windows.FrameworkElement.MeasureOverride(System.IntPtr nativeTarget, float inWidth, float inHeight, out float outWidth, out float outHeight) + 0x9e bytes
  [Managed to Native Transition]
  System.Windows.dll!MS.Internal.XcpImports.UIElement_Measure(System.Windows.UIElement element, System.Windows.Size availableSize) + 0x43 bytes
  System.Windows.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) + 0x47 bytes
  Telerik.Windows.Controls!Telerik.Windows.Controls.TransitionControl.LayoutAnimationPanel.MeasureOverride(System.Windows.Size availableSize) + 0x134 bytes
  System.Windows.dll!System.Windows.FrameworkElement.MeasureOverride(System.IntPtr nativeTarget, float inWidth, float inHeight, out float outWidth, out float outHeight) + 0x9e bytes
  [Managed to Native Transition]
  System.Windows.dll!MS.Internal.XcpImports.FrameworkElement_MeasureOverride(System.Windows.FrameworkElement element, System.Windows.Size availableSize) + 0x62 bytes
  System.Windows.dll!System.Windows.FrameworkElement.MeasureOverride(System.Windows.Size availableSize) + 0x18 bytes
  System.Windows.dll!System.Windows.FrameworkElement.MeasureOverride(System.IntPtr nativeTarget, float inWidth, float inHeight, out float outWidth, out float outHeight) + 0x9e bytes


3 Answers, 1 is accepted

Sort by
0
Viktor Tsvetkov
Telerik team
answered on 26 Apr 2012, 12:14 PM
Hello DanĂ­,

This seems to be very strange issue because it can appear only if the Title property of the ScreenTip is set to something that is not string (the TitleProperty attached dependency property is of type string). So could you please try to reproduce this issue in a separate project and send it to us in order to assist you further?

Kind regards,
Viktor Tsvetkov
the Telerik team

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

0
Daní
Top achievements
Rank 1
answered on 26 Apr 2012, 12:22 PM
Hi Viktor

This error, as you say, is really strange. I finally could solve it but I still don't know why it ocurred. I'm setting many default styles for the controls used in TransitionControl content. I was taking profit for the new Silverlight 5 style data binding feature, so I was setting some control properties (as ScreenTip Title and Description) in these style via data binding. I was already doing that in previous version with Silverlight 4 using a custom style binding mechanism, after SLV 5 upgrade I decided to use the the silverlight built-in style binding mechanism as I expected it would be faster and more elegant. Returning back to my old custom style binding mechanism solved this issue.
0
Viktor Tsvetkov
Telerik team
answered on 01 May 2012, 08:47 AM
Hi DanĂ­,

If you are interested in reproducing the issue in a project that you can send to us we will be able to assist you further investigating the issue and hopefully fixing it. 

All the best,
Viktor Tsvetkov
the Telerik team

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

Tags
TransitionControl
Asked by
Daní
Top achievements
Rank 1
Answers by
Viktor Tsvetkov
Telerik team
Daní
Top achievements
Rank 1
Share this question
or