Skip to content

[Spec] Border #12

@jsuarezruiz

Description

@jsuarezruiz

Border Options

Views can't easily be given borders without nesting them in frames or implementing custom renderers.

border-options

API

The following properties need to be added on the Border static class:

public static readonly BindableProperty BorderThicknessProperty =
     BindableProperty.Create(propertyName: nameof(BorderThickness),
	     returnType: typeof(Thickness), declaringType: typeof(View));
		
public static readonly BindableProperty BorderColorProperty =
	BindableProperty.Create(propertyName: nameof(BorderColor),
		returnType: typeof(Color), declaringType: typeof(View));

And on IBorder: BorderThickness

Thickness BorderThickness { get; }
Color BorderColor{ get; }

void OnBorderThicknessPropertyChanged(Thickness oldValue, Thickness newValue);
void OnBorderColorPropertyChanged(Color oldValue, Color newValue);

Renderers will frame the given view using the given border properties

The following Views should implement the IBorder interface:

  • Entry
  • Button
  • Frame
  • DatePicker
  • Picker
  • TimePicker

Scenarios

Let's see an example using C #, XAML and CSS.

C# Example

var entry = new Entry();
entry.BorderThickness = new Thickness (2);
entry.BorderColor = Color.Red;

XAML Example

<Entry
     BorderThickness="2"
     BorderColor="Red" />

CSS Example

.entry 
{  
    border-width: 2px;
    border-color: red;
}

Difficulty : Easy

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions