TileDragDropService
Reorders Panorama tiles and scrolls the view automatically while a tile is dragged near a horizontal edge.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class TileDragDropService : RadDragDropService, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IMessageListener
Inheritance: objectDisposableObjectRadObjectRadServiceRadDragDropServiceTileDragDropService...
Implements:
Inherited Members
Constructors
Initializes the drag-and-drop service for a Panorama element.
public TileDragDropService(RadPanoramaElement owner)
The Panorama whose tiles can be reordered.
Properties
Gets or sets the offset from the edges of the control at which automatic scrolling starts.
public int AutoScrollOffset { get; set; }
Methods
Checks that a candidate cell has nonnegative indices and that the requested row span fits within the Panorama's row count.
protected virtual bool CanPlaceElementAtPosition(int rowIndex, int columnIndex, int colSpan, int rowSpan)
The candidate zero-based row.
columnIndexintThe candidate zero-based column.
colSpanintThe number of columns occupied by the tile.
rowSpanintThe number of rows occupied by the tile.
Returns:true when the row and column bounds pass this check; otherwise, false.
Allows drag operations only at runtime and when the owning Panorama enables tile drag-and-drop.
Converts a point in a tile group to the row and column of its grid cell.
protected virtual Point GetCellAtPoint(TileGroupElement group, Point location)
The group whose cell size defines the grid.
locationPointThe point within the group's content layout.
Returns:A point containing the row in X and column in Y.
Gets the top-left coordinates of a cell in a tile group's grid.
protected PointF GetCellCoordinates(TileGroupElement group, int rowIndex, int columnIndex)
The group whose cell size defines the grid.
rowIndexintThe zero-based row index.
columnIndexintThe zero-based column index.
Returns:The cell's top-left point in group layout coordinates.
Resolves the drop target after correcting the pointer location for the dragged-item outline offset.
protected override ISupportDrop GetDropTarget(Point mousePosition, out Point resultDropLocation)
The pointer location used for hit testing.
resultDropLocationPointThe drop location returned by the base hit test.
Returns:The drop target identified by the base drag-and-drop service.
Overrides:
Finds the closest candidate cell that can contain the dragged tile's row and column spans.
protected virtual Point GetTargetCell(RadTileElement source, Point location)
The tile being placed.
locationPointThe pointer location in the ungrouped tile layout.
Returns:A point containing the row in X and column in Y, or (-1, -1) when no candidate can fit.
Finds the closest candidate cell around the drop point in a tile group.
protected virtual Point GetTargetCell(TileGroupElement group, Point dropLocation)
The group containing the candidate cells.
dropLocationPointThe drop location in the containing control's client coordinates.
Returns:A nearby candidate row in X and column in Y; this method does not validate the candidate against the group bounds.
Returns the first tile group whose bounds intersect the proposed tile rectangle.
protected virtual TileGroupElement GetTargetGroup(RectangleF tileRectangle)
The proposed tile bounds in control coordinates.
Returns:The first intersecting group, or null when none intersects.
Places the dragged tile in the target group and shifts overlapping tiles to make room.
protected virtual void HandleGroupedDragDrop(RadDropEventArgs e)
The resolved drop target and location.
Starts edge auto-scrolling near the left or right border; otherwise, updates the hovered insertion tile.
protected override void HandleMouseMove(Point mousePos)
The pointer location in screen coordinates.
Overrides:
Places the dragged tile in the ungrouped grid and shifts overlapping tiles to make room.
protected virtual void HandleUngroupedDragDrop(RadDropEventArgs e)
The resolved drop target and location.
Accepts Panorama elements and tile elements as valid drop targets.
protected override bool IsDropTargetValid(ISupportDrop dropTarget)
The potential drop target.
Returns:true for a RadPanoramaElement or RadTileElement.
Overrides:
Offsets the tile at the resolved insertion cell to provide drag-over feedback.
Applies the grouped or ungrouped tile reorder, stops auto-scrolling, and animates the dragged tile into its new position.
protected override void OnPreviewDragDrop(RadDropEventArgs e)
The resolved drop target and location.
Overrides:
Extends the grid at its right edge when needed or scrolls the view after the edge-hover delay.
protected virtual void OnScrollTimerTick()
Restores the dragged tile, stops scrolling, clears the hovered insertion offset, and zooms tiles back in.
protected override void PerformStop()
Overrides:
Hides the dragged item, records the pointer offset within it, and zooms out the other tiles.
protected override bool PrepareContext()
The result of preparing the base drag context.
Overrides: