You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suddenly an unhandled Exception is thrown namely:
'System.Windows.Documents.Run' is not a Visual or Visual3D'
The exception occurs in
VisualTreeExtensions.cs in the Method GetVisualAncestor<T>(this
DependencyObject d) where T : class
To solve the problem I would add a check like so:
public static T GetVisualAncestor<T>(this DependencyObject d) where T :
class
{
if (d is Visual || d is System.Windows.Media.Media3D.Visual3D)
{
DependencyObject item = VisualTreeHelper.GetParent(d);
while (item != null)
{
T itemAsT = item as T;
if (itemAsT != null) return itemAsT;
item = VisualTreeHelper.GetParent(item);
}
}
return null;
From gro...@gmail.com on June 22, 2010 10:35:56
Could you give me more information about this issue please? Where is the Run defined? If you could provide a minimal XAML example that would be helpful.
From jbo...@gmail.com on February 14, 2011 17:16:39
I was having this problem too. But using a fix like this prevented me from dragging something that has a Run in it if the user clicks on the Run.
Here is a patch to fix it. The patch also updates to VS 2010 and dot net 4, but you can reverse the changes to the .csproj file if you don't want that.
Original author: manfred....@gmail.com (June 04, 2010 12:57:40)
Suddenly an unhandled Exception is thrown namely:
'System.Windows.Documents.Run' is not a Visual or Visual3D'
The exception occurs in
VisualTreeExtensions.cs in the Method GetVisualAncestor<T>(this
DependencyObject d) where T : class
To solve the problem I would add a check like so:
public static T GetVisualAncestor<T>(this DependencyObject d) where T :
class
{
if (d is Visual || d is System.Windows.Media.Media3D.Visual3D)
{
DependencyObject item = VisualTreeHelper.GetParent(d);
}
Original issue: http://code.google.com/p/gong-wpf-dragdrop/issues/detail?id=17
The text was updated successfully, but these errors were encountered: