Class LinkTextBlock
- Namespace
- CarinaStudio.Controls
- Assembly
- CarinaStudio.AppBase.Avalonia.dll
TextBlock which supports open the link.
public class LinkTextBlock : TextBlock, INotifyPropertyChanged, IDataContextProvider, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, IInputElement, IDataTemplateHost, INamed, ISetterValue, ILogical
- Inheritance
-
AvaloniaObjectAnimatableStyledElementVisualLayoutableInteractiveInputElementControlTextBlockLinkTextBlock
- Implements
-
IDataContextProviderIThemeVariantHostIResourceHostIResourceNodeIStyleHostISetLogicalParentISetInheritanceParentIStyleableIInputElementIDataTemplateHostINamedISetterValueILogical
- Derived
- Inherited Members
-
TextBlock.BackgroundPropertyTextBlock.PaddingPropertyTextBlock.FontFamilyPropertyTextBlock.FontSizePropertyTextBlock.FontStylePropertyTextBlock.FontWeightPropertyTextBlock.FontStretchPropertyTextBlock.ForegroundPropertyTextBlock.BaselineOffsetPropertyTextBlock.LineHeightPropertyTextBlock.LineSpacingPropertyTextBlock.LetterSpacingPropertyTextBlock.MaxLinesPropertyTextBlock.TextPropertyTextBlock.TextAlignmentPropertyTextBlock.TextWrappingPropertyTextBlock.TextTrimmingPropertyTextBlock.TextDecorationsPropertyTextBlock.InlinesPropertyTextBlock.GetBaselineOffset(Control)TextBlock.GetTextAlignment(Control)TextBlock.SetTextAlignment(Control, TextAlignment)TextBlock.GetTextWrapping(Control)TextBlock.SetTextWrapping(Control, TextWrapping)TextBlock.GetTextTrimming(Control)TextBlock.SetTextTrimming(Control, TextTrimming)TextBlock.GetLineHeight(Control)TextBlock.GetLetterSpacing(Control)TextBlock.GetMaxLines(Control)TextBlock.Render(DrawingContext)TextBlock.RenderTextLayout(DrawingContext, Point)TextBlock.InvalidateTextLayout()TextBlock.OnMeasureInvalidated()TextBlock.ArrangeOverride(Size)TextBlock.OnCreateAutomationPeer()TextBlock.TextLayoutTextBlock.PaddingTextBlock.BackgroundTextBlock.TextTextBlock.FontFamilyTextBlock.FontSizeTextBlock.FontStyleTextBlock.FontWeightTextBlock.FontStretchTextBlock.ForegroundTextBlock.LineHeightTextBlock.LineSpacingTextBlock.LetterSpacingTextBlock.MaxLinesTextBlock.TextWrappingTextBlock.TextTrimmingTextBlock.TextAlignmentTextBlock.TextDecorationsTextBlock.InlinesTextBlock.BypassFlowDirectionPoliciesTextBlock.BaselineOffsetControl.FocusAdornerPropertyControl.TagPropertyControl.ContextMenuPropertyControl.ContextFlyoutPropertyControl.RequestBringIntoViewEventControl.ContextRequestedEventControl.LoadedEventControl.UnloadedEventControl.SizeChangedEventControl.GetTemplateFocusTarget()Control.OnLoaded(RoutedEventArgs)Control.OnUnloaded(RoutedEventArgs)Control.OnSizeChanged(SizeChangedEventArgs)Control.OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs)Control.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs)Control.OnGotFocus(GotFocusEventArgs)Control.OnLostFocus(RoutedEventArgs)Control.FocusAdornerControl.DataTemplatesControl.ContextMenuControl.ContextFlyoutControl.IsLoadedControl.TagControl.ContextRequestedControl.LoadedControl.UnloadedControl.SizeChangedInputElement.FocusablePropertyInputElement.IsEnabledPropertyInputElement.IsEffectivelyEnabledPropertyInputElement.CursorPropertyInputElement.IsKeyboardFocusWithinPropertyInputElement.IsFocusedPropertyInputElement.IsHitTestVisiblePropertyInputElement.IsPointerOverPropertyInputElement.IsTabStopPropertyInputElement.GotFocusEventInputElement.LostFocusEventInputElement.KeyDownEventInputElement.KeyUpEventInputElement.TabIndexPropertyInputElement.TextInputEventInputElement.TextInputMethodClientRequestedEventInputElement.PointerEnteredEventInputElement.PointerExitedEventInputElement.PointerMovedEventInputElement.PointerPressedEventInputElement.PointerReleasedEventInputElement.PointerCaptureLostEventInputElement.PointerWheelChangedEventInputElement.TappedEventInputElement.HoldingEventInputElement.DoubleTappedEventInputElement.Focus(NavigationMethod, KeyModifiers)InputElement.OnTextInput(TextInputEventArgs)InputElement.OnPointerEntered(PointerEventArgs)InputElement.OnPointerExited(PointerEventArgs)InputElement.OnPointerMoved(PointerEventArgs)InputElement.OnPointerPressed(PointerPressedEventArgs)InputElement.OnPointerCaptureLost(PointerCaptureLostEventArgs)InputElement.OnPointerWheelChanged(PointerWheelEventArgs)InputElement.UpdateIsEffectivelyEnabled()InputElement.FocusableInputElement.IsEnabledInputElement.CursorInputElement.IsKeyboardFocusWithinInputElement.IsFocusedInputElement.IsHitTestVisibleInputElement.IsPointerOverInputElement.IsTabStopInputElement.IsEffectivelyEnabledInputElement.TabIndexInputElement.KeyBindingsInputElement.GestureRecognizersInputElement.GotFocusInputElement.LostFocusInputElement.KeyDownInputElement.KeyUpInputElement.TextInputInputElement.TextInputMethodClientRequestedInputElement.PointerEnteredInputElement.PointerExitedInputElement.PointerMovedInputElement.PointerPressedInputElement.PointerReleasedInputElement.PointerCaptureLostInputElement.PointerWheelChangedInputElement.TappedInputElement.HoldingInputElement.DoubleTappedInteractive.RaiseEvent(RoutedEventArgs)Interactive.BuildEventRoute(RoutedEvent)Layoutable.DesiredSizePropertyLayoutable.WidthPropertyLayoutable.HeightPropertyLayoutable.MinWidthPropertyLayoutable.MaxWidthPropertyLayoutable.MinHeightPropertyLayoutable.MaxHeightPropertyLayoutable.MarginPropertyLayoutable.HorizontalAlignmentPropertyLayoutable.VerticalAlignmentPropertyLayoutable.UseLayoutRoundingPropertyLayoutable.UpdateLayout()Layoutable.ApplyTemplate()Layoutable.Measure(Size)Layoutable.Arrange(Rect)Layoutable.InvalidateMeasure()Layoutable.InvalidateArrange()Layoutable.AffectsMeasure<T>(params AvaloniaProperty[])Layoutable.AffectsArrange<T>(params AvaloniaProperty[])Layoutable.MeasureCore(Size)Layoutable.ArrangeCore(Rect)Layoutable.OnVisualParentChanged(Visual, Visual)Layoutable.WidthLayoutable.HeightLayoutable.MinWidthLayoutable.MaxWidthLayoutable.MinHeightLayoutable.MaxHeightLayoutable.MarginLayoutable.HorizontalAlignmentLayoutable.VerticalAlignmentLayoutable.DesiredSizeLayoutable.IsMeasureValidLayoutable.IsArrangeValidLayoutable.UseLayoutRoundingLayoutable.EffectiveViewportChangedLayoutable.LayoutUpdatedVisual.BoundsPropertyVisual.ClipToBoundsPropertyVisual.ClipPropertyVisual.IsVisiblePropertyVisual.OpacityPropertyVisual.OpacityMaskPropertyVisual.EffectPropertyVisual.HasMirrorTransformPropertyVisual.RenderTransformPropertyVisual.RenderTransformOriginPropertyVisual.FlowDirectionPropertyVisual.VisualParentPropertyVisual.ZIndexPropertyVisual.GetFlowDirection(Visual)Visual.SetFlowDirection(Visual, FlowDirection)Visual.InvalidateVisual()Visual.AffectsRender<T>(params AvaloniaProperty[])Visual.InvalidateMirrorTransform()Visual.BoundsVisual.ClipToBoundsVisual.ClipVisual.IsEffectivelyVisibleVisual.IsVisibleVisual.OpacityVisual.OpacityMaskVisual.EffectVisual.HasMirrorTransformVisual.RenderTransformVisual.RenderTransformOriginVisual.FlowDirectionVisual.ZIndexVisual.VisualChildrenVisual.VisualRootVisual.AttachedToVisualTreeVisual.DetachedFromVisualTreeStyledElement.DataContextPropertyStyledElement.NamePropertyStyledElement.ParentPropertyStyledElement.TemplatedParentPropertyStyledElement.ThemePropertyStyledElement.BeginInit()StyledElement.EndInit()StyledElement.ApplyStyling()StyledElement.InitializeIfNeeded()StyledElement.OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)StyledElement.OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)StyledElement.OnDataContextBeginUpdate()StyledElement.OnDataContextEndUpdate()StyledElement.OnInitialized()StyledElement.NameStyledElement.ClassesStyledElement.DataContextStyledElement.IsInitializedStyledElement.StylesStyledElement.StyleKeyStyledElement.ResourcesStyledElement.TemplatedParentStyledElement.ThemeStyledElement.LogicalChildrenStyledElement.PseudoClassesStyledElement.ParentStyledElement.ActualThemeVariantStyledElement.AttachedToLogicalTreeStyledElement.DetachedFromLogicalTreeStyledElement.DataContextChangedStyledElement.InitializedStyledElement.ResourcesChangedStyledElement.ActualThemeVariantChangedAnimatable.TransitionsPropertyAnimatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)Animatable.TransitionsAvaloniaObject.CheckAccess()AvaloniaObject.VerifyAccess()AvaloniaObject.ClearValue(AvaloniaProperty)AvaloniaObject.ClearValue<T>(AvaloniaProperty<T>)AvaloniaObject.ClearValue<T>(StyledProperty<T>)AvaloniaObject.ClearValue<T>(DirectPropertyBase<T>)AvaloniaObject.GetHashCode()AvaloniaObject.GetValue(AvaloniaProperty)AvaloniaObject.GetValue<T>(StyledProperty<T>)AvaloniaObject.GetValue<T>(DirectPropertyBase<T>)AvaloniaObject.GetBaseValue<T>(StyledProperty<T>)AvaloniaObject.IsAnimating(AvaloniaProperty)AvaloniaObject.IsSet(AvaloniaProperty)AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T)AvaloniaObject.CoerceValue(AvaloniaProperty)AvaloniaObject.RaisePropertyChanged<T>(DirectPropertyBase<T>, T, T)AvaloniaObject.SetAndRaise<T>(DirectPropertyBase<T>, ref T, T)AvaloniaObject.InheritanceParentAvaloniaObject.this[AvaloniaProperty]AvaloniaObject.this[IndexerDescriptor]AvaloniaObject.PropertyChanged
- Extension Methods
Constructors
LinkTextBlock()
Initialize new LinkTextBlock instance.
public LinkTextBlock()
Fields
CommandParameterProperty
Property of CommandParameter.
public static readonly StyledProperty<object?> CommandParameterProperty
Field Value
- StyledProperty<object>
CommandProperty
Property of Command.
public static readonly StyledProperty<ICommand?> CommandProperty
Field Value
- StyledProperty<ICommand>
UriProperty
Property of Uri.
public static readonly StyledProperty<Uri?> UriProperty
Field Value
- StyledProperty<Uri>
Properties
Command
Get or set command to execute when clicking the link.
public ICommand? Command { get; set; }
Property Value
CommandParameter
Get or set parameter to execute Command.
public object? CommandParameter { get; set; }
Property Value
IsEnabledCore
Allows a derived class to override the enabled state of the control.
protected override bool IsEnabledCore { get; }
Property Value
Remarks
Derived controls may wish to disable the enabled state of the control without overwriting the user-supplied Avalonia.Input.InputElement.IsEnabled setting. This can be done by overriding this property to return the overridden enabled state. If the value returned from Avalonia.Input.InputElement.IsEnabledCore should change, then the derived control should call Avalonia.Input.InputElement.UpdateIsEffectivelyEnabled().
StyleKeyOverride
Gets the type by which the element is styled.
protected override Type StyleKeyOverride { get; }
Property Value
Remarks
Usually controls are styled by their own type, but there are instances where you want an element to be styled by its base type, e.g. creating SpecialButton that derives from Button and adds extra functionality but is still styled as a regular Button. Override this property to change the style for a control class, returning the type that you wish the elements to be styled as.
Uri
Get or set URI to open.
public Uri? Uri { get; set; }
Property Value
Methods
OnKeyDown(KeyEventArgs)
Called before the Avalonia.Input.InputElement.KeyDown event occurs.
protected override void OnKeyDown(KeyEventArgs e)
Parameters
eKeyEventArgsThe event args.
OnKeyUp(KeyEventArgs)
Called before the Avalonia.Input.InputElement.KeyUp event occurs.
protected override void OnKeyUp(KeyEventArgs e)
Parameters
eKeyEventArgsThe event args.
OnPointerReleased(PointerReleasedEventArgs)
Called when pointer released.
protected override void OnPointerReleased(PointerReleasedEventArgs e)
Parameters
ePointerReleasedEventArgsEvent data.
OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
Called when property changed.
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
Parameters
changeAvaloniaPropertyChangedEventArgsChange data.