Пример #1
0
        static void SnoopChildPopupClosed(object sender, EventArgs e)
        {
            var popup = (Popup)sender;

            if (popup.Child != null)
            {
                // Cannot use 'popup' as a snoop part, since it's not
                // going to be in the PopupRoot's visual tree. The closest
                // object in the PopupRoot's tree is popup.Child:
                SnoopPartsRegistry.RemoveSnoopVisualTreeRoot(popup.Child);
            }
        }
Пример #2
0
        private static void SnoopChildPopupOpened(object?sender, EventArgs e)
        {
            var popup = (Popup?)sender;

            if (popup?.Child is not null)
            {
                // Cannot use 'popup' as a snoop part, since it's not
                // going to be in the PopupRoot's visual tree. The closest
                // object in the PopupRoot's tree is popup.Child:
                SnoopPartsRegistry.AddSnoopVisualTreeRoot(popup.Child);
            }
        }