protected override void OnPointerPressed(PointerPressEventArgs e) { if (e.Source == _presenter) { var point = e.GetPosition(_presenter); var index = CaretIndex = _presenter.GetCaretIndex(point); var text = Text; switch (e.ClickCount) { case 1: SelectionStart = SelectionEnd = index; break; case 2: if (!StringUtils.IsStartOfWord(text, index)) { SelectionStart = StringUtils.PreviousWord(text, index, false); } SelectionEnd = StringUtils.NextWord(text, index, false); break; case 3: SelectionStart = 0; SelectionEnd = text.Length; break; } e.Device.Capture(_presenter); e.Handled = true; } }
protected override void OnPointerPressed(PointerPressEventArgs e) { var point = e.GetPosition(this); var index = this.CaretIndex = this.GetCaretIndex(point); var text = this.Text; switch (e.ClickCount) { case 1: this.SelectionStart = this.SelectionEnd = index; break; case 2: if (!StringUtils.IsStartOfWord(text, index)) { this.SelectionStart = StringUtils.PreviousWord(text, index, false); } this.SelectionEnd = StringUtils.NextWord(text, index, false); break; case 3: this.SelectionStart = 0; this.SelectionEnd = text.Length; break; } e.Device.Capture(this); }
/// <inheritdoc/> protected override void OnPointerPressed(PointerPressEventArgs e) { base.OnPointerPressed(e); if (e.MouseButton == MouseButton.Left) { e.Handled = UpdateSelectionFromEventSource(e.Source); } }
protected override void OnPointerPressed(PointerPressEventArgs e) { if (!IsDropDownOpen) { if (((IVisual)e.Source).GetVisualAncestors().Last().GetType() != typeof(PopupRoot)) { IsDropDownOpen = true; } } base.OnPointerPressed(e); }
/// <summary> /// Called when the pointer is pressed anywhere on the window. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The event args.</param> private void TopLevelPreviewPointerPress(object sender, PointerPressEventArgs e) { if (IsOpen) { var control = e.Source as ILogical; if (!this.IsLogicalParentOf(control)) { Close(); } } }
/// <inheritdoc/> protected override void OnPointerPressed(PointerPressEventArgs e) { base.OnPointerPressed(e); PseudoClasses.Add(":pressed"); e.Device.Capture(this); e.Handled = true; if (ClickMode == ClickMode.Press) { RaiseClickEvent(); } }
/// <inheritdoc/> protected override void OnPointerPressed(PointerPressEventArgs e) { base.OnPointerPressed(e); if (e.MouseButton == MouseButton.Left || e.MouseButton == MouseButton.Right) { e.Handled = UpdateSelectionFromEventSource( e.Source, true, (e.InputModifiers & InputModifiers.Shift) != 0, (e.InputModifiers & InputModifiers.Control) != 0); } }
protected override void OnPointerPressed(PointerPressEventArgs e) { e.Device.Capture(this); this.lastPoint = e.GetPosition(this); var ev = new VectorEventArgs { RoutedEvent = DragStartedEvent, Vector = (Vector)this.lastPoint, }; this.RaiseEvent(ev); }
private void PointerPressedOutside(object sender, PointerPressEventArgs e) { if (!StaysOpen) { var root = ((IVisual)e.Source).GetVisualRoot(); if (root != this.PopupRoot) { Close(); e.Handled = true; } } }
protected override void OnPointerPressed(PointerPressEventArgs e) { IVisual source = (IVisual)e.Source; var selectable = source.GetVisualAncestors() .OfType <ISelectable>() .OfType <Control>() .FirstOrDefault(); if (selectable != null) { var container = this.ItemContainerGenerator.GetItemForContainer(selectable); if (container != null) { this.SelectedItem = container; } } }
/// <summary> /// Called when the pointer is pressed over the <see cref="MenuItem"/>. /// </summary> /// <param name="e">The event args.</param> protected override void OnPointerPressed(PointerPressEventArgs e) { base.OnPointerPressed(e); if (!HasSubMenu) { RaiseEvent(new RoutedEventArgs(ClickEvent)); } else if (IsTopLevel) { IsSubMenuOpen = !IsSubMenuOpen; } else { IsSubMenuOpen = true; } e.Handled = true; }
/// <inheritdoc/> protected override void OnPointerPressed(PointerPressEventArgs e) { if (!IsDropDownOpen && ((IVisual)e.Source).GetVisualRoot() != typeof(PopupRoot)) { IsDropDownOpen = true; e.Handled = true; } if (!e.Handled) { if (UpdateSelectionFromEventSource(e.Source)) { _popup?.Close(); e.Handled = true; } } base.OnPointerPressed(e); }
protected override void OnPointerPressed(PointerPressEventArgs e) { if (!IsDropDownOpen) { if (((IVisual)e.Source).GetVisualAncestors().Last().GetType() != typeof(PopupRoot)) { IsDropDownOpen = true; e.Handled = true; } } if (!e.Handled) { if (UpdateSelectionFromEventSource(e.Source)) { e.Handled = true; } } base.OnPointerPressed(e); }
/// <inheritdoc/> protected override void OnPointerPressed(PointerPressEventArgs e) { // Ignore pointer presses. }
/// <inheritdoc/> protected override void OnPointerPressed(PointerPressEventArgs e) { base.OnPointerPressed(e); e.Handled = true; }
/// <summary> /// Handle mouse down to handle selection. /// </summary> protected override void OnPointerPressed(PointerPressEventArgs e) { base.OnPointerPressed(e); LeftMouseButton = true; _htmlContainer?.HandleLeftMouseDown(this, e); }