private static object CoerceIsOpen(DependencyObject d, object basevalue)
        {
            StaysOpenContextMenu menu = (StaysOpenContextMenu)d;

            if (menu.StaysOpen && menu.mustStayOpen)
            {
                return(true);
            }

            return(basevalue);
        }
        private static void PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            StaysOpenContextMenu menu = (StaysOpenContextMenu)d;

            menu.mustStayOpen = (bool)e.NewValue;
        }