An view port element of RadAutoCompleteBoxElement
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class AutoCompleteBoxViewElement : TextBoxViewElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, INotifyPropertyChangingEx
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementTextBoxWrapPanelTextBoxViewElementAutoCompleteBoxViewElement...
Implements:
Inherited Members
Constructors
Initializes a new instance of the AutoCompleteBoxViewElement class.
public AutoCompleteBoxViewElement()
Fields
The default minimum height of a line containing tokenized content, before DPI scaling.
protected const float DefaultMinLineHeight = 18
An unbounded size used to measure a token block's preferred dimensions.
protected static readonly SizeF InfinitySize
The block type used to identify tokenized text blocks during creation and layout.
protected static readonly Type TokenizedTextBlockElementType
Properties
Gets or sets the delimiter used to tokenize the text
public char Delimiter { get; set; }
The delimiter.
Gets or sets the height of the min line.
protected float MinLineHeight { get; set; }
The height of the min line.
Gets or sets a value indicating whether the remove button of TokenizedTextBlockElement should appear. Notice that the text box should not be in read only mode
public bool ShowRemoveButton { get; set; }
true if [show remove button]; otherwise, false.
Methods
Ensures each line meets the minimum token-row height and carries the resulting height forward.
Prevents token blocks and delimiter-terminated text blocks from being merged during wrapping; other pairs use the base rule.
protected override bool AreSplittedBlock(ITextBlock firstBlock, ITextBlock secondBlock)
The earlier block in the view.
secondBlockITextBlockThe following block in the view.
Returns:Overrides:
Creates a token or editable text block, notifies block-creation handlers, and assigns its text.
protected override ITextBlock CreateBlock(string text, Type type)
The text assigned to the new block.
typeTypeThe token or text block type to create.
Returns:The created and initialized text block.
Exceptions: InvalidOperationExceptionA block-creation handler leaves the block as null.
Overrides:
Creates token and editable text blocks by splitting the supplied text at the configured delimiter.
protected override void CreateTextBlocksOverride(string text)
The text to divide into view blocks.
Overrides:
Extracts text from a block range, including the delimiter when the range reaches the end of a token block.
protected override string GetBlockText(ITextBlock block, int start, int length)
The block containing the requested text.
startintThe starting character position.
lengthintThe number of characters to extract.
Returns:The text represented by the requested range.
Overrides:
Sets line spacing for the wrapped text and token rows.
protected override void InitializeFields()
Overrides:
Routes token-block insertions through delimiter parsing and sends other block types to the base implementation.
Splits text into token blocks at delimiters, validating completed tokens when requested; invalid tokens remain editable text.
protected virtual int InsertTokenizedTextBlocks(int index, string text, bool performInvalidation)
The child index at which to insert the generated blocks.
textstringThe text to split.
performInvalidationbooltrue to raise token validation for delimited values; otherwise, insert token blocks without revalidating.
Returns:The index of the last inserted block, or index minus one if no block is produced.
Determines whether the specified text block is delimiter.
protected bool IsDelimiter(ITextBlock textBlock)
The text block.
Returns:true if the specified text block is delimiter; otherwise, false.
Establishes a minimum token-row height from the control size or a measured sample before measuring the view.
Measures token blocks using the minimum row height and constrains editable text blocks to that height.
protected override void MeasureTextBlockOverride(ITextBlock textBlock, SizeF availableSize)
The block to measure.
availableSizeSizeFThe size available for measurement.
Overrides:
Measures and perfroms wrapping for blocks in WordWrap mode
protected override bool MeasureWrap(SizeF availableSize, int blockIndex, ref SizeF desiredSize, ref int currentLineIndex, ref int offset)
The available size.
blockIndexintIndex of the current block.
desiredSizeSizeFDocument desired size.
currentLineIndexintIndex of the current line.
offsetintThe current block offset.
Returns:Overrides:
Merges and measures compatible blocks, while tracking delimiter-terminated text that may become a token.
protected override void MergeAndMeasureBlock(ITextBlock textBlock, SizeF availableSize)
The block to measure.
availableSizeSizeFThe size available for measurement.
Overrides:
Suppresses child-change processing while a temporary token is measured; otherwise delegates to the base view.
protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
The child element that changed.
changeOperationItemsChangeOperationThe operation performed on the child collection.
Overrides:
Recalculates layout when the read-only state changes because it controls token remove-button visibility.
protected override void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
The property-change notification.
Overrides:
Allows token removal only when the view is editable and the remove button is enabled.
protected override void OnTextBlockFormatting(TextBlockFormattingEventArgs e)
The formatting notification for the text block.
Overrides:
Converts a completed delimiter-terminated segment to a token when validation succeeds, then notifies the base view of the edit.
protected override void OnTextChanged(EventArgs e)
The text-change notification, including the edited text and caret position.
Overrides:
Raises the event.
protected virtual void OnTokenValidating(TokenValidatingEventArgs e)
The TokenValidatingEventArgs instance containing the event data.
Removes range of the editable block.
protected virtual int RemoveEditableBlockRange(ITextBlock tailBlock, int startCharPosition, out string text)
The block.
startCharPositionintThe start char position.
textstringThe text.
Returns:Tokenizes delimiter-containing input when the selection is collapsed, starting at the previous editable token boundary.
protected override void ReplaceOverride(TextPosition startPosition, TextPosition endPosition, string text)
The start of the replacement range.
endPositionTextPositionThe end of the replacement range.
textstringThe replacement text.
Overrides:
Preserves token boundaries during range replacement and parses inserted text containing the configured delimiter into blocks.
protected override void ReplaceTextRange(ITextBlock targetBlock, int startCharPosition, int endCharPosition, string text)
The block containing the replacement range.
startCharPositionintThe starting character position within the block.
endCharPositionintThe ending character position within the block.
textstringThe replacement text.
Overrides:
Keeps token blocks intact when wrapping and delegates splitting of editable text blocks to the base view.
protected override bool SplitBlock(LineInfo currentLine, SizeF availableSize, ref ITextBlock textBlock, ref int offset)
The line currently being measured.
availableSizeSizeFThe remaining size available on that line.
textBlockITextBlockThe block to split when it does not fit.
offsetintThe character offset at which a split may occur.
Returns:false for token blocks; otherwise, the result of the base split operation.
Overrides:
Events
Occurs when text is validating as token
public event TokenValidatingEventHandler TokenValidating