Show / Hide Table of Contents

Method wpfBuilder.Border(+ 1 overload)


Overload

Sets border properties of the last added element, which can be Border or a Control-derived class.

public wpfBuilder Border(Brush color = null, double thickness = 1, Thickness? padding = null, double? cornerRadius = null, Thickness? thickness2 = null)
Parameters
color  (Brush)

Border color brush. If null, uses SystemColors.ActiveBorderBrush.

thickness  (double)

Border thickness. Ignored if thickness2 not null.

padding  (Thickness?)

Sets the Padding property.

cornerRadius  (double?)

Sets System.Windows.Controls.Border.CornerRadius. If used, the last added element must be Border.

thickness2  (Thickness?)

Border thickness to use instead of thickness. Allows to set non-uniform thickness.

Returns
wpfBuilder
Exceptions
NotSupportedException

Last added element must be Control or Border. With cornerRadius only Border.

Examples

b.R.Add<Label>("Example1").Border(Brushes.BlueViolet, 1, new(5)).Brush(Brushes.Cornsilk, Brushes.Green);
b.R.Add<Border>().Border(Brushes.Blue, 2, cornerRadius: 3).Add<Label>("Example2", WBAdd.ChildOfLast);

Overload(top)

Sets border properties of the last added element, which can be Border or a Control-derived class.

public wpfBuilder Border(ColorInt color, double thickness = 1, Thickness? padding = null, double? cornerRadius = null, Thickness? thickness2 = null)
Parameters
color  (ColorInt)

Border color.

thickness  (double)

Border thickness. Ignored if thickness2 not null.

padding  (Thickness?)

Sets the Padding property.

cornerRadius  (double?)

Sets System.Windows.Controls.Border.CornerRadius. If used, the last added element must be Border.

thickness2  (Thickness?)

Border thickness to use instead of thickness. Allows to set non-uniform thickness.

Returns
wpfBuilder
Exceptions
NotSupportedException

Last added element must be Control or Border. With cornerRadius only Border.

Examples

b.R.Add<Label>("Example1").Border(Brushes.BlueViolet, 1, new(5)).Brush(Brushes.Cornsilk, Brushes.Green);
b.R.Add<Border>().Border(Brushes.Blue, 2, cornerRadius: 3).Add<Label>("Example2", WBAdd.ChildOfLast);