private void GetParenteControl() { SemanticZoomOutView ownerControl = null; this.GetControls(VisualTreeHelper.GetParent(this), ref ownerControl); ControlsOwner = ownerControl; }
private void GetControls(DependencyObject parent, ref SemanticZoomOutView ownerControl) { if (parent is ISemanticZoomOutView) { ownerControl = parent as SemanticZoomOutView; } else if (ownerControl == null) { this.GetControls(VisualTreeHelper.GetParent(parent as FrameworkElement), ref ownerControl); } }