Class TokenizedTextBox
Implementation of RichTextBox that supports editing tokens.
Inheritance
Implements
Inherited Members
Namespace: Phoenix.Aruba.Controls
Assembly: Phoenix.Plugin.Aruba.dll
Syntax
public class TokenizedTextBox : RichTextBox, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild
Constructors
View SourceTokenizedTextBox()
Initializes a new instance of the TokenizedTextBox class.
Declaration
public TokenizedTextBox()
Fields
View SourceAreTokensReadOnlyProperty
Indicates whether tokens are allowed to be deleted.
Declaration
public static readonly DependencyProperty AreTokensReadOnlyProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ContainerNameProperty
The name property used to give the specific name of each control.
Declaration
public static readonly DependencyProperty ContainerNameProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CreateTokenSelectorProperty
Delegate of a function creating a Token Selector.
Declaration
public static readonly DependencyProperty CreateTokenSelectorProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
DefaultPrivateTemplateValueProperty
The default text contents for Private Template.
Declaration
public static readonly DependencyProperty DefaultPrivateTemplateValueProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FieldNameProperty
The name of the field this tokenized text box is associated with.
Declaration
public static readonly DependencyProperty FieldNameProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
HelperTextProperty
The helper text for this field.
Declaration
public static readonly DependencyProperty HelperTextProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
InvalidTokenTemplateProperty
The DataTemplate used to present an invalid token in UI.
Declaration
public static readonly DependencyProperty InvalidTokenTemplateProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsFromParentProperty
Whether this field was populated by a parent.
Declaration
public static readonly DependencyProperty IsFromParentProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsHtmlProperty
Identifies the IsHtml dependency property.
Declaration
public static readonly DependencyProperty IsHtmlProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsInDesignModeProperty
Identifies the IsInDesignModeProperty dependency property.
Declaration
public static readonly DependencyProperty IsInDesignModeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsPrivateTemplateProperty
Identifies the IsPrivateTemplate dependency property.
Declaration
public static readonly DependencyProperty IsPrivateTemplateProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsRichTextProperty
Identifies the IsRichText dependency property.
Declaration
public static readonly DependencyProperty IsRichTextProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
OverrideParentProperty
Whether the field is overriding the parent.
Declaration
public static readonly DependencyProperty OverrideParentProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ParentNameProperty
The name of the parent that is populating this field.
Declaration
public static readonly DependencyProperty ParentNameProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TextProperty
The text content including {ResolverName:TokenName}-representation of tokens.
Declaration
public static readonly DependencyProperty TextProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TextWrappingProperty
Identifies the System.Windows.Controls.TextBox.TextWrapping dependency property.
Declaration
public static readonly DependencyProperty TextWrappingProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TokenParserProperty
Delegate of a function parsing a string that contains token references adorned by {} among other text. The function returns an enumeration of tokenized items.
Declaration
public static readonly DependencyProperty TokenParserProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TokenTemplateProperty
The DataTemplate used to present a token in UI.
Declaration
public static readonly DependencyProperty TokenTemplateProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TokenTypeProperty
Identifies the TokenType dependency property.
Declaration
public static readonly DependencyProperty TokenTypeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
View SourceAddHelperTextCommand
Gets the Add Helper Text Command.
Declaration
public DelegateCommand AddHelperTextCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
AddLinkToRichTextCommand
Gets the Add Link to Rich Text Command.
Declaration
public DelegateCommand AddLinkToRichTextCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
AddTokenCommand
Gets the Add Token Command.
Declaration
public ICommand AddTokenCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
AreTokensReadOnly
Gets or sets a value indicating whether tokens are allowed to be deleted.
Declaration
public bool AreTokensReadOnly { get; set; }
Property Value
Type | Description |
---|---|
bool |
ColorList
Gets or sets an array of system colors to be used by the UI as a drop down for color selection.
Declaration
public static Array ColorList { get; set; }
Property Value
Type | Description |
---|---|
Array |
ContainerName
Gets or sets the name of control{s}.
Declaration
public string ContainerName { get; set; }
Property Value
Type | Description |
---|---|
string |
CreateTokenSelector
Gets or sets the delegate of a function creating a Token Selector.
Declaration
public Func<ITokenSelector> CreateTokenSelector { get; set; }
Property Value
Type | Description |
---|---|
Func<ITokenSelector> |
DefaultPrivateTemplateValue
Gets or sets the default text contents for Private Template.
Declaration
public string DefaultPrivateTemplateValue { get; set; }
Property Value
Type | Description |
---|---|
string |
FieldName
Gets or sets the name of the field associated with this tokenized text box.
Declaration
public string FieldName { get; set; }
Property Value
Type | Description |
---|---|
string |
HasTokens
Gets a value indicating whether there are tokens in this field.
Declaration
public bool HasTokens { get; }
Property Value
Type | Description |
---|---|
bool |
HelperText
Gets or sets the helper text content.
Declaration
public string HelperText { get; set; }
Property Value
Type | Description |
---|---|
string |
InvalidTokenTemplate
Gets or sets the DataTemplate used to present a token in UI.
Declaration
public DataTemplate InvalidTokenTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate |
IsFromParent
Gets or sets a value indicating whether the field is populated by its parent.
Declaration
public bool IsFromParent { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsHtml
Gets or sets a value indicating whether the text box displays text as html.
Declaration
public bool IsHtml { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsInDesignMode
Gets or sets a value indicating whether module is currently in design mode.
Declaration
public bool IsInDesignMode { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsPrivateTemplate
Gets or sets a value indicating whether the current template is a Private Template.
Declaration
public bool IsPrivateTemplate { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsRichText
Gets or sets a value indicating whether the text box allows RichText format.
Declaration
public bool IsRichText { get; set; }
Property Value
Type | Description |
---|---|
bool |
OverrideParent
Gets or sets a value indicating whether the field is overriding the parent.
Declaration
public bool OverrideParent { get; set; }
Property Value
Type | Description |
---|---|
bool |
ParentName
Gets or sets the name of the parent this field is getting it's value from.
Declaration
public string ParentName { get; set; }
Property Value
Type | Description |
---|---|
string |
RemoveLinkFromRichTextCommand
Gets the Remove Link from Rich Text Command.
Declaration
public DelegateCommand RemoveLinkFromRichTextCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
SetFontColorCommand
Gets the Set Font Color Command.
Declaration
public DelegateCommand<object> SetFontColorCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<object> |
SetFontFamilyCommand
Gets the Set Font Family Command.
Declaration
public DelegateCommand<object> SetFontFamilyCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<object> |
SetFontSizeCommand
Gets the Set Font Size Command.
Declaration
public DelegateCommand<string> SetFontSizeCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<string> |
SetHighlightColorCommand
Gets the Set Highlight Color Command.
Declaration
public DelegateCommand<object> SetHighlightColorCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<object> |
Text
Gets or sets the text content including {ResolverName:TokenName}-representation of tokens.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
string |
TextWrapping
Gets or sets how the text box should wrap text.
Declaration
public TextWrapping TextWrapping { get; set; }
Property Value
Type | Description |
---|---|
TextWrapping |
TokenParser
Gets or sets the delegate of a function parsing a string that contains token references adorned by {} among other text. The function return an enumeration of tokenized items.
Declaration
public Func<string, List<TokenizedItemViewModel>> TokenParser { get; set; }
Property Value
Type | Description |
---|---|
Func<string, List<TokenizedItemViewModel>> |
TokenTemplate
Gets or sets the DataTemplate used to present a token in UI.
Declaration
public DataTemplate TokenTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate |
TokenType
Gets or sets a value indicating token type of the text box.
Declaration
public TextBoxTokenType TokenType { get; set; }
Property Value
Type | Description |
---|---|
TextBoxTokenType |
TokenizedParent
Gets or sets the tokenized parent control if there is one.
Declaration
public object TokenizedParent { get; set; }
Property Value
Type | Description |
---|---|
object |
Methods
View SourceOnDrop(DragEventArgs)
Invoked whenever an unhandled System.Windows.DragDrop.DragEnter attached routed event reaches an element derived from this class in its route. Implement this method to add class handling for this event.
Declaration
protected override void OnDrop(DragEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DragEventArgs | e | Provides data about the event. |
Overrides
View SourceOnLostFocus(RoutedEventArgs)
Overrides OnLostFocus to map field images to the bug for rich text.
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | The event parameter. |
Overrides
View SourceOnPreviewKeyDown(KeyEventArgs)
Opens the Token selector pop-up on key press.
Declaration
protected override void OnPreviewKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
KeyEventArgs | e | The event argument. |
Overrides
View SourceOnStyleChanged(Style, Style)
Overrides the OnStyleChanged event to add or remove a handler based on whether this is a multi-line textbox (multi-line defined as AcceptsReturn == true).
Declaration
protected override void OnStyleChanged(Style oldStyle, Style newStyle)
Parameters
Type | Name | Description |
---|---|---|
Style | oldStyle | The previous style. |
Style | newStyle | The new style. |
Overrides
View SourceOnTextChanged(TextChangedEventArgs)
Updates the tokenized item list and the document to support token editing.
Declaration
protected override void OnTextChanged(TextChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TextChangedEventArgs | e | The event parameter. |
Overrides
View SourceOnTextPropertyChangedActions()
Sets new content for RichTextBox when the Text property was assigned externally (this method is called from the OnChanged Text dependency property handler).
Declaration
public void OnTextPropertyChangedActions()
Events
View SourceUpdateCompleteEventHandler
Event raised when the text within the combo box has updated completely.
Declaration
public event EventHandler UpdateCompleteEventHandler
Event Type
Type | Description |
---|---|
EventHandler |
UpdateHelperTextCompleteEventHandler
Event raised when the helper text for the combo box has updated completely.
Declaration
public event EventHandler UpdateHelperTextCompleteEventHandler
Event Type
Type | Description |
---|---|
EventHandler |