Example #1
0
        private void ConnectToGroup()
        {
            DisconnectFromGroup();

            var manager = WPFTreeExtensions.TryFindVisualAncestor <IHwndAdornerManager>(m_elementAttachedTo);

            m_hwndAdornerGroup = manager == null ? new HwndAdornerGroup(m_elementAttachedTo) : manager.AdornerGroup;
            m_hwndAdornerGroup.AddAdorner(this);
        }
        private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
        {
            var manager = WPFTreeExtensions.TryFindVisualAncestor <IHwndHostManager>(AssociatedObject);

            if (m_hostManager != manager)
            {
                DisconnectFromManager();
                ConnectToManager(manager);
            }
        }