Esempio n. 1
0
        // BMK Keyboard operation
        protected override void OnParentKeyDown(object sender, KeyEventArgs e)
        {
            //当Popoup在用键盘选择ListBox的Item时必须阻止让其事件传递下续,因为传递下去位导致选中Cell发生移动
            var isNavigateKey = e.Key.IsNavigateKey();
            if (isNavigateKey && !EditControlIsClosed())
            {
                e.Handled = true;
                return;
            }

            TryEndEdit(e.Key);

            //int32EditBox使用, Popup不需要利用OnParentKeyDown事件而是使用OnParentTextInput
            if (_control == null && !Popup && !isNavigateKey && e.IsNumberKey())
            {
                BeginEdit(e);
            }

            if (!e.Handled)
                base.OnParentKeyDown(sender, e);
        }