private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { NavigationWindow nw = GetDependencyObjectFromVisualTree(this, typeof(NavigationWindow)) as NavigationWindow; if (!salir) { nw.DragMove(); } else { salir = false; } }