Class ButtonState
Describes the properties of a StateButton for a given state.
Implements
Inherited Members
Namespace: Forms9Patch
Assembly: Forms9Patch.dll
Syntax
[ContentProperty("HtmlText")]
public class ButtonState : BindableObject, INotifyPropertyChanged, IDynamicResourceHandler, IButtonState, IBackground, IShape, ILabel, ILabelStyle, IFontElement, IElement
Constructors
ButtonState()
Initializes a new instance of the ButtonState class.
Declaration
public ButtonState()
ButtonState(ButtonState)
Initializes a new instance of the ButtonState class to the same properties of Source instance.
Declaration
public ButtonState(ButtonState source)
Parameters
Type | Name | Description |
---|---|---|
ButtonState | source | Source instance. |
Fields
AutoFitProperty
The fit property.
Declaration
public static readonly BindableProperty AutoFitProperty
Field Value
Type | Description |
---|---|
BindableProperty |
BackgroundColorProperty
Backing store for the BackgroundColor bindable property.
Declaration
public static readonly BindableProperty BackgroundColorProperty
Field Value
Type | Description |
---|---|
BindableProperty |
BackgroundImageProperty
Backing store for the BackgroundImage bindable property.
Declaration
public static BindableProperty BackgroundImageProperty
Field Value
Type | Description |
---|---|
BindableProperty |
BorderColorProperty
The border color property.
Declaration
public static readonly BindableProperty BorderColorProperty
Field Value
Type | Description |
---|---|
BindableProperty |
BorderRadiusProperty
The border radius property.
Declaration
public static readonly BindableProperty BorderRadiusProperty
Field Value
Type | Description |
---|---|
BindableProperty |
BorderWidthProperty
The border width property.
Declaration
public static readonly BindableProperty BorderWidthProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ElementShapeProperty
Backing store for the ElementShape property
Declaration
public static readonly BindableProperty ElementShapeProperty
Field Value
Type | Description |
---|---|
BindableProperty |
FontAttributesProperty
Backing store for the FontAttributes bindable property.
Declaration
public static readonly BindableProperty FontAttributesProperty
Field Value
Type | Description |
---|---|
BindableProperty |
FontColorProperty
OBSOLETE: Use TextColorProperty
Declaration
[Obsolete("Use TextColorProperty")]
public static readonly BindableProperty FontColorProperty
Field Value
Type | Description |
---|---|
BindableProperty |
FontFamilyProperty
Backing store for the FontFamiily bindable property.
Declaration
public static readonly BindableProperty FontFamilyProperty
Field Value
Type | Description |
---|---|
BindableProperty |
FontSizeProperty
Backing store for the FontSize bindable property.
Declaration
public static readonly BindableProperty FontSizeProperty
Field Value
Type | Description |
---|---|
BindableProperty |
HasShadowProperty
Backing store for the HasShadow property
Declaration
public static readonly BindableProperty HasShadowProperty
Field Value
Type | Description |
---|---|
BindableProperty |
HasTightSpacingProperty
The has tight spacing property.
Declaration
public static readonly BindableProperty HasTightSpacingProperty
Field Value
Type | Description |
---|---|
BindableProperty |
HorizontalTextAlignmentProperty
Backing store for the Button.Alignment bindable property
Declaration
public static BindableProperty HorizontalTextAlignmentProperty
Field Value
Type | Description |
---|---|
BindableProperty |
HtmlTextProperty
The formatted text property backing store.
Declaration
public static readonly BindableProperty HtmlTextProperty
Field Value
Type | Description |
---|---|
BindableProperty |
IconColorProperty
Backing store for ButtonState IconColor property
Declaration
public static readonly BindableProperty IconColorProperty
Field Value
Type | Description |
---|---|
BindableProperty |
IconFontFamilyProperty
backing store for the IconFontFamily property
Declaration
public static readonly BindableProperty IconFontFamilyProperty
Field Value
Type | Description |
---|---|
BindableProperty |
IconFontSizeProperty
Backing store for ButtonState IconFontSize property
Declaration
public static readonly BindableProperty IconFontSizeProperty
Field Value
Type | Description |
---|---|
BindableProperty |
IconImageProperty
Backing store for the Image bindable property.
Declaration
public static BindableProperty IconImageProperty
Field Value
Type | Description |
---|---|
BindableProperty |
IconTextProperty
Backing store for IconText property
Declaration
public static readonly BindableProperty IconTextProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ImageProperty
OBSOLETE: Use IconImageProperty
Declaration
[Obsolete("Use IconImageProperty")]
public static BindableProperty ImageProperty
Field Value
Type | Description |
---|---|
BindableProperty |
LineBreakModeProperty
The line break mode property.
Declaration
public static readonly BindableProperty LineBreakModeProperty
Field Value
Type | Description |
---|---|
BindableProperty |
LinesProperty
The lines property.
Declaration
public static readonly BindableProperty LinesProperty
Field Value
Type | Description |
---|---|
BindableProperty |
MinFontSizeProperty
The backing store for the minimum font size property.
Declaration
public static readonly BindableProperty MinFontSizeProperty
Field Value
Type | Description |
---|---|
BindableProperty |
OrientationProperty
Backing store for the Button's orientation property.
Declaration
public static BindableProperty OrientationProperty
Field Value
Type | Description |
---|---|
BindableProperty |
OutlineColorProperty
Backging store for the OutlineColor property
Declaration
public static readonly BindableProperty OutlineColorProperty
Field Value
Type | Description |
---|---|
BindableProperty |
OutlineRadiusProperty
Backing store for the OutlineRadius bindable property.
Declaration
public static readonly BindableProperty OutlineRadiusProperty
Field Value
Type | Description |
---|---|
BindableProperty |
OutlineWidthProperty
Backing store for the OutlineWidth bindable property.
Declaration
public static readonly BindableProperty OutlineWidthProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ShadowInvertedProperty
Backing store for the ShadowInverted bindable property.
Declaration
public static readonly BindableProperty ShadowInvertedProperty
Field Value
Type | Description |
---|---|
BindableProperty |
SpacingProperty
Backing store for the spacing property.
Declaration
public static readonly BindableProperty SpacingProperty
Field Value
Type | Description |
---|---|
BindableProperty |
TextColorProperty
Backing store for the FontColor bindable property.
Declaration
public static readonly BindableProperty TextColorProperty
Field Value
Type | Description |
---|---|
BindableProperty |
TextProperty
Backing store for the Text bindable property.
Declaration
public static readonly BindableProperty TextProperty
Field Value
Type | Description |
---|---|
BindableProperty |
TintIconProperty
Backing store for the TintIcon property
Declaration
public static readonly BindableProperty TintIconProperty
Field Value
Type | Description |
---|---|
BindableProperty |
TrailingIconProperty
Backing store for the TrailiingImage property
Declaration
public static readonly BindableProperty TrailingIconProperty
Field Value
Type | Description |
---|---|
BindableProperty |
VerticalTextAlignmentProperty
Backing store for the vertical alignment property.
Declaration
public static readonly BindableProperty VerticalTextAlignmentProperty
Field Value
Type | Description |
---|---|
BindableProperty |
Properties
AutoFit
Gets or sets the fit.
Declaration
public AutoFit AutoFit { get; set; }
Property Value
Type | Description |
---|---|
AutoFit | The fit. |
BackgroundColor
Gets or sets the color of the background.
Declaration
public Color BackgroundColor { get; set; }
Property Value
Type | Description |
---|---|
Color | The color of the background. |
BackgroundImage
Gets or sets the background image.
Declaration
public Image BackgroundImage { get; set; }
Property Value
Type | Description |
---|---|
Image | The background image. |
BorderColor
Gets or sets the color of the border.
Declaration
public Color BorderColor { get; set; }
Property Value
Type | Description |
---|---|
Color | The color of the border. |
BorderRadius
Gets or sets the border radius.
Declaration
public float BorderRadius { get; set; }
Property Value
Type | Description |
---|---|
Single | The border radius. |
BorderWidth
Gets or sets the width of the border.
Declaration
public float BorderWidth { get; set; }
Property Value
Type | Description |
---|---|
Single | The width of the border. |
ElementShape
controls the shape of a
Declaration
public ElementShape ElementShape { get; set; }
Property Value
Type | Description |
---|---|
ElementShape |
FontAttributes
Gets or sets the font attributes.
Declaration
public FontAttributes FontAttributes { get; set; }
Property Value
Type | Description |
---|---|
FontAttributes | The font attributes. |
FontColor
OBSOLETE: Use TextColor
Declaration
[Obsolete("Use TextColor")]
public Color FontColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
FontFamily
Gets or sets the font family.
Declaration
public string FontFamily { get; set; }
Property Value
Type | Description |
---|---|
String | The font family. |
FontSize
Gets or sets the size of the font.
Declaration
public double FontSize { get; set; }
Property Value
Type | Description |
---|---|
Double | The size of the font. |
HasShadow
Gets and sets if the button casts a shadow
Declaration
public bool HasShadow { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
HasTightSpacing
Gets or sets if the Icon/Image is close (TightSpacing) to text or at edge (not TightSpacing) of button.
Declaration
public bool HasTightSpacing { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
HorizontalTextAlignment
Gets or sets the alignment of the image and text.
Declaration
public TextAlignment HorizontalTextAlignment { get; set; }
Property Value
Type | Description |
---|---|
TextAlignment | The alignment (left, center, right). |
HtmlText
Gets or sets the formatted text.
Declaration
public string HtmlText { get; set; }
Property Value
Type | Description |
---|---|
String | The formatted text. |
IconColor
Overrides this icon color as provided by the Button's TextColor (if TintIcon=true), the default TextColor (if IconText != null), or the IconImage colors
Declaration
public Color IconColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
IconFontFamily
The font used to render the IconText
Declaration
public string IconFontFamily { get; set; }
Property Value
Type | Description |
---|---|
String |
IconFontSize
controls value of .IconFontSize property
Declaration
public double IconFontSize { get; set; }
Property Value
Type | Description |
---|---|
Double |
IconImage
Gets or sets the companion image.
Declaration
public Image IconImage { get; set; }
Property Value
Type | Description |
---|---|
Image | The image. |
IconText
Gets/Sets the IconText (Alternative to IconImage).
Declaration
public string IconText { get; set; }
Property Value
Type | Description |
---|---|
String |
Image
OBSOLETE: Use IconImage
Declaration
[Obsolete("Use IconImage")]
public Image Image { get; set; }
Property Value
Type | Description |
---|---|
Image |
InstanceId
returns instance index (starts at 0)
Declaration
public int InstanceId { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
LineBreakMode
Gets or sets the line break mode.
Declaration
public LineBreakMode LineBreakMode { get; set; }
Property Value
Type | Description |
---|---|
LineBreakMode | The line break mode. |
Lines
Gets or sets the lines.
Declaration
public int Lines { get; set; }
Property Value
Type | Description |
---|---|
Int32 | The lines. |
MinFontSize
Gets or sets the minimum size of the font allowed during an autofit.
Declaration
public double MinFontSize { get; set; }
Property Value
Type | Description |
---|---|
Double | The minimum size of the font. Default=4 |
Orientation
Gets or sets the orientation of the iamge and label.
Declaration
public StackOrientation Orientation { get; set; }
Property Value
Type | Description |
---|---|
StackOrientation | The image and label orientation. |
OutlineColor
Gets/sets the button's outline color
Declaration
public Color OutlineColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
OutlineRadius
Gets or sets the outline radius.
Declaration
public float OutlineRadius { get; set; }
Property Value
Type | Description |
---|---|
Single | The outline radius. |
OutlineWidth
Gets or sets the width of the outline.
Declaration
public float OutlineWidth { get; set; }
Property Value
Type | Description |
---|---|
Single | The width of the outline. |
ShadowInverted
Gets or sets a flag indicating if the Frame's shadow is inverted. This is a bindable property.
Declaration
public bool ShadowInverted { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
Spacing
Gets or sets the spacing.
Declaration
public double Spacing { get; set; }
Property Value
Type | Description |
---|---|
Double | The spacing. |
Text
Gets or sets the text.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
String | The text. |
TextColor
Gets or sets the color of the font.
Declaration
public Color TextColor { get; set; }
Property Value
Type | Description |
---|---|
Color | The color of the font. |
TintIcon
Gets or sets if the button's Icon will be tinted with the TextColor
Declaration
public bool TintIcon { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
TrailingIcon
Gets or sets if the IconImage / IconText will be before or after the button's text
Declaration
public bool TrailingIcon { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
VerticalTextAlignment
Gets or sets the vertical alignment.
Declaration
public TextAlignment VerticalTextAlignment { get; set; }
Property Value
Type | Description |
---|---|
TextAlignment | The vertical alignment. |
Methods
OnPropertyChanged(String)
Call this method from a child class to notify that a change happened on a property.
Declaration
protected override void OnPropertyChanged(string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property that changed. |
Overrides
Operators
Explicit(ButtonState to String)
Declaration
public static explicit operator string (ButtonState state)
Parameters
Type | Name | Description |
---|---|---|
ButtonState | state | State. |
Returns
Type | Description |
---|---|
String |
Explicit Interface Implementations
ILabel.FittedFontSize
Declaration
double ILabel.FittedFontSize { get; }
Returns
Type | Description |
---|---|
Double |
ILabel.SynchronizedFontSize
Declaration
double ILabel.SynchronizedFontSize { get; set; }
Returns
Type | Description |
---|---|
Double |