Class SkiaEditor
public class SkiaEditor : SkiaShape, INotifyPropertyChanged, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IVisualElementController, IElementController, IView, ITransform, IElement, IVisualTreeElement, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, IHasAfterEffects, ISkiaDisposable, ISkiaGridLayout, ISkiaLayout, ISkiaControl, IDrawnBase, ICanBeUpdatedWithContext, ICanBeUpdated, ILayoutInsideViewport, IInsideViewport, IVisibilityAware, IDisposable, ISkiaGestureListener
- Inheritance
-
SkiaEditor
- Implements
- Inherited Members
- Extension Methods
Constructors
SkiaEditor()
public SkiaEditor()
Fields
ActionDone
public static string ActionDone
Field Value
ActionGo
public static string ActionGo
Field Value
ActionNext
public static string ActionNext
Field Value
ActionSearch
public static string ActionSearch
Field Value
ActionSend
public static string ActionSend
Field Value
CanShowCursorProperty
public static readonly BindableProperty CanShowCursorProperty
Field Value
CommandOnFocusChangedProperty
public static readonly BindableProperty CommandOnFocusChangedProperty
Field Value
CommandOnSubmitProperty
public static readonly BindableProperty CommandOnSubmitProperty
Field Value
CommandOnTextChangedProperty
public static readonly BindableProperty CommandOnTextChangedProperty
Field Value
CursorColorProperty
public static readonly BindableProperty CursorColorProperty
Field Value
CursorGradientProperty
public static readonly BindableProperty CursorGradientProperty
Field Value
CursorPositionProperty
public static readonly BindableProperty CursorPositionProperty
Field Value
FontFamilyProperty
public static readonly BindableProperty FontFamilyProperty
Field Value
FontSizeProperty
public static readonly BindableProperty FontSizeProperty
Field Value
FontWeightProperty
public static readonly BindableProperty FontWeightProperty
Field Value
HorizontalTextAlignmentProperty
public static readonly BindableProperty HorizontalTextAlignmentProperty
Field Value
IsFocusedProperty
public static readonly BindableProperty IsFocusedProperty
Field Value
IsPasswordProperty
public static readonly BindableProperty IsPasswordProperty
Field Value
KeyboardTypeProperty
public static readonly BindableProperty KeyboardTypeProperty
Field Value
LineHeightProperty
public static readonly BindableProperty LineHeightProperty
Field Value
MaxLinesProperty
public static readonly BindableProperty MaxLinesProperty
Field Value
ParagraphBreakChar
protected const char ParagraphBreakChar = '\n'
Field Value
PlaceholderColorProperty
public static readonly BindableProperty PlaceholderColorProperty
Field Value
PlaceholderHorizontalAlignmentProperty
public static readonly BindableProperty PlaceholderHorizontalAlignmentProperty
Field Value
PlaceholderTextProperty
public static readonly BindableProperty PlaceholderTextProperty
Field Value
ReturnTypeProperty
public static readonly BindableProperty ReturnTypeProperty
Field Value
SelectionColorProperty
public static readonly BindableProperty SelectionColorProperty
Field Value
SelectionLengthProperty
public static readonly BindableProperty SelectionLengthProperty
Field Value
SoftLineBreakChar
protected const char SoftLineBreakChar = '\u2028'
Field Value
TextColorProperty
public static readonly BindableProperty TextColorProperty
Field Value
TextGradientProperty
public static readonly BindableProperty TextGradientProperty
Field Value
TextProperty
public static readonly BindableProperty TextProperty
Field Value
TimerUpdateParentCursorPosition
protected RestartingTimer<int> TimerUpdateParentCursorPosition
Field Value
UseMarkdownProperty
public static readonly BindableProperty UseMarkdownProperty
Field Value
VerticalTextAlignmentProperty
public static readonly BindableProperty VerticalTextAlignmentProperty
Field Value
_contentLayer
protected SkiaLayout _contentLayer
Field Value
_placeholderLabel
protected SkiaLabel _placeholderLabel
Field Value
_scroll
protected SkiaScroll _scroll
Field Value
_selectionControl
protected SkiaEditorSelection _selectionControl
Field Value
_suppressImmediateCursorMove
Sets native control cursor position to CursorPosition (and selection end if active) and calls UpdateCursorVisibility.
protected bool _suppressImmediateCursorMove
Field Value
Properties
CanShowCursor
public bool CanShowCursor { get; set; }
Property Value
CommandOnFocusChanged
public ICommand CommandOnFocusChanged { get; set; }
Property Value
CommandOnSubmit
public ICommand CommandOnSubmit { get; set; }
Property Value
CommandOnTextChanged
public ICommand CommandOnTextChanged { get; set; }
Property Value
Cursor
public SkiaCursor Cursor { get; protected set; }
Property Value
CursorColor
public Color CursorColor { get; set; }
Property Value
CursorGradient
public SkiaGradient CursorGradient { get; set; }
Property Value
CursorPosition
public int CursorPosition { get; set; }
Property Value
FontFamily
public string FontFamily { get; set; }
Property Value
FontSize
public double FontSize { get; set; }
Property Value
FontWeight
public int FontWeight { get; set; }
Property Value
HorizontalTextAlignment
public DrawTextAlignment HorizontalTextAlignment { get; set; }
Property Value
IsFocused
public bool IsFocused { get; set; }
Property Value
IsMultiline
public bool IsMultiline { get; }
Property Value
IsPassword
public bool IsPassword { get; set; }
Property Value
KeyboardType
public SkiaEditor.SkiaEditorKeyboard KeyboardType { get; set; }
Property Value
Label
public SkiaLabel Label { get; protected set; }
Property Value
LineHeight
public double LineHeight { get; set; }
Property Value
MaxLines
public int MaxLines { get; set; }
Property Value
PlaceholderColor
public Color PlaceholderColor { get; set; }
Property Value
PlaceholderHorizontalAlignment
public DrawTextAlignment PlaceholderHorizontalAlignment { get; set; }
Property Value
PlaceholderText
public string PlaceholderText { get; set; }
Property Value
ReturnType
public ReturnType ReturnType { get; set; }
Property Value
SelectionColor
public Color SelectionColor { get; set; }
Property Value
SelectionLength
public int SelectionLength { get; set; }
Property Value
Text
public string Text { get; set; }
Property Value
TextColor
public Color TextColor { get; set; }
Property Value
TextGradient
public SkiaGradient TextGradient { get; set; }
Property Value
UseMarkdown
public bool UseMarkdown { get; set; }
Property Value
VerticalTextAlignment
public TextAlignment VerticalTextAlignment { get; set; }
Property Value
WillClipBounds
Used to check whether to apply IsClippedToBounds property
public override bool WillClipBounds { get; }
Property Value
Methods
ApplyKeyboardType()
public void ApplyKeyboardType()
CopySelection()
public void CopySelection()
CreateControl()
public virtual void CreateControl()
CreateCursor()
protected virtual SkiaCursor CreateCursor()
Returns
CreateLabel()
public virtual SkiaLabel CreateLabel()
Returns
CreatePlaceholderLabel()
protected virtual SkiaLabel CreatePlaceholderLabel()
Returns
CutSelection()
public void CutSelection()
DeleteSelection()
public void DeleteSelection()
DisposePlatform()
public void DisposePlatform()
ExecuteSubmit(bool)
protected void ExecuteSubmit(bool clearFocus)
Parameters
clearFocusbool
GetContentSizeForAutosizeInPixels()
Override this if you need to adjust the measured ContentSize for the parent to adapt to it. For example SkiaShape overrides this to expand by adding the needed size for stroke.
protected override SKSize GetContentSizeForAutosizeInPixels()
Returns
GetCursorLine()
Returns the zero-based line index the cursor is currently on.
public int GetCursorLine()
Returns
GetCursorPosition(float, float)
Input in pixels
protected int GetCursorPosition(float x, float y)
Parameters
Returns
GetEditorBreakText(bool)
protected static string GetEditorBreakText(bool splitLine)
Parameters
splitLinebool
Returns
GetLineGlyphs(TextLine)
Returns all glyphs for a rendered line, flattened across spans. Override in subclasses to support multi-span lines.
protected virtual LineGlyph[] GetLineGlyphs(TextLine line)
Parameters
lineTextLine
Returns
GetSelectedText()
public string GetSelectedText()
Returns
GetWordBoundaries(int)
protected (int start, int end) GetWordBoundaries(int charIndex)
Parameters
charIndexint
Returns
HandleVerticalArrow(bool)
protected virtual void HandleVerticalArrow(bool up)
Parameters
upbool
InsertAtCursor(string)
public void InsertAtCursor(string value)
Parameters
valuestring
IsEditorBreak(char)
protected static bool IsEditorBreak(char value)
Parameters
valuechar
Returns
IsTrailingEditorBreak(string)
protected static bool IsTrailingEditorBreak(string value)
Parameters
valuestring
Returns
MoveCursorTo(double, double)
Translate cursor from the left top corner, params in pts.
protected virtual void MoveCursorTo(double x, double y)
Parameters
MoveInternalCursor()
protected void MoveInternalCursor()
NormalizeEditorLineBreaks(string?)
protected static string NormalizeEditorLineBreaks(string? value)
Parameters
valuestring
Returns
OnControlCreated()
protected virtual void OnControlCreated()
OnCreatingLabel(SkiaLabel)
protected virtual SkiaLabel OnCreatingLabel(SkiaLabel label)
Parameters
labelSkiaLabel
Returns
OnDisposing()
Base performs some cleanup actions with Superview
public override void OnDisposing()
OnFocusChanged(bool)
This will be called only for views registered at Superview.FocusedChild. The view must return true of false to indicate if it accepts focus.
public override bool OnFocusChanged(bool focus)
Parameters
focusbool
Returns
OnLayoutChanged()
DrawingRect size changed
protected override void OnLayoutChanged()
OnMeasuring(float, float, float)
If you call this while measurement is in process (IsMeasuring==True) will return last measured value.
public override ScaledSize OnMeasuring(float widthConstraint, float heightConstraint, float scale)
Parameters
Returns
OnWillDisposeWithChildren()
The OnDisposing might come with a delay to avoid disposing resources at use. This method will be called without delay when Dispose() is invoked. Disposed will set to True and for Views their OnWillDisposeWithChildren will be called.
public override void OnWillDisposeWithChildren()
Paint(DrawingContext)
This is the main drawing routine you should override to draw something. Base one paints background color inside DrawingRect that was defined by Arrange inside base.Draw. Pass arguments if you want to use some time-frozen data for painting at any time from any thread..
protected override void Paint(DrawingContext ctx)
Parameters
ctxDrawingContext
PasteFromClipboard()
public void PasteFromClipboard()
ProcessGestures(SkiaGesturesParameters, GestureEventProcessingInfo)
public override ISkiaGestureListener ProcessGestures(SkiaGesturesParameters args, GestureEventProcessingInfo apply)
Parameters
argsSkiaGesturesParametersapplyGestureEventProcessingInfo
Returns
ReplaceEditorBreaksWithSpaces(string)
protected static string ReplaceEditorBreaksWithSpaces(string value)
Parameters
valuestring
Returns
SelectAll()
public void SelectAll()
SelectWord(int)
public virtual void SelectWord(int charIndex)
Parameters
charIndexint
SetCursorPositionNative(int, int)
public void SetCursorPositionNative(int position, int stop = -1)
Parameters
SetCursorPositionWithDelay(int, int)
We have to sync with a delay after text was changed otherwise the cursor position is not updated yet. Using restarting timer, every time this is called the timer is reset if callback wasn't executed yet.
protected void SetCursorPositionWithDelay(int ms, int position)
Parameters
SetCursorVisible(bool)
protected void SetCursorVisible(bool show)
Parameters
showbool
SetFocus(bool)
public void SetFocus(bool focus)
Parameters
focusbool
SetFocusInternal(bool)
protected void SetFocusInternal(bool value)
Parameters
valuebool
SetFocusNative(bool)
public void SetFocusNative(bool focus)
Parameters
focusbool
SetSelection(int, int)
public virtual void SetSelection(int start, int end)
Parameters
Submit()
This is Done or Enter key, so maybe just split lines in specific case
public void Submit()
UpdateCursorVisibility()
Positions cursor control where it should be using translation, and sets its visibility.
public virtual void UpdateCursorVisibility()
UpdateLabel()
public virtual void UpdateLabel()
UpdateNativePosition()
public void UpdateNativePosition()
UpdatePlaceholder()
protected virtual void UpdatePlaceholder()
Events
FocusChanged
public event EventHandler<bool> FocusChanged
Event Type
TextChanged
public event EventHandler<string> TextChanged
Event Type
TextSubmitted
public event EventHandler<string> TextSubmitted