示例#1
0
        protected virtual void OnItemCommand(TemplatedListCommandEventArgs e)
        {
            TemplatedListCommandEventHandler onItemCommandHandler = (TemplatedListCommandEventHandler)Events[EventItemCommand];

            if (onItemCommandHandler != null)
            {
                onItemCommandHandler(this, e);
            }
        }
示例#2
0
        protected override bool OnBubbleEvent(object source, EventArgs e)
        {
            if (e is CommandEventArgs)
            {
                // Add the information about Item to CommandEvent.

                TemplatedListCommandEventArgs args =
                    new TemplatedListCommandEventArgs(this, source, (CommandEventArgs)e);

                RaiseBubbleEvent(this, args);
                return(true);
            }
            return(false);
        }
示例#3
0
        protected override bool OnBubbleEvent(object source, EventArgs e)
        {
            // Handle events raised by children by overriding OnBubbleEvent.

            bool handled = false;

            if (e is TemplatedListCommandEventArgs)
            {
                TemplatedListCommandEventArgs ce = (TemplatedListCommandEventArgs)e;

                OnItemCommand(ce);
                handled = true;

                if (String.Compare(ce.CommandName, "Select", true) == 0)
                {
                    SelectedIndex = ce.Item.ItemIndex;
                    OnSelectedIndexChanged(EventArgs.Empty);
                }
            }

            return(handled);
        }