Exemple #1
0
        internal static bool ToolTipIsEnabled(DependencyObject o, TriggerAction triggerAction)
        {
            object tooltipObject = GetToolTip(o);

            if ((tooltipObject != null) && GetIsEnabled(o))
            {
                // determine whether tooltip-on-keyboard-focus is enabled
                bool enableOnKeyboardFocus = true;
                if (triggerAction == TriggerAction.KeyboardFocus)
                {
                    // attached property on owner has first priority
                    bool?propertyValue = GetShowsToolTipOnKeyboardFocus(o);

                    // if that doesn't say, get the value from the ToolTip itself (if any)
                    if (propertyValue == (bool?)null)
                    {
                        ToolTip tooltip = tooltipObject as ToolTip;
                        if (tooltip != null)
                        {
                            propertyValue = tooltip.ShowsToolTipOnKeyboardFocus;
                        }
                    }

                    // the behavior is enabled, unless explicitly told otherwise
                    enableOnKeyboardFocus = (propertyValue != false);
                }

                if ((PopupControlService.IsElementEnabled(o) || GetShowOnDisabled(o)) && enableOnKeyboardFocus)
                {
                    return(true);
                }
            }

            return(false);
        }
        // Token: 0x06004475 RID: 17525 RVA: 0x001377FC File Offset: 0x001359FC
        internal static bool ContextMenuIsEnabled(DependencyObject o)
        {
            bool   result      = false;
            object contextMenu = ContextMenuService.GetContextMenu(o);

            if (contextMenu != null && ContextMenuService.GetIsEnabled(o) && (PopupControlService.IsElementEnabled(o) || ContextMenuService.GetShowOnDisabled(o)))
            {
                result = true;
            }
            return(result);
        }
        private static bool ToolTipIsEnabled(DependencyObject o)
        {
            if ((GetToolTip(o) != null) && GetIsEnabled(o))
            {
                if (PopupControlService.IsElementEnabled(o) || GetShowOnDisabled(o))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #4
0
        internal static bool ContextMenuIsEnabled(DependencyObject o)
        {
            bool   contextMenuIsEnabled = false;
            object menu = GetContextMenu(o);

            if ((menu != null) && GetIsEnabled(o))
            {
                if (PopupControlService.IsElementEnabled(o) || GetShowOnDisabled(o))
                {
                    contextMenuIsEnabled = true;
                }
            }

            return(contextMenuIsEnabled);
        }
        // Token: 0x060058B7 RID: 22711 RVA: 0x00188DF4 File Offset: 0x00186FF4
        private static bool ToolTipIsEnabled(DependencyObject o, ToolTip.ToolTipTrigger triggerAction)
        {
            object toolTip = ToolTipService.GetToolTip(o);

            if (toolTip != null && ToolTipService.GetIsEnabled(o))
            {
                ToolTip toolTip2 = toolTip as ToolTip;
                bool    flag     = toolTip2 == null || toolTip2.ShouldShowOnKeyboardFocus;
                if ((PopupControlService.IsElementEnabled(o) || ToolTipService.GetShowOnDisabled(o)) && (triggerAction != ToolTip.ToolTipTrigger.KeyboardFocus || flag))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #6
0
        private static bool ToolTipIsEnabled(DependencyObject o, ToolTip.ToolTipTrigger triggerAction)
        {
            object tooltipObject = GetToolTip(o);

            if ((tooltipObject != null) && GetIsEnabled(o))
            {
                // Some tooltips may choose not to show on Keyboard focus, get the ToolTip and query the property,
                // if we are unable to cast to a ToolTip that means a default ToolTip will be used, the default behavior is to show on focus.
                ToolTip tooltip = tooltipObject as ToolTip;
                bool    enableOnKeyboardFocus = tooltip != null ? tooltip.ShouldShowOnKeyboardFocus : true;

                if ((PopupControlService.IsElementEnabled(o) || GetShowOnDisabled(o)) &&
                    (triggerAction != ToolTip.ToolTipTrigger.KeyboardFocus || enableOnKeyboardFocus))
                {
                    return(true);
                }
            }

            return(false);
        }