Example #1
0
        private void OnInnerChildLoaed(RoutedEventArgs e)
        {
            var innerControl = GetInnerControl();

            if (innerControl == null)
                return;

            Keyboard.Focus(innerControl);

            if (!Popup && e.IsNot<MouseButtonEventArgs>())
                innerControl.Loaded += (s, arg) => innerControl.RaiseEvent(e);

            innerControl.PreviewKeyDown += (s, keyEventArgs) =>
            {
                Dispatcher.BeginInvoke(() => TryEndEdit(keyEventArgs.Key), DispatcherPriority.ContextIdle);
                e.Handled = true;
            };

        }