private VisualCollection _visualChildren; //visual children. #endregion Fields #region Constructors public EditBoxAdorner(EditBox editBox, UIElement adornedElement) : base(adornedElement) { _editBox = editBox; _visualChildren = new VisualCollection(this); BuildTextBox(); }
public EditBoxAdorner(EditBox editBox, UIElement adornedElement) : base(adornedElement) { _editBox = editBox; _visualChildren = new VisualCollection(this); BuildTextBox(); }
public static object IsEditingCoerce(DependencyObject s, object v) { EditBox eb = (EditBox)s; if (!eb.IsEditable) { return(false); } return(v); }
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 }
public static void IsEditingChanged(DependencyObject s, DependencyPropertyChangedEventArgs e) { EditBox eb = (EditBox)s; eb._adorner.UpdateVisibilty((bool)e.NewValue); }