FuncUI
GitHub Repository
  • Getting Started
  • View Basics
    • Creating views
    • Lifetime
    • Attributes
    • How to create bindings
  • Components
    • Component basics
    • Component lifetime
    • Hooks
  • Common Questions
  • Controls
    • Button
    • Border
    • Calendar
    • CalendarDatePicker
    • CheckBox
    • DatePicker
    • DockPanel
    • Expander
    • ListBox
    • Menu
    • NativeMenu
    • NumericUpDown
    • ProgressBar
    • RadioButton
    • RepeatButton
    • Slider
    • StackPanel
    • Tabs
    • TextBlock
    • TextBox
    • TimePicker
    • ToggleButton
    • ToggleSwitch
Powered by GitBook
On this page
  1. Controls

Border

Last updated 2 years ago

Note: You can check the Avalonia docs for the and if you need more information.

For Avalonia.FuncUI's DSL properties you can check

The Border control allows you to decorate child controls

Usage

Set Background Avalonia.FuncUI has some overloads for you to take advantage of

Border.create [
  Border.background "black"
  Border.child (StackPanel.create [ /* ... definition ... */ ])
]
Border.create [
  Border.background "#000000"
  Border.child (StackPanel.create [ /* ... definition ... */ ])
]

You can pass any compatible instance to the background for more control

Set Border Brush Avalonia.FuncUI has some overloads for you to take advantage of

Border.create [
  Border.borderBrush "red"
  Border.child (StackPanel.create [ /* ... definition ... */ ])
]
Border.create [
  Border.borderBrush "#FF0000"
  Border.child (StackPanel.create [ /* ... definition ... */ ])
]

Thickness

Border.create [
  Border.borderThickness 2.0
  Border.child (StackPanel.create [ /* ... definition ... */ ])
]

Horizontal and Vertical Thickness

Border.create [
  Border.borderThickness (2.0, 5.0)
  Border.child (StackPanel.create [ /* ... definition ... */ ])
]

Left, Top, Right, Bottom Thickness

Border.create [
  Border.borderThickness (1.0, 2.0, 3.0, 4.0)
  Border.child (StackPanel.create [ /* ... definition ... */ ])
]

Corner Radius

Border.create [
  Border.cornerRadius 3.0
  Border.child (StackPanel.create [ /* ... definition ... */ ])
]

Horizontal and Vertical Corner Radius

Border.create [
  Border.cornerRadius (2.0, 5.0)
  Border.child (StackPanel.create [ /* ... definition ... */ ])
]

Left, Top, Right, Bottom Corner Radius

Border.create [
  Border.cornerRadius (1.0, 2.0, 3.0, 4.0)
  Border.child (StackPanel.create [ /* ... definition ... */ ])
]
Border.create [
  Border.cornerRadius (CornerRadius 3.0)
  Border.child (StackPanel.create [ /* ... definition ... */ ])
]

You can pass any compatible instance to the background for more control

You can also pass a struct to the borderThickness property

You can also pass a struct to the cornerRadius property

Border
Border Api
Border.fs
IBrush
IBrush
Thickness
Corner Radius