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
In "DragDrop.cs", "static void CreateDragAdorner()" raises an exception. I figured out that: I'm not using any Window, just UserControlers, so "Window parentWindow = m_DragInfo.VisualSource.GetVisualAncestor();" will return null, and then
"rootElement = (UIElement)Application.Current.MainWindow.Content;" raises an exception because Application.Current is null.
I fixed here changing
Window parentWindow = m_DragInfo.VisualSource.GetVisualAncestor();
to
UserControl parentWindow = m_DragInfo.VisualSource.GetVisualAncestor(); (exclusive to this project).
The text was updated successfully, but these errors were encountered:
ContentControl parentWindow = m_DragInfo.VisualSource.GetVisualAncestor<Window>();
if (parentWindow == null)
{
// Except, we would probably want to find the top most UserControl,
// the child of the ElementHost.
parentWindow = m_DragInfo.VisualSource.GetVisualAncestor<UserControl>();
}
In "DragDrop.cs", "static void CreateDragAdorner()" raises an exception. I figured out that: I'm not using any Window, just UserControlers, so "Window parentWindow = m_DragInfo.VisualSource.GetVisualAncestor();" will return null, and then
"rootElement = (UIElement)Application.Current.MainWindow.Content;" raises an exception because Application.Current is null.
I fixed here changing
Window parentWindow = m_DragInfo.VisualSource.GetVisualAncestor();
to
UserControl parentWindow = m_DragInfo.VisualSource.GetVisualAncestor(); (exclusive to this project).
The text was updated successfully, but these errors were encountered: