Class Control
Represents the base class for UI elements that use a ControlTemplate to define
their appearance.
Inheritance
System.Object
Control
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: OpenSilver.dll
Syntax
public class Control : FrameworkElement
Constructors
|
Improve this Doc
View Source
Control()
Represents the base class for UI elements that use a ControlTemplate
to define their appearance.
Declaration
Fields
|
Improve this Doc
View Source
BackgroundProperty
Declaration
public static readonly DependencyProperty BackgroundProperty
Field Value
|
Improve this Doc
View Source
BorderBrushProperty
Declaration
public static readonly DependencyProperty BorderBrushProperty
Field Value
|
Improve this Doc
View Source
BorderThicknessProperty
Declaration
public static readonly DependencyProperty BorderThicknessProperty
Field Value
|
Improve this Doc
View Source
CharacterSpacingProperty
Declaration
[NotImplemented]
public static readonly DependencyProperty CharacterSpacingProperty
Field Value
|
Improve this Doc
View Source
DisableBaseControlHandlingOfVisualStates
Derived classes can set this flag to True in their constructor in order to disable the "GoToState" calls of this class related to PointerOver/Pressed/Disabled, and handle them by themselves. An example is the ToggleButton control, which contains states such as "CheckedPressed", "CheckedPointerOver", etc.
Declaration
protected bool DisableBaseControlHandlingOfVisualStates
Field Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
FontFamilyProperty
Declaration
public static readonly DependencyProperty FontFamilyProperty
Field Value
|
Improve this Doc
View Source
FontSizeProperty
Identifies the FontSize dependency property.
Declaration
public static readonly DependencyProperty FontSizeProperty
Field Value
|
Improve this Doc
View Source
FontStretchProperty
Declaration
[NotImplemented]
public static readonly DependencyProperty FontStretchProperty
Field Value
|
Improve this Doc
View Source
FontStyleProperty
Identifies the FontStyle dependency property.
Declaration
public static readonly DependencyProperty FontStyleProperty
Field Value
|
Improve this Doc
View Source
FontWeightProperty
Declaration
public static readonly DependencyProperty FontWeightProperty
Field Value
|
Improve this Doc
View Source
ForegroundProperty
Declaration
public static readonly DependencyProperty ForegroundProperty
Field Value
|
Improve this Doc
View Source
HorizontalContentAlignmentProperty
Declaration
public static readonly DependencyProperty HorizontalContentAlignmentProperty
Field Value
|
Improve this Doc
View Source
IsTabStopProperty
Identifies the IsTabStop dependency property.
Declaration
public static readonly DependencyProperty IsTabStopProperty
Field Value
|
Improve this Doc
View Source
PaddingProperty
Identifies the Padding dependency property.
Declaration
public static readonly DependencyProperty PaddingProperty
Field Value
|
Improve this Doc
View Source
TabIndexProperty
Identifies the TabIndex dependency property.
Declaration
public static readonly DependencyProperty TabIndexProperty
Field Value
|
Improve this Doc
View Source
TabNavigationProperty
Declaration
[NotImplemented]
public static readonly DependencyProperty TabNavigationProperty
Field Value
|
Improve this Doc
View Source
TemplateProperty
Identifies the Template dependency property.
Declaration
public static readonly DependencyProperty TemplateProperty
Field Value
|
Improve this Doc
View Source
TextDecorationsProperty
Declaration
public static readonly DependencyProperty TextDecorationsProperty
Field Value
|
Improve this Doc
View Source
VerticalContentAlignmentProperty
Declaration
public static readonly DependencyProperty VerticalContentAlignmentProperty
Field Value
Properties
|
Improve this Doc
View Source
Background
Gets or sets a brush that provides the background of the control.
Declaration
public Brush Background { get; set; }
Property Value
|
Improve this Doc
View Source
BorderBrush
Gets or sets a brush that describes the border background of a control.
Declaration
public Brush BorderBrush { get; set; }
Property Value
|
Improve this Doc
View Source
BorderThickness
Gets or sets the thickness of the border.
Declaration
public Thickness BorderThickness { get; set; }
Property Value
|
Improve this Doc
View Source
CharacterSpacing
Declaration
[NotImplemented]
public int CharacterSpacing { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
FontFamily
Gets or sets the font used to display text in the control.
Declaration
public FontFamily FontFamily { get; set; }
Property Value
|
Improve this Doc
View Source
FontSize
Gets or sets the size of the text in this control.
Declaration
public double FontSize { get; set; }
Property Value
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
FontStretch
The stretch of the desired font.
This will only affect controls whose template uses the property
as a parameter. On other controls, the property will do nothing.
Declaration
[NotImplemented]
public FontStretch FontStretch { get; set; }
Property Value
|
Improve this Doc
View Source
FontStyle
Gets or sets the style in which the text is rendered.
Declaration
public FontStyle FontStyle { get; set; }
Property Value
|
Improve this Doc
View Source
FontWeight
Gets or sets the thickness of the specified font.
Declaration
public FontWeight FontWeight { get; set; }
Property Value
|
Improve this Doc
View Source
Foreground
Gets or sets a brush that describes the foreground color.
Declaration
public Brush Foreground { get; set; }
Property Value
|
Improve this Doc
View Source
HorizontalContentAlignment
Gets or sets the horizontal alignment of the control's content.
Declaration
public HorizontalAlignment HorizontalContentAlignment { get; set; }
Property Value
|
Improve this Doc
View Source
IsTabStop
Gets or sets a value that indicates whether a control is included in tab
navigation.
Declaration
public bool IsTabStop { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Padding
Gets or sets the distance between the border and its child object.
Declaration
public Thickness Padding { get; set; }
Property Value
|
Improve this Doc
View Source
TabIndex
Gets or sets a value that determines the order in which elements receive
focus when the user navigates through controls by pressing the Tab key.
The default value is MaxValue
Declaration
public int TabIndex { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
TabNavigation
Declaration
[NotImplemented]
public KeyboardNavigationMode TabNavigation { get; set; }
Property Value
|
Improve this Doc
View Source
Template
Gets or sets a control template.
Declaration
public ControlTemplate Template { get; set; }
Property Value
|
Improve this Doc
View Source
TextDecorations
Gets or sets the text decorations (underline, strikethrough...).
Declaration
public TextDecorationCollection TextDecorations { get; set; }
Property Value
|
Improve this Doc
View Source
UseSystemFocusVisuals
Determines whether the control displays the browser's default outline when Focused.
This property is ignored for Controls with a Template that defines the "Focused" VisualState.
The default value is False.
Declaration
public bool UseSystemFocusVisuals { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
VerticalContentAlignment
Gets or sets the vertical alignment of the control's content.
Declaration
public VerticalAlignment VerticalContentAlignment { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
ApplyTemplate()
Declaration
public bool ApplyTemplate()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
CreateDomElement(Object, out Object)
Declaration
public override object CreateDomElement(object parentRef, out object domElementWhereToPlaceChildren)
Parameters
Type |
Name |
Description |
System.Object |
parentRef |
|
System.Object |
domElementWhereToPlaceChildren |
|
Returns
Type |
Description |
System.Object |
|
Overrides
|
Improve this Doc
View Source
Focus()
Attempts to set the focus on the control.
Declaration
Returns
Type |
Description |
System.Boolean |
true if focus was set to the control, or focus was already on the control.
false if the control is not focusable.
|
|
Improve this Doc
View Source
GetTemplateChild(String)
Retrieves the named element in the instantiated ControlTemplate visual tree.
Declaration
protected DependencyObject GetTemplateChild(string childName)
Parameters
Type |
Name |
Description |
System.String |
childName |
The name of the element to find.
|
Returns
Type |
Description |
DependencyObject |
The named element from the template, if the element is found. Can return
null if no element with name childName was found in the template.
|
|
Improve this Doc
View Source
ManageIsEnabled(Boolean)
Declaration
protected override void ManageIsEnabled(bool isEnabled)
Parameters
Type |
Name |
Description |
System.Boolean |
isEnabled |
|
Overrides
|
Improve this Doc
View Source
MeasureOverride(Size)
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
Type |
Name |
Description |
Size |
availableSize |
|
Returns
Overrides
|
Improve this Doc
View Source
OnApplyTemplate()
Declaration
public override void OnApplyTemplate()
Overrides
|
Improve this Doc
View Source
OnDragEnter(DragEventArgs)
Declaration
[NotImplemented]
protected virtual void OnDragEnter(DragEventArgs e)
Parameters
|
Improve this Doc
View Source
OnDragLeave(DragEventArgs)
Declaration
[NotImplemented]
protected virtual void OnDragLeave(DragEventArgs e)
Parameters
|
Improve this Doc
View Source
OnDrop(DragEventArgs)
Declaration
[NotImplemented]
protected virtual void OnDrop(DragEventArgs e)
Parameters
|
Improve this Doc
View Source
OnTextInputStart(TextCompositionEventArgs)
Declaration
[NotImplemented]
protected virtual void OnTextInputStart(TextCompositionEventArgs e)
Parameters
|
Improve this Doc
View Source
OnTextInputUpdate(TextCompositionEventArgs)
Declaration
[NotImplemented]
protected virtual void OnTextInputUpdate(TextCompositionEventArgs e)
Parameters
Extension Methods