根据Frame.Content获取Frame
public static T GetParent<T>(DependencyObject child) where T : DependencyObject { DependencyObject dependencyObject = VisualTreeHelper.GetParent(child); if (dependencyObject != null) { T parent = dependencyObject as T; if (parent != null) { return parent; } else { return GetParent <T>(dependencyObject); } } else { return null; } }