CoerceContextMenu() private static méthode

private static CoerceContextMenu ( DependencyObject d, object basevalue ) : object
d System.Windows.DependencyObject
basevalue object
Résultat object
Exemple #1
0
        /// <inheritdoc />
        // Handling context menu manually to fix #653
        protected override void OnContextMenuOpening(ContextMenuEventArgs e)
        {
            this.InvalidateProperty(ContextMenuProperty);

            if (this.contentHost?.IsMouseOver == true ||
                this.contentHost?.IsKeyboardFocusWithin == true)
            {
                base.OnContextMenuOpening(e);
            }
            else
            {
                var coerced = ContextMenuService.CoerceContextMenu(this, this.ContextMenu);
                if (coerced != null)
                {
                    this.SetCurrentValue(ContextMenuProperty, coerced);
                }

                base.OnContextMenuOpening(e);
            }
        }