Class SkiaButton
Button-like control, can include any content inside. It's either you use default content (todo templates?..)
or can include any content inside, and properties will by applied by convention to a SkiaLabel with Tag MainLabel, SkiaShape with Tag MainFrame. At the same time you can override ApplyProperties() and apply them to your content yourself.
Convention elements tags: BtnText, BtnShape.
public class SkiaButton : SkiaLayout, 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
-
SkiaButton
- Implements
- Inherited Members
- Extension Methods
Constructors
SkiaButton()
public SkiaButton()
SkiaButton(string)
public SkiaButton(string caption)
Parameters
captionstring
Fields
ApplyEffectProperty
public static readonly BindableProperty ApplyEffectProperty
Field Value
BevelProperty
public static readonly BindableProperty BevelProperty
Field Value
BevelTypeProperty
public static readonly BindableProperty BevelTypeProperty
Field Value
ButtonStyleProperty
public static readonly BindableProperty ButtonStyleProperty
Field Value
Clicked
Occurs when the button is clicked/tapped (Tapped event).
public Action<SkiaButton, SkiaGesturesParameters> Clicked
Field Value
CommandLongPressingParameterProperty
public static readonly BindableProperty CommandLongPressingParameterProperty
Field Value
CommandLongPressingProperty
public static readonly BindableProperty CommandLongPressingProperty
Field Value
CommandTappedParameterProperty
public static readonly BindableProperty CommandTappedParameterProperty
Field Value
CommandTappedProperty
public static readonly BindableProperty CommandTappedProperty
Field Value
CornerRadiusProperty
public static readonly BindableProperty CornerRadiusProperty
Field Value
DelayCallbackMs
You might want to pause to show effect before executing command. Default is 0.
public static int DelayCallbackMs
Field Value
ElevationEnabledProperty
public static readonly BindableProperty ElevationEnabledProperty
Field Value
FontFamilyProperty
public static readonly BindableProperty FontFamilyProperty
Field Value
FontSizeProperty
public static readonly BindableProperty FontSizeProperty
Field Value
IconPositionProperty
public static readonly BindableProperty IconPositionProperty
Field Value
InitialBackground
protected Brush InitialBackground
Field Value
InitialBackgroundColor
protected Color InitialBackgroundColor
Field Value
IsDisabledProperty
public static readonly BindableProperty IsDisabledProperty
Field Value
IsPressedProperty
public static readonly BindableProperty IsPressedProperty
Field Value
LockPanningProperty
public static readonly BindableProperty LockPanningProperty
Field Value
MainFrame
public SkiaShape MainFrame
Field Value
MainLabel
public SkiaLabel MainLabel
Field Value
MainWrapper
public SkiaLayout MainWrapper
Field Value
PanThreshold
public static float PanThreshold
Field Value
Pressed
Occurs when the button is pressed (Down event).
public Action<SkiaButton, SkiaGesturesParameters> Pressed
Field Value
Released
Occurs when the button is released (Up event).
public Action<SkiaButton, SkiaGesturesParameters> Released
Field Value
ShimmerEffectAngleProperty
public static readonly BindableProperty ShimmerEffectAngleProperty
Field Value
ShimmerEffectColorProperty
public static readonly BindableProperty ShimmerEffectColorProperty
Field Value
ShimmerEffectSpeedProperty
public static readonly BindableProperty ShimmerEffectSpeedProperty
Field Value
ShimmerEffectWidthProperty
public static readonly BindableProperty ShimmerEffectWidthProperty
Field Value
StrokeColorProperty
public static readonly BindableProperty StrokeColorProperty
Field Value
StrokeWidthProperty
public static readonly BindableProperty StrokeWidthProperty
Field Value
TextCaseProperty
public static readonly BindableProperty TextCaseProperty
Field Value
TextColorProperty
public static readonly BindableProperty TextColorProperty
Field Value
TextProperty
public static readonly BindableProperty TextProperty
Field Value
TextStrokeColorProperty
public static readonly BindableProperty TextStrokeColorProperty
Field Value
_lastDownPts
protected SKPoint _lastDownPts
Field Value
Properties
ApplyEffect
public SkiaTouchAnimation ApplyEffect { get; set; }
Property Value
Bevel
public SkiaBevel Bevel { get; set; }
Property Value
BevelType
public BevelType BevelType { get; set; }
Property Value
ButtonPadding
protected Thickness ButtonPadding { get; set; }
Property Value
ButtonStyle
Gets or sets the style variant of the button (Contained, Outlined, or Text).
public SkiaButton.ButtonStyleType ButtonStyle { get; set; }
Property Value
CommandLongPressing
public ICommand CommandLongPressing { get; set; }
Property Value
CommandLongPressingParameter
public object CommandLongPressingParameter { get; set; }
Property Value
CommandTapped
public ICommand CommandTapped { get; set; }
Property Value
CommandTappedParameter
public object CommandTappedParameter { get; set; }
Property Value
CornerRadius
[TypeConverter(typeof(CornerRadiusTypeConverter))]
public CornerRadius CornerRadius { get; set; }
Property Value
ElevationEnabled
Gets or sets whether the button has elevation (shadow effect).
public bool ElevationEnabled { get; set; }
Property Value
FontFamily
public string FontFamily { get; set; }
Property Value
FontSize
public double FontSize { get; set; }
Property Value
IconPosition
Gets or sets the position of the icon relative to the button text.
public SkiaButton.IconPositionType IconPosition { get; set; }
Property Value
IsDisabled
public bool IsDisabled { get; set; }
Property Value
IsPressed
Gets whether the button is pressed, readonly.
public bool IsPressed { get; set; }
Property Value
LockPanning
public bool LockPanning { get; set; }
Property Value
ShimmerEffectAngle
public float ShimmerEffectAngle { get; set; }
Property Value
ShimmerEffectColor
public Color ShimmerEffectColor { get; set; }
Property Value
ShimmerEffectSpeed
public int ShimmerEffectSpeed { get; set; }
Property Value
ShimmerEffectWidth
public float ShimmerEffectWidth { get; set; }
Property Value
StrokeColor
public Color StrokeColor { get; set; }
Property Value
StrokeWidth
public float StrokeWidth { get; set; }
Property Value
Text
Bind to your own content!
public string Text { get; set; }
Property Value
TextCase
Gets or sets how the button text case is transformed (None, Uppercase, Lowercase).
public TextTransform TextCase { get; set; }
Property Value
TextColor
public Color TextColor { get; set; }
Property Value
TextStrokeColor
public Color TextStrokeColor { get; set; }
Property Value
TotalDown
public long TotalDown { get; set; }
Property Value
TotalTapped
public long TotalTapped { get; set; }
Property Value
Methods
ApplyProperties()
public virtual void ApplyProperties()
CreateClip(object, bool, SKPath)
Clip effects with rounded rect of the frame inside
public override SKPath CreateClip(object arguments, bool usePosition, SKPath path = null)
Parameters
Returns
CreateCupertinoStyleContent()
protected virtual void CreateCupertinoStyleContent()
CreateDefaultContent()
protected override void CreateDefaultContent()
CreateDefaultStyleContent()
protected virtual void CreateDefaultStyleContent()
CreateElevation()
protected virtual SkiaButton.ButtonElevationShadowEffect CreateElevation()
Returns
CreateMaterialStyleContent()
protected virtual void CreateMaterialStyleContent()
CreateWindowsStyleContent()
protected virtual void CreateWindowsStyleContent()
FindViews()
public virtual void FindViews()
IsInsideTapRegion(SkiaGesturesParameters)
protected virtual bool IsInsideTapRegion(SkiaGesturesParameters parameters)
Parameters
parametersSkiaGesturesParameters
Returns
OnButtonPropertyChanged(SkiaButton, string)
protected virtual void OnButtonPropertyChanged(SkiaButton control, string propertyName)
Parameters
controlSkiaButtonpropertyNamestring
OnChildrenChanged()
Happens when child was added or removed, will call Invalidate() in base
public override void OnChildrenChanged()
OnDisposing()
Base performs some cleanup actions with Superview
public override void OnDisposing()
OnDown(SkiaGesturesParameters, GestureEventProcessingInfo)
public virtual bool OnDown(SkiaGesturesParameters args, GestureEventProcessingInfo apply)
Parameters
argsSkiaGesturesParametersapplyGestureEventProcessingInfo
Returns
OnPaddingSet(Thickness)
Can override this for custom controls to apply padding differently from the default way
public override Thickness OnPaddingSet(Thickness padding)
Parameters
paddingThickness
Returns
OnPropertyChanged(string)
Method that is called when a bound property is changed.
protected override void OnPropertyChanged(string propertyName = null)
Parameters
propertyNamestringThe name of the bound property that changed.
OnTapped(SkiaGesturesParameters, SKPoint)
public virtual bool OnTapped(SkiaGesturesParameters args, SKPoint childOffset)
Parameters
argsSkiaGesturesParameterschildOffsetSKPoint
Returns
OnUp(SkiaGesturesParameters, GestureEventProcessingInfo)
public virtual void OnUp(SkiaGesturesParameters args, GestureEventProcessingInfo apply)
Parameters
argsSkiaGesturesParametersapplyGestureEventProcessingInfo
ProcessGestures(SkiaGesturesParameters, GestureEventProcessingInfo)
public override ISkiaGestureListener ProcessGestures(SkiaGesturesParameters args, GestureEventProcessingInfo apply)
Parameters
argsSkiaGesturesParametersapplyGestureEventProcessingInfo
Returns
SetupBackgroundPaint(SKPaint, SKRect)
Will never paint background, it's up to the button shape to do it.
protected override bool SetupBackgroundPaint(SKPaint paint, SKRect destination)
Parameters
Returns
Events
Down
public event EventHandler<SkiaGesturesParameters> Down
Event Type
Up
public event EventHandler<SkiaGesturesParameters> Up