private static void AddNamedChild(Panel panel, SysWindows::FrameworkElement childElement)
 {
     if (panel.GetValue(SysWindows.NameScope.NameScopeProperty) == null)
     {
         SysWindows::NameScope.SetNameScope(panel, new SysWindows::NameScope());
     }
     panel.Children.Add(childElement);
     panel.RegisterName(childElement.Name, childElement);
 }
            private object FindContent()
            {
                SysWindows::FrameworkElement content = this.AssociatedObject as SysWindows::FrameworkElement;

                while (content != null)
                {
                    SysWindows::FrameworkElement parent = content.Parent as SysWindows::FrameworkElement ?? content.TemplatedParent as SysWindows::FrameworkElement;
                    if (parent == null || parent is SysWindows::Window)
                    {
                        break;
                    }
                    else
                    {
                        content = parent;
                    }
                }
                return(content);
            }
 protected override void OnTargetChanged(SysWindows::FrameworkElement oldTarget, SysWindows::FrameworkElement newTarget)
 {
     base.OnTargetChanged(oldTarget, newTarget);
 }
 public void ChangeTarget(SysWindows::FrameworkElement oldTarget, SysWindows::FrameworkElement newTarget)
 {
     this.OnTargetChanged(oldTarget, newTarget);
 }