Class Border
Draws a border, background, or both, around another object.
Inheritance
System.Object
Border
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 Border : FrameworkElement
Examples
You can add a Border to the XAML as follows:
Or in C# (assuming we have a StackPanel Named MyStackPanel):
Border myBorder = new Border();
myBorder.Width = 60;
myBorder.Height = 30;
myBorder.CornerRadius = new CornerRadius(15);
myBorder.Padding = new Thickness(20);
myBorder.Background = new SolidColorBrush(Windows.UI.Colors.Blue);
myBorder.HorizontalAlignment=HorizontalAlignment.Left;
MyStackPanel.Children.Add(myBorder);
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
CornerRadiusProperty
Declaration
public static readonly DependencyProperty CornerRadiusProperty
Field Value
|
Improve this Doc
View Source
PaddingProperty
Identifies the Padding dependency property.
Declaration
public static readonly DependencyProperty PaddingProperty
Field Value
Properties
|
Improve this Doc
View Source
Background
Gets or sets the Brush that fills the background of the border.
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
Child
Gets or sets the child element to draw the border around.
Declaration
public UIElement Child { get; set; }
Property Value
|
Improve this Doc
View Source
CornerRadius
Gets or sets the radius for the corners of the border.
Declaration
public CornerRadius CornerRadius { get; set; }
Property Value
|
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
Methods
|
Improve this Doc
View Source
ArrangeOverride(Size)
Declaration
protected override Size ArrangeOverride(Size finalSize)
Parameters
Type |
Name |
Description |
Size |
finalSize |
|
Returns
Overrides
|
Improve this Doc
View Source
INTERNAL_OnAttachedToVisualTree()
Declaration
protected override void INTERNAL_OnAttachedToVisualTree()
Overrides
|
Improve this Doc
View Source
MeasureOverride(Size)
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
Type |
Name |
Description |
Size |
availableSize |
|
Returns
Overrides
Extension Methods