Class Segment
Model for Segment.
Inherited Members
Namespace: Forms9Patch
Assembly: Forms9Patch.dll
Syntax
[ContentProperty("HtmlText")]
public class Segment : Element, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IStyleSelectable, ISegment, IMenuItem, IDisposable
Constructors
Segment()
Initializes a new instance of the Segment class.
Declaration
public Segment()
Segment(String, Image)
Instantiates an new Segment and sets its Text and imageSource properties
Declaration
public Segment(string text, Image image)
Parameters
Type | Name | Description |
---|---|---|
String | text | |
Image | image |
Segment(String, String, Assembly)
Instantiates a new Segment and sets its Text and either its IconText or its IconImage, created using the provided embedded resource id
Declaration
public Segment(string text, string icon, Assembly assembly = null)
Parameters
Type | Name | Description |
---|---|---|
String | text | Segment's text |
String | icon | Segments's icon (either EmbeddedResourceId or HtmlText) |
Assembly | assembly | Assembly that has EmbeddedResource used for Icon |
Segment(String, ImageSource)
Instantiates an new Segment and sets its Text property and sets the IconImage to a new image, created using the provided ImageSource
Declaration
public Segment(string text, ImageSource imageSource = null)
Parameters
Type | Name | Description |
---|---|---|
String | text | |
ImageSource | imageSource |
Fields
CommandParameterProperty
Backing store for the Segment.CommandParameter bindable property.
Declaration
public static readonly BindableProperty CommandParameterProperty
Field Value
Type | Description |
---|---|
BindableProperty |
CommandProperty
Backing store for the Segment.Command bindable property.
Declaration
public static readonly BindableProperty CommandProperty
Field Value
Type | Description |
---|---|
BindableProperty |
FontAttributesProperty
Backing store for the Segment.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 |
HtmlTextProperty
Backing store for the formatted text property.
Declaration
public static readonly BindableProperty HtmlTextProperty
Field Value
Type | Description |
---|---|
BindableProperty |
IconFontFamilyProperty
Backing store for Segment IconFontFamily property
Declaration
public static readonly BindableProperty IconFontFamilyProperty
Field Value
Type | Description |
---|---|
BindableProperty |
IconFontSizeProperty
Backing store for Segment IconFontSize property
Declaration
public static readonly BindableProperty IconFontSizeProperty
Field Value
Type | Description |
---|---|
BindableProperty |
IconImageProperty
Bindable Property for the IconImage property
Declaration
public static BindableProperty IconImageProperty
Field Value
Type | Description |
---|---|
BindableProperty |
IconTextProperty
The icon text property backing store.
Declaration
public static readonly BindableProperty IconTextProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ImageSourceProperty
Backing store for the Image bindable property.
Declaration
[Obsolete("Use IconImageProperty instead")]
public static BindableProperty ImageSourceProperty
Field Value
Type | Description |
---|---|
BindableProperty |
IsEnabledProperty
The backing store for the is enabled property.
Declaration
public static readonly BindableProperty IsEnabledProperty
Field Value
Type | Description |
---|---|
BindableProperty |
IsSelectedProperty
The backing store for the is selected property.
Declaration
public static readonly BindableProperty IsSelectedProperty
Field Value
Type | Description |
---|---|
BindableProperty |
OrientationProperty
The backing store for the orientation property.
Declaration
public static readonly BindableProperty OrientationProperty
Field Value
Type | Description |
---|---|
BindableProperty |
TextColorProperty
Backing store for the Segment.TextColor 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 |
Properties
Command
Gets or sets the command to invoke when the segment is selected.
Declaration
public ICommand Command { get; set; }
Property Value
Type | Description |
---|---|
ICommand | A command to invoke when the segment is selected. The default value is null. |
Remarks
This property is used to associate a command with an instance of a segment. This property is most often set in the MVVM pattern to bind callbacks back into the ViewModel. IsEnabled is controlled by the Command if set.
CommandParameter
Gets or sets the parameter to pass to the Command property.
Declaration
public object CommandParameter { get; set; }
Property Value
Type | Description |
---|---|
Object | A object to pass to the command property. The default value is null. |
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 | The color of the font. |
HtmlText
Gets or sets the formatted text.
Declaration
public string HtmlText { get; set; }
Property Value
Type | Description |
---|---|
String | The formatted text. |
IconFontFamily
controls value of .IconFontFamily property
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 icon image for this Segment. Alternative to IconText prop
Declaration
public Image IconImage { get; set; }
Property Value
Type | Description |
---|---|
Image |
IconText
Gets or sets the icon text - alternative to ImageSource.
Declaration
public string IconText { get; set; }
Property Value
Type | Description |
---|---|
String | The icon text. |
ImageSource
Gets or sets the companion image for this this Segment - alternative to IconText.
Declaration
[Obsolete("Use IconImage instead")]
public ImageSource ImageSource { get; set; }
Property Value
Type | Description |
---|---|
ImageSource | The image. |
IsEnabled
Gets or sets a value indicating whether this Segment is enabled.
Declaration
public bool IsEnabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
IsSelected
Declaration
public bool IsSelected { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
Orientation
Gets or sets the image/lable orientation.
Declaration
public StackOrientation Orientation { get; set; }
Property Value
Type | Description |
---|---|
StackOrientation | The iamge/label orientation. |
Text
Gets or sets the text for this Segment.
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. |
VisualElement
Gets the visual element used to render the Segment (to support Bubble Popup).
Declaration
public VisualElement VisualElement { get; }
Property Value
Type | Description |
---|---|
VisualElement | The visual element. |
Methods
Dispose()
Dispose
Declaration
public void Dispose()
Dispose(Boolean)
Dispose
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing |
OnPropertyChanged(String)
Ons the property changed.
Declaration
protected override void OnPropertyChanged(string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | Property name. |
Overrides
SendClicked()
Programmically click the segement
Declaration
public void SendClicked()
Tap()
Tap this instance.
Declaration
public void Tap()
Events
LongPressed
Occurs when long pressed.
Declaration
public event EventHandler LongPressed
Event Type
Type | Description |
---|---|
EventHandler |
LongPressing
Occurs when long pressing.
Declaration
public event EventHandler LongPressing
Event Type
Type | Description |
---|---|
EventHandler |
Selected
Occurs when Segment is selected.
Declaration
public event EventHandler Selected
Event Type
Type | Description |
---|---|
EventHandler |
Tapped
Occurs when Segment is tapped.
Declaration
public event EventHandler Tapped
Event Type
Type | Description |
---|---|
EventHandler |