コード例 #1
0
ファイル: EditBoxAdorner.cs プロジェクト: Choi-Insu/arrengers
        private VisualCollection _visualChildren; //visual children.

        #endregion Fields

        #region Constructors

        public EditBoxAdorner(EditBox editBox, UIElement adornedElement)
            : base(adornedElement)
        {
            _editBox = editBox;
            _visualChildren = new VisualCollection(this);
            BuildTextBox();
        }
コード例 #2
0
 public EditBoxAdorner(EditBox editBox, UIElement adornedElement)
     : base(adornedElement)
 {
     _editBox        = editBox;
     _visualChildren = new VisualCollection(this);
     BuildTextBox();
 }
コード例 #3
0
        public static object IsEditingCoerce(DependencyObject s, object v)
        {
            EditBox eb = (EditBox)s;

            if (!eb.IsEditable)
            {
                return(false);
            }
            return(v);
        }
コード例 #4
0
        public EditBoxAdorner(EditBox editBox, UIElement adornedElement)
            : base(adornedElement)
        {
            _editBox        = editBox;
            _visualChildren = new VisualCollection(this);
            BuildTextBox();

            #region Block Enter command

            enterCommandBinding = new CommandBinding(ApplicationCommands.Open,
                                                     (ExecutedRoutedEventHandler) delegate(object sender, ExecutedRoutedEventArgs e)
            {
                e.Handled = true;
            },
                                                     (CanExecuteRoutedEventHandler) delegate(object sender, CanExecuteRoutedEventArgs e)
            {
                e.CanExecute = true;
            });
            CommandManager.RegisterClassCommandBinding(typeof(EditBoxAdorner), enterCommandBinding);
            //CommandManager.RegisterClassInputBinding(typeof(EditBoxAdorner), new InputBinding(ApplicationCommands.Open, new KeyGesture(Key.Enter)));
            #endregion
        }
コード例 #5
0
        public static void IsEditingChanged(DependencyObject s, DependencyPropertyChangedEventArgs e)
        {
            EditBox eb = (EditBox)s;

            eb._adorner.UpdateVisibilty((bool)e.NewValue);
        }