예제 #1
0
        protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
        {
            base.OnMouseLeftButtonUp(e);
            if (e.Handled || !this.IsEnabled)
            {
                return;
            }
            Legend owner = this.Owner;

            if (owner == null)
            {
                return;
            }
            owner.FireItemClick(this);
            e.Handled = true;
        }
예제 #2
0
        private bool ProcessKeysUp(Key key)
        {
            bool   flag   = false;
            Legend legend = this.Owner;

            if (legend == null)
            {
                return(flag);
            }
            switch (key)
            {
            case Key.Return:
            case Key.Space:
                legend.FireItemClick(this);
                break;

            case Key.Prior:
                LegendItem legendItem1 = Enumerable.FirstOrDefault <LegendItem>(Enumerable.OfType <LegendItem>((IEnumerable)legend.Items), (Func <LegendItem, bool>)(item => item.IsInLegendVisibleArea(legend)));
                flag = legend.SetFocusToItem(legendItem1);
                break;

            case Key.Next:
                if (!this.IsInLegendVisibleArea(legend))
                {
                    LegendItem legendItem2 = Enumerable.FirstOrDefault <LegendItem>(Enumerable.OfType <LegendItem>((IEnumerable)legend.Items), (Func <LegendItem, bool>)(item => item.IsInLegendVisibleArea(legend)));
                    flag = legend.SetFocusToItem(legendItem2);
                    break;
                }
                LegendItem legendItem3 = (LegendItem)legend.Items[legend.Items.Count - 1];
                legend.SetFocusToItem(legendItem3);
                break;

            case Key.End:
                LegendItem legendItem4 = (LegendItem)legend.Items[legend.Items.Count - 1];
                flag = legend.SetFocusToItem(legendItem4);
                break;

            case Key.Home:
                LegendItem legendItem5 = (LegendItem)legend.Items[0];
                flag = legend.SetFocusToItem(legendItem5);
                break;
            }
            return(flag);
        }