private void Viewport3D_ContextMenuOpening(object sender, ContextMenuEventArgs e) { Point location = Mouse.GetPosition(viewport); HitTestResult hit = VisualTreeHelper.HitTest(viewport, location); var meshHit = hit as RayMeshGeometry3DHitTestResult; var sphere = spheres.Where(s => s.Geometry.Equals(meshHit.ModelHit)).FirstOrDefault(); if (sphere == null) // if Model3D object weren't touched { e.Handled = true; } else { SelectedSphere = sphere; } }