예제 #1
0
        /**
         *
         *  Set isProgrammatic to true if you are opening the dropDown programmatically
         *  or not through a mouse click or rollover.
         */
        private void OpenDropDownHelper(bool isProgrammatic = false)
        {
            if (!IsOpen)
            {
                AddCloseTriggers();

                _isOpen = true;
                // Force the button to stay in the down state
                if (null != OpenButton)
                {
                    OpenButton.KeepDown(true, !isProgrammatic);
                }

                DispatchEvent(new DropDownEvent(DropDownEvent.OPEN));
            }
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="commit"></param>
        public void CloseDropDown(bool commit)
        {
            if (IsOpen)
            {
                _isOpen = false;
                if (null != OpenButton)
                {
                    OpenButton.KeepDown(false);
                }

                var dde = new DropDownEvent(DropDownEvent.CLOSE, false, true);

                if (!commit)
                {
                    dde.PreventDefault();
                }

                DispatchEvent(dde);

                RemoveCloseTriggers();
            }
        }