diff --git a/src/Avalonia.FuncUI.ControlCatalog/Avalonia.FuncUI.ControlCatalog/Views/Tabs/CanvasDemo.fs b/src/Avalonia.FuncUI.ControlCatalog/Avalonia.FuncUI.ControlCatalog/Views/Tabs/CanvasDemo.fs
index a8b4ae79..7e42404b 100644
--- a/src/Avalonia.FuncUI.ControlCatalog/Avalonia.FuncUI.ControlCatalog/Views/Tabs/CanvasDemo.fs
+++ b/src/Avalonia.FuncUI.ControlCatalog/Avalonia.FuncUI.ControlCatalog/Views/Tabs/CanvasDemo.fs
@@ -54,7 +54,7 @@ module CanvasDemo =
Line.startPoint (120.0, 185.0)
Line.endPoint (30.0, 115.0)
Line.strokeLineCap PenLineCap.Round
- Line.strokeJoinCap PenLineJoin.Bevel
+ Line.strokeJoin PenLineJoin.Bevel
Line.stroke "red"
Line.strokeThickness 2.0
]
diff --git a/src/Avalonia.FuncUI/Avalonia.FuncUI.fsproj b/src/Avalonia.FuncUI/Avalonia.FuncUI.fsproj
index 3adecfa9..c32f8cd4 100644
--- a/src/Avalonia.FuncUI/Avalonia.FuncUI.fsproj
+++ b/src/Avalonia.FuncUI/Avalonia.FuncUI.fsproj
@@ -68,8 +68,16 @@
+
+
+
+
+
+
+
+
@@ -83,19 +91,28 @@
+
+
+
+
+
+
+
+
+
@@ -108,12 +125,15 @@
+
+
+
@@ -121,14 +141,20 @@
+
-
+
+
+
+
+
+
@@ -138,6 +164,8 @@
+
+
diff --git a/src/Avalonia.FuncUI/DSL/AutoCompleteBox.fs b/src/Avalonia.FuncUI/DSL/AutoCompleteBox.fs
index c1fa982d..69456f4f 100644
--- a/src/Avalonia.FuncUI/DSL/AutoCompleteBox.fs
+++ b/src/Avalonia.FuncUI/DSL/AutoCompleteBox.fs
@@ -12,6 +12,8 @@ module AutoCompleteBox =
open Avalonia.Controls.Templates
open Avalonia.FuncUI.Types
open Avalonia.FuncUI.Builder
+ open System.ComponentModel
+ open Avalonia.Data
let create (attrs: IAttr list): IView =
ViewBuilder.Create(attrs)
@@ -44,6 +46,13 @@ module AutoCompleteBox =
static member isDropDownOpen<'t when 't :> AutoCompleteBox>(value: bool) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(AutoCompleteBox.IsDropDownOpenProperty, value, ValueNone)
+ static member valueMemberBinding<'t when 't :> AutoCompleteBox>(binding: IBinding) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.ValueMemberBinding
+ let getter: 't -> IBinding = (fun control -> control.ValueMemberBinding)
+ let setter: 't * IBinding -> unit = (fun (control, value) -> control.ValueMemberBinding <- value)
+
+ AttrBuilder<'t>.CreateProperty(name, binding, ValueSome getter, ValueSome setter, ValueNone)
+
static member selectedItem<'t when 't :> AutoCompleteBox>(value: obj) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(AutoCompleteBox.SelectedItemProperty, value, ValueNone)
@@ -56,9 +65,87 @@ module AutoCompleteBox =
static member onTextChanged<'t when 't :> AutoCompleteBox>(func: string -> unit, ?subPatchOptions) =
AttrBuilder<'t>.CreateSubscription(AutoCompleteBox.TextProperty, func, ?subPatchOptions = subPatchOptions)
+ static member onPopulating<'t when 't :> AutoCompleteBox>(func: PopulatingEventArgs -> unit, ?subPatchOptions) =
+ let name = nameof Unchecked.defaultof<'t>.Populating
+ let factory: SubscriptionFactory =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = EventHandler(fun sender args -> func args)
+ let event = control.Populating
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription(name, factory, func, ?subPatchOptions = subPatchOptions)
+
+ static member onPopulated<'t when 't :> AutoCompleteBox>(func: PopulatedEventArgs -> unit, ?subPatchOptions) =
+ let name = nameof Unchecked.defaultof<'t>.Populated
+ let factory: SubscriptionFactory =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = EventHandler(fun sender args -> func args)
+ let event = control.Populated
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription(name, factory, func, ?subPatchOptions = subPatchOptions)
+
static member onSearchTextChanged<'t when 't :> AutoCompleteBox>(func: string -> unit, ?subPatchOptions) =
AttrBuilder<'t>.CreateSubscription(AutoCompleteBox.SearchTextProperty, func, ?subPatchOptions = subPatchOptions)
+ static member onDropDownOpening<'t when 't :> AutoCompleteBox>(func: 't * CancelEventArgs -> unit, ?subPatchOptions) =
+ let name = nameof Unchecked.defaultof<'t>.DropDownOpening
+ let factory: SubscriptionFactory<'t * CancelEventArgs> =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = EventHandler(fun sender args -> func (sender :?> 't, args))
+ let event = control.DropDownOpening
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription<'t * CancelEventArgs>(name, factory, func, ?subPatchOptions = subPatchOptions)
+
+ static member onDropDownOpened<'t when 't :> AutoCompleteBox>(func: 't -> unit, ?subPatchOptions) =
+ let name = nameof Unchecked.defaultof<'t>.DropDownOpened
+ let factory: SubscriptionFactory<'t> =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = EventHandler(fun sender args -> func (sender :?> 't))
+ let event = control.DropDownOpened
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription<'t>(name, factory, func, ?subPatchOptions = subPatchOptions)
+
+ static member onDropDownClosing<'t when 't :> AutoCompleteBox>(func: 't * CancelEventArgs -> unit, ?subPatchOptions) =
+ let name = nameof Unchecked.defaultof<'t>.DropDownClosing
+ let factory: SubscriptionFactory<'t * CancelEventArgs> =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = EventHandler(fun sender args -> func (sender :?> 't, args))
+ let event = control.DropDownClosing
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription<'t * CancelEventArgs>(name, factory, func, ?subPatchOptions = subPatchOptions)
+
+ static member onDropDownClosed<'t when 't :> AutoCompleteBox>(func: 't -> unit, ?subPatchOptions) =
+ let name = nameof Unchecked.defaultof<'t>.DropDownClosed
+ let factory: SubscriptionFactory<'t> =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = EventHandler(fun sender args -> func (sender :?> 't))
+ let event = control.DropDownClosed
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription<'t>(name, factory, func, ?subPatchOptions = subPatchOptions)
+
static member filterMode<'t when 't :> AutoCompleteBox>(mode: AutoCompleteFilterMode) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(AutoCompleteBox.FilterModeProperty, mode, ValueNone)
@@ -72,6 +159,9 @@ module AutoCompleteBox =
static member textFilter<'t when 't :> AutoCompleteBox>(filterFunc: string -> obj -> bool) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty<_>(AutoCompleteBox.TextFilterProperty, filterFunc, ValueNone)
+ static member textSelector<'t when 't :> AutoCompleteBox>(selector: AutoCompleteSelector) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty<_>(AutoCompleteBox.TextSelectorProperty, selector, ValueNone)
+
static member dataItems<'t when 't :> AutoCompleteBox>(items: IEnumerable) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(AutoCompleteBox.ItemsSourceProperty, items, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Base/ContentPresenter.fs b/src/Avalonia.FuncUI/DSL/Base/ContentPresenter.fs
index 9605d0b2..440d13f8 100644
--- a/src/Avalonia.FuncUI/DSL/Base/ContentPresenter.fs
+++ b/src/Avalonia.FuncUI/DSL/Base/ContentPresenter.fs
@@ -10,14 +10,14 @@ module ContentPresenter =
open Avalonia.FuncUI.Builder
open Avalonia.Media
open Avalonia.Media.Immutable
-
+
let create (attrs: IAttr list): IView =
ViewBuilder.Create(attrs)
-
+
type ContentPresenter with
static member background<'t when 't :> ContentPresenter>(brush: IBrush) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ContentPresenter.BackgroundProperty, brush, ValueNone)
-
+
static member background<'t when 't :> ContentPresenter>(color: string) : IAttr<'t> =
Color.Parse(color) |> ImmutableSolidColorBrush |> ContentPresenter.background
@@ -26,72 +26,114 @@ module ContentPresenter =
static member borderBrush<'t when 't :> ContentPresenter>(brush: IBrush) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ContentPresenter.BorderBrushProperty, brush, ValueNone)
-
+
static member borderBrush<'t when 't :> ContentPresenter>(color: string) : IAttr<'t> =
Color.Parse(color) |> ImmutableSolidColorBrush |> ContentPresenter.borderBrush
static member borderBrush<'t when 't :> ContentPresenter>(color: Color) : IAttr<'t> =
color |> ImmutableSolidColorBrush |> ContentPresenter.borderBrush
-
+
static member borderThickness<'t when 't :> ContentPresenter>(value: Thickness) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ContentPresenter.BorderThicknessProperty, value, ValueNone)
-
+
static member borderThickness<'t when 't :> ContentPresenter>(value: float) : IAttr<'t> =
Thickness(value) |> ContentPresenter.borderThickness
-
+
static member borderThickness<'t when 't :> ContentPresenter>(horizontal: float, vertical: float) : IAttr<'t> =
Thickness(horizontal, vertical) |> ContentPresenter.borderThickness
-
+
static member borderThickness<'t when 't :> ContentPresenter>(left: float, top: float, right: float, bottom: float) : IAttr<'t> =
Thickness(left, top, right, bottom) |> ContentPresenter.borderThickness
-
+
static member boxShadows<'t when 't :> ContentPresenter>(value: BoxShadows) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ContentPresenter.BoxShadowProperty, value, ValueNone)
-
+
static member boxShadow<'t when 't :> ContentPresenter>(value: BoxShadow) : IAttr<'t> =
value |> BoxShadows |> ContentPresenter.boxShadows
-
+
+ static member foreground<'t when 't :> ContentPresenter>(brush: IBrush) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ContentPresenter.ForegroundProperty, brush, ValueNone)
+
+ static member foreground<'t when 't :> ContentPresenter>(color: string) : IAttr<'t> =
+ Color.Parse(color) |> ImmutableSolidColorBrush |> ContentPresenter.foreground
+
+ static member foreground<'t when 't :> ContentPresenter>(color: Color) : IAttr<'t> =
+ color |> ImmutableSolidColorBrush |> ContentPresenter.foreground
+
+ static member fontFamily<'t when 't :> ContentPresenter>(value: FontFamily) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ContentPresenter.FontFamilyProperty, value, ValueNone)
+
+ static member fontSize<'t when 't :> ContentPresenter>(value: float) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ContentPresenter.FontSizeProperty, value, ValueNone)
+
+ static member fontStyle<'t when 't :> ContentPresenter>(value: FontStyle) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ContentPresenter.FontStyleProperty, value, ValueNone)
+
+ static member fontWeight<'t when 't :> ContentPresenter>(value: FontWeight) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ContentPresenter.FontWeightProperty, value, ValueNone)
+
+ static member fontStretch<'t when 't :> ContentPresenter>(value: FontStretch) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ContentPresenter.FontStretchProperty, value, ValueNone)
+
+ static member textAlignment<'t when 't :> ContentPresenter>(value: TextAlignment) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ContentPresenter.TextAlignmentProperty, value, ValueNone)
+
+ static member textWrapping<'t when 't :> ContentPresenter>(value: TextWrapping) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ContentPresenter.TextWrappingProperty, value, ValueNone)
+
+ static member textTrimming<'t when 't :> ContentPresenter>(value: TextTrimming) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ContentPresenter.TextTrimmingProperty, value, ValueNone)
+
+ static member lineHeight<'t when 't :> ContentPresenter>(value: float) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ContentPresenter.LineHeightProperty, value, ValueNone)
+
+ static member maxLines<'t when 't :> ContentPresenter>(value: int) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ContentPresenter.MaxLinesProperty, value, ValueNone)
+
static member cornerRadius<'t when 't :> ContentPresenter>(value: CornerRadius) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ContentPresenter.CornerRadiusProperty, value, ValueNone)
-
+
static member cornerRadius<'t when 't :> ContentPresenter>(value: float) : IAttr<'t> =
CornerRadius(value) |> ContentPresenter.cornerRadius
-
+
static member cornerRadius<'t when 't :> ContentPresenter>(horizontal: float, vertical: float) : IAttr<'t> =
CornerRadius(horizontal, vertical) |> ContentPresenter.cornerRadius
-
+
static member cornerRadius<'t when 't :> ContentPresenter>(left: float, top: float, right: float, bottom: float) : IAttr<'t> =
CornerRadius(left, right, top, bottom) |> ContentPresenter.cornerRadius
-
+
static member child<'t when 't :> ContentPresenter>(value: IView option) : IAttr<'t> =
AttrBuilder<'t>.CreateContentSingle(ContentPresenter.ChildProperty, value)
static member child<'t when 't :> ContentPresenter>(value: IView) : IAttr<'t> =
value |> Some |> ContentPresenter.child
-
+
static member content<'t when 't :> ContentPresenter>(value: IView option) : IAttr<'t> =
AttrBuilder<'t>.CreateContentSingle(ContentPresenter.ContentProperty, value)
static member content<'t when 't :> ContentPresenter>(value: IView) : IAttr<'t> =
value |> Some |> ContentPresenter.content
-
+
static member contentTemplate<'t when 't :> ContentPresenter>(template: IDataTemplate) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ContentPresenter.ContentTemplateProperty, template, ValueNone)
-
+
static member horizontalContentAlignment<'t when 't :> ContentPresenter>(value: HorizontalAlignment) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ContentPresenter.HorizontalContentAlignmentProperty, value, ValueNone)
-
+
static member verticalContentAlignment<'t when 't :> ContentPresenter>(value: VerticalAlignment) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ContentPresenter.VerticalContentAlignmentProperty, value, ValueNone)
-
+
static member padding<'t when 't :> ContentPresenter>(value: Thickness) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ContentPresenter.PaddingProperty, value, ValueNone)
-
+
static member padding<'t when 't :> ContentPresenter>(value: float) : IAttr<'t> =
Thickness(value) |> ContentPresenter.padding
-
+
static member padding<'t when 't :> ContentPresenter>(horizontal: float, vertical: float) : IAttr<'t> =
Thickness(horizontal, vertical) |> ContentPresenter.padding
-
+
static member padding<'t when 't :> ContentPresenter>(left: float, top: float, right: float, bottom: float) : IAttr<'t> =
- Thickness(left, top, right, bottom) |> ContentPresenter.padding
\ No newline at end of file
+ Thickness(left, top, right, bottom) |> ContentPresenter.padding
+
+ static member recognizesAccessKey<'t when 't :> ContentPresenter>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ContentPresenter.RecognizesAccessKeyProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Base/ItemsPresenter.fs b/src/Avalonia.FuncUI/DSL/Base/ItemsPresenter.fs
new file mode 100644
index 00000000..026d2e01
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/Base/ItemsPresenter.fs
@@ -0,0 +1,16 @@
+namespace Avalonia.FuncUI.DSL
+
+open Avalonia.Controls
+open Avalonia.Controls.Presenters
+
+[]
+module ItemsPresenter =
+ open Avalonia.FuncUI.Builder
+ open Avalonia.FuncUI.Types
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type ItemsPresenter with
+ static member itemsPanel<'t when 't :> ItemsPresenter>(value: ITemplate) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty>(ItemsPresenter.ItemsPanelProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Base/ScrollContentPresenter.fs b/src/Avalonia.FuncUI/DSL/Base/ScrollContentPresenter.fs
new file mode 100644
index 00000000..03297565
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/Base/ScrollContentPresenter.fs
@@ -0,0 +1,40 @@
+namespace Avalonia.FuncUI.DSL
+
+open Avalonia
+open Avalonia.Controls.Primitives
+open Avalonia.Controls.Presenters
+
+[]
+module ScrollContentPresenter =
+ open Avalonia.FuncUI.Builder
+ open Avalonia.FuncUI.Types
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type ScrollContentPresenter with
+ static member canHorizontallyScroll<'t when 't :> ScrollContentPresenter>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ScrollContentPresenter.CanHorizontallyScrollProperty, value, ValueNone)
+
+ static member canVerticallyScroll<'t when 't :> ScrollContentPresenter>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ScrollContentPresenter.CanVerticallyScrollProperty, value, ValueNone)
+
+ static member offset<'t when 't :> ScrollContentPresenter>(value: Vector) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ScrollContentPresenter.OffsetProperty, value, ValueNone)
+
+ static member offset<'t when 't :> ScrollContentPresenter>(x: double, y: double) : IAttr<'t> =
+ Vector(x, y) |> ScrollContentPresenter.offset
+ static member horizontalSnapPointsType<'t when 't :> ScrollContentPresenter>(value: SnapPointsType) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ScrollContentPresenter.HorizontalSnapPointsTypeProperty, value, ValueNone)
+
+ static member verticalSnapPointsType<'t when 't :> ScrollContentPresenter>(value: SnapPointsType) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ScrollContentPresenter.VerticalSnapPointsTypeProperty, value, ValueNone)
+
+ static member horizontalSnapPointsAlignment<'t when 't :> ScrollContentPresenter>(value: SnapPointsAlignment) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ScrollContentPresenter.HorizontalSnapPointsAlignmentProperty, value, ValueNone)
+
+ static member verticalSnapPointsAlignment<'t when 't :> ScrollContentPresenter>(value: SnapPointsAlignment) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ScrollContentPresenter.VerticalSnapPointsAlignmentProperty, value, ValueNone)
+
+ static member isScrollChainingEnabled<'t when 't :> ScrollContentPresenter>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ScrollContentPresenter.IsScrollChainingEnabledProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Base/TextPresenter.fs b/src/Avalonia.FuncUI/DSL/Base/TextPresenter.fs
new file mode 100644
index 00000000..9a2c1978
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/Base/TextPresenter.fs
@@ -0,0 +1,142 @@
+namespace Avalonia.FuncUI.DSL
+
+open System
+open Avalonia.Controls.Presenters
+open Avalonia.Media
+open Avalonia.Media.Immutable
+
+[]
+module TextPresenter =
+ open Avalonia.FuncUI.Builder
+ open Avalonia.FuncUI.Types
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type TextPresenter with
+ static member onCaretBoundsChanged<'t when 't :> TextPresenter>(func: 't -> unit, ?subPatchOptions) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.CaretBoundsChanged
+ let factory: SubscriptionFactory<'t> =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = EventHandler(fun s e -> func(s :?> 't))
+ let event = control.CaretBoundsChanged
+
+ event.AddHandler(handler)
+ token.Register(fun _ -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription<'t>(name, factory, func, ?subPatchOptions = subPatchOptions)
+
+ static member background<'t when 't :> TextPresenter>(value: IBrush) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.BackgroundProperty, value, ValueNone)
+
+ static member background<'t when 't :> TextPresenter>(color: string) : IAttr<'t> =
+ color |> Color.Parse |> ImmutableSolidColorBrush |> TextPresenter.background
+
+ static member background<'t when 't :> TextPresenter>(color: Color) : IAttr<'t> =
+ color |> ImmutableSolidColorBrush |> TextPresenter.background
+
+ static member preeditText<'t when 't :> TextPresenter>(value: string) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.PreeditTextProperty, value, ValueNone)
+
+ static member fontFamily<'t when 't :> TextPresenter>(value: FontFamily) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.FontFamily
+ let getter: 't -> FontFamily = (fun control -> control.FontFamily)
+ let setter: 't * FontFamily -> unit = (fun (control, value) -> control.FontFamily <- value)
+
+ AttrBuilder<'t>.CreateProperty(name, value, ValueSome getter, ValueSome setter, ValueNone)
+
+ static member fontSize<'t when 't :> TextPresenter>(value: double) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.FontSize
+ let getter: 't -> double = (fun control -> control.FontSize)
+ let setter: 't * double -> unit = (fun (control, value) -> control.FontSize <- value)
+
+ AttrBuilder<'t>.CreateProperty(name, value, ValueSome getter, ValueSome setter, ValueNone)
+
+ static member fontStyle<'t when 't :> TextPresenter>(value: FontStyle) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.FontStyle
+ let getter: 't -> FontStyle = (fun control -> control.FontStyle)
+ let setter: 't * FontStyle -> unit = (fun (control, value) -> control.FontStyle <- value)
+
+ AttrBuilder<'t>.CreateProperty(name, value, ValueSome getter, ValueSome setter, ValueNone)
+
+ static member fontWeight<'t when 't :> TextPresenter>(value: FontWeight) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.FontWeight
+ let getter: 't -> FontWeight = (fun control -> control.FontWeight)
+ let setter: 't * FontWeight -> unit = (fun (control, value) -> control.FontWeight <- value)
+
+ AttrBuilder<'t>.CreateProperty(name, value, ValueSome getter, ValueSome setter, ValueNone)
+
+ static member fontStretch<'t when 't :> TextPresenter>(value: FontStretch) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.FontStretch
+ let getter: 't -> FontStretch = (fun control -> control.FontStretch)
+ let setter: 't * FontStretch -> unit = (fun (control, value) -> control.FontStretch <- value)
+
+ AttrBuilder<'t>.CreateProperty(name, value, ValueSome getter, ValueSome setter, ValueNone)
+
+ static member foreground<'t when 't :> TextPresenter>(value: IBrush) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.Foreground
+ let getter: 't -> IBrush = (fun control -> control.Foreground)
+ let setter: 't * IBrush -> unit = (fun (control, value) -> control.Foreground <- value)
+
+ AttrBuilder<'t>.CreateProperty(name, value, ValueSome getter, ValueSome setter, ValueNone)
+
+ static member foreground<'t when 't :> TextPresenter>(color: string) : IAttr<'t> =
+ color |> Color.Parse |> ImmutableSolidColorBrush |> TextPresenter.foreground
+
+ static member foreground<'t when 't :> TextPresenter>(color: Color) : IAttr<'t> =
+ color |> ImmutableSolidColorBrush |> TextPresenter.foreground
+
+ static member textWrapping<'t when 't :> TextPresenter>(value: TextWrapping) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.TextWrappingProperty, value, ValueNone)
+
+ static member lineHeight<'t when 't :> TextPresenter>(value: double) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.LineHeightProperty, value, ValueNone)
+
+ static member letterSpacing<'t when 't :> TextPresenter>(value: double) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.LetterSpacingProperty, value, ValueNone)
+
+ static member textAlignment<'t when 't :> TextPresenter>(value: TextAlignment) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.TextAlignmentProperty, value, ValueNone)
+
+ static member caretIndex<'t when 't :> TextPresenter>(value: int) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.CaretIndexProperty, value, ValueNone)
+
+ static member passwordChar<'t when 't :> TextPresenter>(value: char) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.PasswordCharProperty, value, ValueNone)
+
+ static member revealPassword<'t when 't :> TextPresenter>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.RevealPasswordProperty, value, ValueNone)
+
+ static member selectionBrush<'t when 't :> TextPresenter>(value: IBrush) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.SelectionBrushProperty, value, ValueNone)
+
+ static member selectionBrush<'t when 't :> TextPresenter>(color: string) : IAttr<'t> =
+ color |> Color.Parse |> ImmutableSolidColorBrush |> TextPresenter.selectionBrush
+
+ static member selectionBrush<'t when 't :> TextPresenter>(color: Color) : IAttr<'t> =
+ color |> ImmutableSolidColorBrush |> TextPresenter.selectionBrush
+
+ static member selectionForegroundBrush<'t when 't :> TextPresenter>(value: IBrush) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.SelectionForegroundBrushProperty, value, ValueNone)
+
+ static member selectionForegroundBrush<'t when 't :> TextPresenter>(color: string) : IAttr<'t> =
+ color |> Color.Parse |> ImmutableSolidColorBrush |> TextPresenter.selectionForegroundBrush
+
+ static member selectionForegroundBrush<'t when 't :> TextPresenter>(color: Color) : IAttr<'t> =
+ color |> ImmutableSolidColorBrush |> TextPresenter.selectionForegroundBrush
+
+ static member caretBrush<'t when 't :> TextPresenter>(value: IBrush) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.CaretBrushProperty, value, ValueNone)
+
+ static member caretBrush<'t when 't :> TextPresenter>(color: string) : IAttr<'t> =
+ color |> Color.Parse |> ImmutableSolidColorBrush |> TextPresenter.caretBrush
+
+ static member caretBrush<'t when 't :> TextPresenter>(color: Color) : IAttr<'t> =
+ color |> ImmutableSolidColorBrush |> TextPresenter.caretBrush
+
+ static member selectionStart<'t when 't :> TextPresenter>(value: int) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.SelectionStartProperty, value, ValueNone)
+
+ static member selectionEnd<'t when 't :> TextPresenter>(value: int) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(TextPresenter.SelectionEndProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/BindingEvaluator.fs b/src/Avalonia.FuncUI/DSL/BindingEvaluator.fs
new file mode 100644
index 00000000..f48f0aa9
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/BindingEvaluator.fs
@@ -0,0 +1,36 @@
+namespace Avalonia.FuncUI.DSL
+
+open Avalonia
+open Avalonia.Controls
+open Avalonia.Data
+
+[]
+module BindingEvaluator =
+ open Avalonia.FuncUI.Types
+ open Avalonia.FuncUI.Builder
+
+ let create<'x>
+ (attrs: IAttr> list)
+ : IView> =
+ ViewBuilder.Create>(attrs)
+
+ let createWith<'x>
+ (binding: IBinding)
+ (attrs: IAttr> list)
+ : IView> =
+ create attrs |> View.withConstructorArgs [| binding |]
+
+ type AutoCompleteBox.BindingEvaluator<'x> with
+
+ static member value<'t, 'x when 't :> AutoCompleteBox.BindingEvaluator<'x>>(value: 'x) : IAttr<'t> =
+ let prop: StyledProperty<'x> = AutoCompleteBox.BindingEvaluator.ValueProperty
+ AttrBuilder<'t>.CreateProperty<'x>(prop, value, ValueNone)
+
+ static member valueBinding<'t, 'x when 't :> AutoCompleteBox.BindingEvaluator<'x>>
+ (value: IBinding)
+ : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.ValueBinding
+ let getter: 't -> IBinding = fun x -> x.ValueBinding
+ let setter: 't * IBinding -> unit = fun (x, v) -> x.ValueBinding <- v
+
+ AttrBuilder<'t>.CreateProperty(name, value, ValueSome getter, ValueSome setter, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Buttons/Button.fs b/src/Avalonia.FuncUI/DSL/Buttons/Button.fs
index 8ab42cd6..15dbc989 100644
--- a/src/Avalonia.FuncUI/DSL/Buttons/Button.fs
+++ b/src/Avalonia.FuncUI/DSL/Buttons/Button.fs
@@ -29,6 +29,9 @@ module Button =
static member isDefault<'t when 't :> Button>(value: bool) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(Button.IsDefaultProperty, value, ValueNone)
+ static member isCancel<'t when 't :> Button>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(Button.IsCancelProperty, value, ValueNone)
+
static member onIsPressedChanged<'t when 't :> Button>(func: bool -> unit, ?subPatchOptions) =
AttrBuilder<'t>.CreateSubscription(Button.IsPressedProperty, func, ?subPatchOptions = subPatchOptions)
diff --git a/src/Avalonia.FuncUI/DSL/Buttons/DropDownButton.fs b/src/Avalonia.FuncUI/DSL/Buttons/DropDownButton.fs
new file mode 100644
index 00000000..9a0cde63
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/Buttons/DropDownButton.fs
@@ -0,0 +1,12 @@
+namespace Avalonia.FuncUI.DSL
+
+[]
+module DropDownButton =
+ open Avalonia.Controls
+ open Avalonia.FuncUI.Types
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type DropDownButton with
+ end
diff --git a/src/Avalonia.FuncUI/DSL/Buttons/ToggleSplitButton.fs b/src/Avalonia.FuncUI/DSL/Buttons/ToggleSplitButton.fs
new file mode 100644
index 00000000..56f80f06
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/Buttons/ToggleSplitButton.fs
@@ -0,0 +1,26 @@
+namespace Avalonia.FuncUI.DSL
+
+open Avalonia.Controls
+open Avalonia.Interactivity
+
+[]
+module ToggleSplitButton =
+ open Avalonia.FuncUI.Types
+ open Avalonia.FuncUI.Builder
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type ToggleSplitButton with
+
+ ///
+ /// Raised when the property value changes.
+ ///
+ static member onIsCheckedChanged<'t when 't :> ToggleSplitButton>(func: RoutedEventArgs -> unit, ?subPatchOptions) =
+ AttrBuilder<'t>.CreateSubscription(ToggleSplitButton.IsCheckedChangedEvent, func, ?subPatchOptions = subPatchOptions)
+
+ ///
+ /// Gets or sets a value indicating whether the is checked.
+ ///
+ static member isChecked<'t when 't :> ToggleSplitButton>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ToggleSplitButton.IsCheckedProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Buttons/ToggleSwitch.fs b/src/Avalonia.FuncUI/DSL/Buttons/ToggleSwitch.fs
index 3f631fb5..412f38c8 100644
--- a/src/Avalonia.FuncUI/DSL/Buttons/ToggleSwitch.fs
+++ b/src/Avalonia.FuncUI/DSL/Buttons/ToggleSwitch.fs
@@ -4,24 +4,55 @@
[]
module ToggleSwitch =
+ open Avalonia.Animation
open Avalonia.Controls
open Avalonia.Controls.Templates
+ open Avalonia.FuncUI
open Avalonia.FuncUI.Types
open Avalonia.FuncUI.Builder
+ open Avalonia.Collections
let create (attrs: IAttr list): IView =
ViewBuilder.Create(attrs)
type ToggleSwitch with
+
+ static member onContent<'t when 't :> ToggleSwitch>(text: string) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ToggleSwitch.OnContentProperty, text, ValueNone)
+
static member onContent<'t when 't :> ToggleSwitch>(value: obj) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ToggleSwitch.OnContentProperty, value, ValueNone)
-
+
+ static member onContent<'t when 't :> ToggleSwitch>(view: IView option) : IAttr<'t> =
+ AttrBuilder<'t>.CreateContentSingle(ToggleSwitch.OnContentProperty, view)
+
+ static member onContent<'t when 't :> ToggleSwitch>(view: IView) : IAttr<'t> =
+ Some view |> ToggleSwitch.onContent
+
static member onContentTemplate<'t when 't :> ToggleSwitch>(template: IDataTemplate) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ToggleSwitch.OnContentTemplateProperty, template, ValueNone)
-
+
+ static member offContent<'t when 't :> ToggleSwitch>(text: string) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ToggleSwitch.OffContentProperty, text, ValueNone)
+
static member offContent<'t when 't :> ToggleSwitch>(value: obj) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ToggleSwitch.OffContentProperty, value, ValueNone)
+ static member offContent<'t when 't :> ToggleSwitch>(view: IView option) : IAttr<'t> =
+ AttrBuilder<'t>.CreateContentSingle(ToggleSwitch.OffContentProperty, view)
+
+ static member offContent<'t when 't :> ToggleSwitch>(view: IView) : IAttr<'t> =
+ Some view |> ToggleSwitch.offContent
+
static member offContentTemplate<'t when 't :> ToggleSwitch>(template: IDataTemplate) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ToggleSwitch.OffContentTemplateProperty, template, ValueNone)
-
\ No newline at end of file
+
+ static member knobTransitions<'t when 't :> ToggleSwitch>(value: Transitions) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ToggleSwitch.KnobTransitionsProperty, value, ValueNone)
+
+ static member knobTransitions<'t when 't :> ToggleSwitch>(transitions: ITransition list) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.Transitions
+ let getter: 't -> ITransition list = fun x -> x.KnobTransitions |> Seq.toList
+ let setter: 't * ITransition list -> unit = fun (x, value) -> Setters.avaloniaList x.KnobTransitions value
+
+ AttrBuilder<'t>.CreateProperty(name, transitions, ValueSome getter, ValueSome setter, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Calendar/Calendar.fs b/src/Avalonia.FuncUI/DSL/Calendar/Calendar.fs
index 72008a84..0fa92cce 100644
--- a/src/Avalonia.FuncUI/DSL/Calendar/Calendar.fs
+++ b/src/Avalonia.FuncUI/DSL/Calendar/Calendar.fs
@@ -5,29 +5,60 @@
[]
module Calendar =
open System
+ open Avalonia.Controls.Primitives
open Avalonia.Media
open Avalonia.Media.Immutable
open Avalonia.Controls
+ open Avalonia.FuncUI
open Avalonia.FuncUI.Types
open Avalonia.FuncUI.Builder
-
+
let create (attrs: IAttr list): IView =
ViewBuilder.Create(attrs)
-
+
type Calendar with
-
+
+ static member onSelectedDatesChanged<'t when 't :> Calendar>(func: SelectionChangedEventArgs -> unit, ?subPatchOptions) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.SelectedDatesChanged
+ let factory: SubscriptionFactory =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = EventHandler(fun s e -> func e)
+ let event = control.SelectedDatesChanged
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription(name, factory, func, ?subPatchOptions = subPatchOptions)
+
+ static member onDisplayDateChanged<'t when 't :> Calendar>(func: CalendarDateChangedEventArgs -> unit, ?subPatchOptions) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.DisplayDateChanged
+ let factory: SubscriptionFactory =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = EventHandler(fun s e -> func e)
+ let event = control.DisplayDateChanged
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription(name, factory, func, ?subPatchOptions = subPatchOptions)
+
static member firstDayOfWeek<'t when 't :> Calendar>(value: DayOfWeek) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(Calendar.FirstDayOfWeekProperty, value, ValueNone)
-
+
static member isTodayHighlighted<'t when 't :> Calendar>(value: bool) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(Calendar.IsTodayHighlightedProperty , value, ValueNone)
static member headerBackground<'t when 't :> Calendar>(value: IBrush) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(Calendar.HeaderBackgroundProperty, value, ValueNone)
-
+
static member headerBackground<'t when 't :> Calendar>(color: string) : IAttr<'t> =
color |> Color.Parse |> ImmutableSolidColorBrush |> Calendar.headerBackground
+ static member headerBackground<'t when 't :> Calendar>(color: Color) : IAttr<'t> =
+ color |> ImmutableSolidColorBrush |> Calendar.headerBackground
+
static member displayMode<'t when 't :> Calendar>(value: CalendarMode) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(Calendar.DisplayModeProperty, value, ValueNone)
@@ -52,6 +83,21 @@ module Calendar =
static member onSelectedDateChanged<'t when 't :> Calendar>(func: Nullable -> unit, ?subPatchOptions) : IAttr<'t> =
AttrBuilder<'t>.CreateSubscription(Calendar.SelectedDateProperty, func, ?subPatchOptions = subPatchOptions)
+ static member selectedDates<'t when 't :> Calendar>(value: SelectedDatesCollection) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.SelectedDates
+ let getter: 't -> SelectedDatesCollection = fun control -> control.SelectedDates
+ let setter: 't * SelectedDatesCollection -> unit = fun (control, value) -> Setters.iList control.SelectedDates value
+ let compare: Comparer = EqualityComparers.compareSeq
+
+ AttrBuilder<'t>.CreateProperty(name, value, ValueSome getter, ValueSome setter, ValueSome compare)
+
+ static member selectedDates<'t when 't :> Calendar>(value: DateTime list) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.SelectedDates
+ let getter: 't -> DateTime list = fun control -> control.SelectedDates |> Seq.toList
+ let setter: 't * DateTime list -> unit = fun (control, value) -> Setters.iList control.SelectedDates value
+
+ AttrBuilder<'t>.CreateProperty(name, value, ValueSome getter, ValueSome setter, ValueNone)
+
static member displayDate<'t when 't :> Calendar>(value: DateTime) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(Calendar.DisplayDateProperty, value, ValueNone)
@@ -72,4 +118,3 @@ module Calendar =
static member displayDateEnd<'t when 't :> Calendar>(value: DateTime option) : IAttr<'t> =
value |> Option.toNullable |> Calendar.displayDateEnd
-
diff --git a/src/Avalonia.FuncUI/DSL/Calendar/CalendarButton.fs b/src/Avalonia.FuncUI/DSL/Calendar/CalendarButton.fs
new file mode 100644
index 00000000..8d1a5bdb
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/Calendar/CalendarButton.fs
@@ -0,0 +1,56 @@
+namespace Avalonia.FuncUI.DSL
+
+open System
+open Avalonia.Controls.Primitives
+open Avalonia.Input
+
+[]
+module CalendarButton =
+ open Avalonia.FuncUI.Types
+ open Avalonia.FuncUI.Builder
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type CalendarButton with
+
+ ///
+ /// Occurs when the left mouse button is pressed (or when the tip of the
+ /// stylus touches the tablet PC) while the mouse pointer is over a
+ /// UIElement.
+ ///
+ ///
+ /// Because of CalendarButton is sealed, this binding is only for CalendarButton
+ static member onCalendarLeftMouseButtonDown(func: PointerPressedEventArgs -> unit, ?subPatchOptions) : IAttr =
+ let name = nameof Unchecked.defaultof.CalendarLeftMouseButtonDown
+ let factory: SubscriptionFactory =
+ fun (control, func, token) ->
+ let control = control :?> CalendarButton
+ let handler = EventHandler(fun s e -> func e)
+ let event = control.CalendarLeftMouseButtonDown
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder.CreateSubscription(name, factory, func, ?subPatchOptions = subPatchOptions)
+
+ ///
+ /// Occurs when the left mouse button is released (or the tip of the
+ /// stylus is removed from the tablet PC) while the mouse (or the
+ /// stylus) is over a UIElement (or while a UIElement holds mouse
+ /// capture).
+ ///
+ ///
+ /// Because of CalendarButton is sealed, this binding is only for CalendarButton
+ static member onCalendarLeftMouseButtonUp(func: PointerReleasedEventArgs -> unit, ?subPatchOptions) : IAttr =
+ let name = nameof Unchecked.defaultof.CalendarLeftMouseButtonUp
+ let factory: SubscriptionFactory =
+ fun (control, func, token) ->
+ let control = control :?> CalendarButton
+ let handler = EventHandler(fun s e -> func e)
+ let event = control.CalendarLeftMouseButtonUp
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder.CreateSubscription(name, factory, func, ?subPatchOptions = subPatchOptions)
diff --git a/src/Avalonia.FuncUI/DSL/Calendar/CalendarDatePicker.fs b/src/Avalonia.FuncUI/DSL/Calendar/CalendarDatePicker.fs
index d21e1e16..c2a7cd2e 100644
--- a/src/Avalonia.FuncUI/DSL/Calendar/CalendarDatePicker.fs
+++ b/src/Avalonia.FuncUI/DSL/Calendar/CalendarDatePicker.fs
@@ -4,6 +4,7 @@
module CalendarDatePicker =
open System
open Avalonia.Controls
+ open Avalonia.Layout
open Avalonia.FuncUI.Types
open Avalonia.FuncUI.Builder
@@ -11,7 +12,46 @@ module CalendarDatePicker =
ViewBuilder.Create(attrs)
type CalendarDatePicker with
-
+
+ static member onCalendarClosed<'t when 't :> CalendarDatePicker>(func: 't -> unit, ?subPatchOptions) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.CalendarClosed
+ let factory: SubscriptionFactory<'t> =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = EventHandler(fun s e -> func (s :?> 't))
+ let event = control.CalendarClosed
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription(name, factory, func, ?subPatchOptions = subPatchOptions)
+
+ static member onCalendarOpened<'t when 't :> CalendarDatePicker>(func: 't -> unit, ?subPatchOptions) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.CalendarOpened
+ let factory: SubscriptionFactory<'t> =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = EventHandler(fun s e -> func (s :?> 't))
+ let event = control.CalendarOpened
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription(name, factory, func, ?subPatchOptions = subPatchOptions)
+
+ static member onDateValidationError<'t when 't :> CalendarDatePicker>(func: CalendarDatePickerDateValidationErrorEventArgs -> unit, ?subPatchOptions) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.DateValidationError
+ let factory: SubscriptionFactory =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = EventHandler(fun s e -> func e)
+ let event = control.DateValidationError
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription(name, factory, func, ?subPatchOptions = subPatchOptions)
+
static member displayDate<'t when 't :> CalendarDatePicker>(value: DateTime) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(CalendarDatePicker.DisplayDateProperty, value, ValueNone)
@@ -72,3 +112,8 @@ module CalendarDatePicker =
static member useFloatingWatermark<'t when 't :> CalendarDatePicker>(value: bool) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(CalendarDatePicker.UseFloatingWatermarkProperty, value, ValueNone)
+ static member horizontalContentAlignment<'t when 't :> CalendarDatePicker>(value: HorizontalAlignment) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(CalendarDatePicker.HorizontalContentAlignmentProperty, value, ValueNone)
+
+ static member verticalContentAlignment<'t when 't :> CalendarDatePicker>(value: VerticalAlignment) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(CalendarDatePicker.VerticalContentAlignmentProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Calendar/CalendarDayButton.fs b/src/Avalonia.FuncUI/DSL/Calendar/CalendarDayButton.fs
new file mode 100644
index 00000000..4c516461
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/Calendar/CalendarDayButton.fs
@@ -0,0 +1,56 @@
+namespace Avalonia.FuncUI.DSL
+
+open System
+open Avalonia.Controls.Primitives
+open Avalonia.Input
+
+[]
+module CalendarDayButton =
+ open Avalonia.FuncUI.Types
+ open Avalonia.FuncUI.Builder
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type CalendarDayButton with
+
+ ///
+ /// Occurs when the left mouse button is pressed (or when the tip of the
+ /// stylus touches the tablet PC) while the mouse pointer is over a
+ /// UIElement.
+ ///
+ ///
+ /// Because of CalendarDayButton is sealed, this binding is only for CalendarDayButton
+ static member onCalendarDayButtonMouseDown(func: PointerPressedEventArgs -> unit, ?subPatchOptions) : IAttr =
+ let name = nameof Unchecked.defaultof.CalendarDayButtonMouseDown
+ let factory: SubscriptionFactory =
+ fun (control, func, token) ->
+ let control = control :?> CalendarDayButton
+ let handler = EventHandler(fun s e -> func e)
+ let event = control.PointerPressed
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder.CreateSubscription(name, factory, func, ?subPatchOptions = subPatchOptions)
+
+ ///
+ /// Occurs when the left mouse button is released (or the tip of the
+ /// stylus is removed from the tablet PC) while the mouse (or the
+ /// stylus) is over a UIElement (or while a UIElement holds mouse
+ /// capture).
+ ///
+ ///
+ /// Because of CalendarDayButton is sealed, this binding is only for CalendarDayButton
+ static member onCalendarDayButtonMouseUp(func: PointerReleasedEventArgs -> unit, ?subPatchOptions) : IAttr =
+ let name = nameof Unchecked.defaultof.CalendarDayButtonMouseUp
+ let factory: SubscriptionFactory =
+ fun (control, func, token) ->
+ let control = control :?> CalendarDayButton
+ let handler = EventHandler(fun s e -> func e)
+ let event = control.PointerReleased
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder.CreateSubscription(name, factory, func, ?subPatchOptions = subPatchOptions)
diff --git a/src/Avalonia.FuncUI/DSL/ComboBox.fs b/src/Avalonia.FuncUI/DSL/ComboBox.fs
index c6c85760..789c67d7 100644
--- a/src/Avalonia.FuncUI/DSL/ComboBox.fs
+++ b/src/Avalonia.FuncUI/DSL/ComboBox.fs
@@ -4,6 +4,8 @@ namespace Avalonia.FuncUI.DSL
module ComboBox =
open Avalonia.Controls
open Avalonia.Layout
+ open Avalonia.Media
+ open Avalonia.Media.Immutable
open Avalonia.FuncUI.Types
open Avalonia.FuncUI.Builder
@@ -11,7 +13,33 @@ module ComboBox =
ViewBuilder.Create(attrs)
type ComboBox with
-
+ static member onDropDownClosed<'t when 't :> ComboBox>(func: 't -> unit, ?subPatchOptions) =
+ let name = nameof Unchecked.defaultof<'t>.DropDownClosed
+
+ let factory: SubscriptionFactory<'t> =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = System.EventHandler(fun s _ -> func (s :?> 't))
+ let event = control.DropDownClosed
+
+ event.AddHandler(handler)
+ token.Register(fun _ -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription<'t>(name, factory, func, ?subPatchOptions = subPatchOptions)
+
+ static member onDropDownOpened<'t when 't :> ComboBox>(func: 't -> unit, ?subPatchOptions) =
+ let name = nameof Unchecked.defaultof<'t>.DropDownOpened
+
+ let factory: SubscriptionFactory<'t> =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = System.EventHandler(fun s _ -> func (s :?> 't))
+ let event = control.DropDownOpened
+
+ event.AddHandler(handler)
+ token.Register(fun _ -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription<'t>(name, factory, func, ?subPatchOptions = subPatchOptions)
static member isDropDownOpen<'t when 't :> ComboBox>(value: bool) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ComboBox.IsDropDownOpenProperty, value, ValueNone)
@@ -20,6 +48,17 @@ module ComboBox =
static member maxDropDownHeight<'t when 't :> ComboBox>(height: float) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ComboBox.MaxDropDownHeightProperty, height, ValueNone)
-
+
+ static member placeholderText<'t when 't :> ComboBox>(text: string) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ComboBox.PlaceholderTextProperty, text, ValueNone)
+
+ static member placeholderForeground<'t when 't :> ComboBox>(value: IBrush) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ComboBox.PlaceholderForegroundProperty, value, ValueNone)
+
+ static member placeholderForeground<'t when 't :> ComboBox>(color:string) : IAttr<'t> =
+ color |> Color.Parse |> ImmutableSolidColorBrush |> ComboBox.placeholderForeground
+
+ static member placeholderForeground<'t when 't :> ComboBox>(color:Color) : IAttr<'t> =
+ color |> ImmutableSolidColorBrush |> ComboBox.placeholderForeground
static member verticalContentAlignment<'t when 't :> ComboBox>(alignment: VerticalAlignment) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(ComboBox.VerticalContentAlignmentProperty, alignment, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/DataGrid.fs b/src/Avalonia.FuncUI/DSL/DataGrid.fs
index 1fe1f31b..d21142be 100644
--- a/src/Avalonia.FuncUI/DSL/DataGrid.fs
+++ b/src/Avalonia.FuncUI/DSL/DataGrid.fs
@@ -58,6 +58,16 @@ module DataGrid =
multipleContent = columns
)
+[]
+module DataGridFrozenGrid =
+ open Avalonia.Controls.Primitives
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type Control with
+ static member isFrozen<'t when 't :> Control>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(DataGridFrozenGrid.IsFrozenProperty, value, ValueNone)
+
[]
module DataGridColumn =
diff --git a/src/Avalonia.FuncUI/DSL/DataValidationErrors.fs b/src/Avalonia.FuncUI/DSL/DataValidationErrors.fs
index 7c55fa40..7084e698 100644
--- a/src/Avalonia.FuncUI/DSL/DataValidationErrors.fs
+++ b/src/Avalonia.FuncUI/DSL/DataValidationErrors.fs
@@ -19,5 +19,9 @@ module DataValidationErrors =
AttrBuilder<'t>.CreateProperty(DataValidationErrors.HasErrorsProperty, hasErrors, ValueNone)
type DataValidationErrors with
+
+ static member owner<'t when 't :> DataValidationErrors>(value: Control) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(DataValidationErrors.OwnerProperty, value, ValueNone)
+
static member errorTemplate<'t when 't :> DataValidationErrors>(template: IDataTemplate) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(DataValidationErrors.ErrorTemplateProperty, template, ValueNone)
\ No newline at end of file
diff --git a/src/Avalonia.FuncUI/DSL/DatePickerPresenter.fs b/src/Avalonia.FuncUI/DSL/DatePickerPresenter.fs
new file mode 100644
index 00000000..07b42d65
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/DatePickerPresenter.fs
@@ -0,0 +1,49 @@
+namespace Avalonia.FuncUI.DSL
+
+open System
+open Avalonia.Controls
+
+[]
+module DatePickerPresenter =
+ open Avalonia.FuncUI.Types
+ open Avalonia.FuncUI.Builder
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type DatePickerPresenter with
+ /// Gets or sets the current Date for the picker
+ static member date<'t when 't :> DatePickerPresenter>(value: DateTimeOffset) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(DatePickerPresenter.DateProperty, value, ValueNone)
+
+ /// Gets or sets the DayFormat
+ static member dayFormat<'t when 't :> DatePickerPresenter>(value: string) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(DatePickerPresenter.DayFormatProperty, value, ValueNone)
+
+ /// Get or sets whether the Day selector is visible
+ static member dayVisible<'t when 't :> DatePickerPresenter>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(DatePickerPresenter.DayVisibleProperty, value, ValueNone)
+
+ /// Gets or sets the maximum pickable year
+ static member maxYear<'t when 't :> DatePickerPresenter>(value: DateTimeOffset) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(DatePickerPresenter.MaxYearProperty, value, ValueNone)
+
+ /// Gets or sets the minimum pickable year
+ static member minYear<'t when 't :> DatePickerPresenter>(value: DateTimeOffset) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(DatePickerPresenter.MinYearProperty, value, ValueNone)
+
+ /// Gets or sets the month format
+ static member monthFormat<'t when 't :> DatePickerPresenter>(value: string) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(DatePickerPresenter.MonthFormatProperty, value, ValueNone)
+
+ /// Gets or sets whether the month selector is visible
+ static member monthVisible<'t when 't :> DatePickerPresenter>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(DatePickerPresenter.MonthVisibleProperty, value, ValueNone)
+
+ /// Gets or sets the year format
+ static member yearFormat<'t when 't :> DatePickerPresenter>(value: string) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(DatePickerPresenter.YearFormatProperty, value, ValueNone)
+
+ /// Gets or sets whether the year selector is visible
+ static member yearVisible<'t when 't :> DatePickerPresenter>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(DatePickerPresenter.YearVisibleProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Expander.fs b/src/Avalonia.FuncUI/DSL/Expander.fs
index 73c44e85..ac4c1917 100644
--- a/src/Avalonia.FuncUI/DSL/Expander.fs
+++ b/src/Avalonia.FuncUI/DSL/Expander.fs
@@ -4,6 +4,7 @@
module Expander =
open Avalonia.Animation
open Avalonia.Controls
+ open Avalonia.Interactivity
open Avalonia.FuncUI.Types
open Avalonia.FuncUI.Builder
@@ -12,6 +13,18 @@ module Expander =
type Expander with
+ static member onCollapsed<'t when 't :> Expander>(func: RoutedEventArgs -> unit, ?subPatchOptions) =
+ AttrBuilder<'t>.CreateSubscription(Expander.CollapsedEvent, func, ?subPatchOptions = subPatchOptions)
+
+ static member onCollapsing<'t when 't :> Expander>(func: CancelRoutedEventArgs -> unit, ?subPatchOptions) =
+ AttrBuilder<'t>.CreateSubscription(Expander.CollapsingEvent, func, ?subPatchOptions = subPatchOptions)
+
+ static member onExpanded<'t when 't :> Expander>(func: RoutedEventArgs -> unit, ?subPatchOptions) =
+ AttrBuilder<'t>.CreateSubscription(Expander.ExpandedEvent, func, ?subPatchOptions = subPatchOptions)
+
+ static member onExpanding<'t when 't :> Expander>(func: CancelRoutedEventArgs -> unit, ?subPatchOptions) =
+ AttrBuilder<'t>.CreateSubscription(Expander.ExpandingEvent, func, ?subPatchOptions = subPatchOptions)
+
static member contentTransition<'t when 't :> Expander>(value: IPageTransition) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(Expander.ContentTransitionProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/ExperimentalAcrylicBorder.fs b/src/Avalonia.FuncUI/DSL/ExperimentalAcrylicBorder.fs
new file mode 100644
index 00000000..56a31146
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/ExperimentalAcrylicBorder.fs
@@ -0,0 +1,20 @@
+namespace Avalonia.FuncUI.DSL
+
+open Avalonia
+open Avalonia.Controls
+open Avalonia.Media
+
+[]
+module ExperimentalAcrylicBorder =
+ open Avalonia.FuncUI.Types
+ open Avalonia.FuncUI.Builder
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type ExperimentalAcrylicBorder with
+ static member cornerRadius<'t when 't :> ExperimentalAcrylicBorder>(value: CornerRadius) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ExperimentalAcrylicBorder.CornerRadiusProperty, value, ValueNone)
+
+ static member material<'t when 't :> ExperimentalAcrylicBorder>(value: ExperimentalAcrylicMaterial) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ExperimentalAcrylicBorder.MaterialProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/MenuItem.fs b/src/Avalonia.FuncUI/DSL/MenuItem.fs
index c0e86333..4464927b 100644
--- a/src/Avalonia.FuncUI/DSL/MenuItem.fs
+++ b/src/Avalonia.FuncUI/DSL/MenuItem.fs
@@ -44,6 +44,9 @@ module MenuItem =
static member isSubMenuOpen<'t when 't :> MenuItem>(value: bool) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(MenuItem.IsSubMenuOpenProperty, value, ValueNone)
+ static member staysOpenOnClick<'t when 't :> MenuItem>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(MenuItem.StaysOpenOnClickProperty, value, ValueNone)
+
static member onIsSubMenuOpenChanged<'t when 't :> MenuItem>(func: bool -> unit, ?subPatchOptions) =
AttrBuilder<'t>.CreateSubscription(MenuItem.IsSubMenuOpenProperty, func, ?subPatchOptions = subPatchOptions)
diff --git a/src/Avalonia.FuncUI/DSL/NativeControlHost.fs b/src/Avalonia.FuncUI/DSL/NativeControlHost.fs
new file mode 100644
index 00000000..2945e589
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/NativeControlHost.fs
@@ -0,0 +1,10 @@
+namespace Avalonia.FuncUI.DSL
+
+open Avalonia.Controls
+
+[]
+module NativeControlHost =
+ open Avalonia.FuncUI.Types
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
diff --git a/src/Avalonia.FuncUI/DSL/NumericUpDown.fs b/src/Avalonia.FuncUI/DSL/NumericUpDown.fs
index d3bd6e8f..cbd89e72 100644
--- a/src/Avalonia.FuncUI/DSL/NumericUpDown.fs
+++ b/src/Avalonia.FuncUI/DSL/NumericUpDown.fs
@@ -7,6 +7,8 @@ module NumericUpDown =
open Avalonia.Controls
open Avalonia.FuncUI.Types
open Avalonia.FuncUI.Builder
+ open Avalonia.Data.Converters
+ open Avalonia.Layout
let create (attrs: IAttr list): IView =
ViewBuilder.Create(attrs)
@@ -76,6 +78,9 @@ module NumericUpDown =
AttrBuilder<'t>.CreateProperty("Text", value, ValueSome getter, ValueSome setter, ValueNone)
+ static member textConverter<'t when 't :> NumericUpDown>(value: IValueConverter) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(NumericUpDown.TextConverterProperty, value, ValueNone)
+
static member onTextChanged<'t when 't :> NumericUpDown>(func: string -> unit, ?subPatchOptions) =
AttrBuilder<'t>.CreateSubscription(NumericUpDown.TextProperty, func, ?subPatchOptions = subPatchOptions)
@@ -91,4 +96,8 @@ module NumericUpDown =
static member watermark<'t when 't :> NumericUpDown>(value: string) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(NumericUpDown.WatermarkProperty, value, ValueNone)
+ static member horizontalContentAlignment<'t when 't :> NumericUpDown>(value: HorizontalAlignment) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(NumericUpDown.HorizontalContentAlignmentProperty, value, ValueNone)
+ static member verticalContentAlignment<'t when 't :> NumericUpDown>(value: VerticalAlignment) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(NumericUpDown.VerticalContentAlignmentProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Panels/ReversibleStackPanel.fs b/src/Avalonia.FuncUI/DSL/Panels/ReversibleStackPanel.fs
new file mode 100644
index 00000000..c93f37c9
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/Panels/ReversibleStackPanel.fs
@@ -0,0 +1,16 @@
+namespace Avalonia.FuncUI.DSL
+
+open Avalonia.Controls
+
+[]
+module ReversibleStackPanel =
+ open Avalonia.FuncUI.Types
+ open Avalonia.FuncUI.Builder
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type ReversibleStackPanel with
+ /// Gets or sets if the child controls will be layed out in reverse order.
+ static member reverseOrder<'t when 't :> ReversibleStackPanel>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(ReversibleStackPanel.ReverseOrderProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Panels/StackPanel.fs b/src/Avalonia.FuncUI/DSL/Panels/StackPanel.fs
index ad15f228..dbc8c426 100644
--- a/src/Avalonia.FuncUI/DSL/Panels/StackPanel.fs
+++ b/src/Avalonia.FuncUI/DSL/Panels/StackPanel.fs
@@ -3,20 +3,33 @@ namespace Avalonia.FuncUI.DSL
[]
module StackPanel =
open Avalonia.Controls
+ open Avalonia.Interactivity
open Avalonia.Layout
open Avalonia.FuncUI.Types
open Avalonia.FuncUI.Builder
-
+
let create (attrs: IAttr list): IView =
ViewBuilder.Create(attrs)
type StackPanel with
+ ///
+ /// Occurs when the measurements for horizontal snap points change.
+ ///
+ static member onHorizontalSnapPointsChanged<'t when 't :> StackPanel>(func: RoutedEventArgs -> unit, ?subPatchOptions) : IAttr<'t> =
+ AttrBuilder<'t>.CreateSubscription(StackPanel.HorizontalSnapPointsChangedEvent, func, ?subPatchOptions = subPatchOptions)
+
+ ///
+ /// Occurs when the measurements for vertical snap points change.
+ ///
+ static member onVerticalSnapPointsChanged<'t when 't :> StackPanel>(func: RoutedEventArgs -> unit, ?subPatchOptions) : IAttr<'t> =
+ AttrBuilder<'t>.CreateSubscription(StackPanel.VerticalSnapPointsChangedEvent, func, ?subPatchOptions = subPatchOptions)
+
///
/// Gets or sets the size of the spacing to place between child controls.
///
static member spacing<'t when 't :> StackPanel>(value: double) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty(StackPanel.SpacingProperty, value, ValueNone)
-
+
///
/// Gets or sets the orientation in which child controls will be layed out.
///
@@ -27,4 +40,4 @@ module StackPanel =
AttrBuilder<'t>.CreateProperty(StackPanel.AreHorizontalSnapPointsRegularProperty, value, ValueNone)
static member areVerticalSnapPointsRegular<'t when 't :> StackPanel>(value: bool) : IAttr<'t> =
- AttrBuilder<'t>.CreateProperty(StackPanel.AreVerticalSnapPointsRegularProperty, value, ValueNone)
\ No newline at end of file
+ AttrBuilder<'t>.CreateProperty(StackPanel.AreVerticalSnapPointsRegularProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Panels/VirtualizingCarouselPanel.fs b/src/Avalonia.FuncUI/DSL/Panels/VirtualizingCarouselPanel.fs
new file mode 100644
index 00000000..90ffcbf8
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/Panels/VirtualizingCarouselPanel.fs
@@ -0,0 +1,13 @@
+namespace Avalonia.FuncUI.DSL
+
+open Avalonia.Controls
+
+[]
+module VirtualizingCarouselPanel =
+ open Avalonia.FuncUI.Types
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type VirtualizingCarouselPanel with
+ end
diff --git a/src/Avalonia.FuncUI/DSL/Panels/VirtualizingStackPanel.fs b/src/Avalonia.FuncUI/DSL/Panels/VirtualizingStackPanel.fs
new file mode 100644
index 00000000..bd48db48
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/Panels/VirtualizingStackPanel.fs
@@ -0,0 +1,44 @@
+namespace Avalonia.FuncUI.DSL
+
+open Avalonia.Controls
+open Avalonia.Interactivity
+open Avalonia.Layout
+
+[]
+module VirtualizingStackPanel =
+ open Avalonia.FuncUI.Types
+ open Avalonia.FuncUI.Builder
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type VirtualizingStackPanel with
+ ///
+ /// Occurs when the measurements for horizontal snap points change.
+ ///
+ static member onHorizontalSnapPointsChanged<'t when 't :> VirtualizingStackPanel>(func: RoutedEventArgs -> unit, ?subPatchOptions) : IAttr<'t> =
+ AttrBuilder<'t>.CreateSubscription(VirtualizingStackPanel.HorizontalSnapPointsChangedEvent, func, ?subPatchOptions = subPatchOptions)
+
+ ///
+ /// Occurs when the measurements for vertical snap points change.
+ ///
+ static member onVerticalSnapPointsChanged<'t when 't :> VirtualizingStackPanel>(func: RoutedEventArgs -> unit, ?subPatchOptions) : IAttr<'t> =
+ AttrBuilder<'t>.CreateSubscription(VirtualizingStackPanel.VerticalSnapPointsChangedEvent, func, ?subPatchOptions = subPatchOptions)
+
+ ///
+ /// Gets or sets the axis along which items are laid out.
+ ///
+ static member orientation<'t when 't :> VirtualizingStackPanel>(orientation: Orientation) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(VirtualizingStackPanel.OrientationProperty, orientation, ValueNone)
+
+ ///
+ /// Gets or sets whether the horizontal snap points for the ``Avalonia.Controls.VirtualizingStackPanel`` are equidistant from each other.
+ ///
+ static member areHorizontalSnapPointsRegular<'t when 't :> VirtualizingStackPanel>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(VirtualizingStackPanel.AreHorizontalSnapPointsRegularProperty, value, ValueNone)
+
+ ///
+ /// Gets or sets whether the vertical snap points for the ``Avalonia.Controls.VirtualizingStackPanel`` are equidistant from each other.
+ ///
+ static member areVerticalSnapPointsRegular<'t when 't :> VirtualizingStackPanel>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(VirtualizingStackPanel.AreVerticalSnapPointsRegularProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Primitives/AdornerLayer.fs b/src/Avalonia.FuncUI/DSL/Primitives/AdornerLayer.fs
new file mode 100644
index 00000000..e41fb6f4
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/Primitives/AdornerLayer.fs
@@ -0,0 +1,36 @@
+namespace Avalonia.FuncUI.DSL
+
+open Avalonia
+open Avalonia.Controls
+open Avalonia.Controls.Primitives
+
+[]
+module AdornerLayer =
+ open Avalonia.FuncUI
+ open Avalonia.FuncUI.Types
+ open Avalonia.FuncUI.Builder
+
+ let create (attrs: IAttr list): IView =
+ ViewBuilder.Create(attrs)
+
+ type Visual with
+ static member adornedElement<'t, 'u when 't :> Visual and 'u :> Visual>(value: 'u) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(AdornerLayer.AdornedElementProperty, value, ValueNone)
+
+ static member adornedElement<'t, 'u when 't :> Visual and 'u :> Visual>(view: IView<'u>) : IAttr<'t> =
+ let view = generalize view
+ AttrBuilder<'t>.CreateContentSingle(AdornerLayer.AdornedElementProperty, Some view)
+
+ static member isClipEnabled<'t when 't :> Visual>(value: bool) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(AdornerLayer.IsClipEnabledProperty, value, ValueNone)
+
+ static member adorner<'t, 'c when 't :> Visual and 'c :> Control>(value: 'c) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty(AdornerLayer.AdornerProperty, value, ValueNone)
+
+ static member adorner<'t, 'c when 't :> Visual and 'c :> Control>(view: IView<'c>) : IAttr<'t> =
+ let view = generalize view
+ AttrBuilder<'t>.CreateContentSingle(AdornerLayer.AdornerProperty, Some view)
+
+ type AdornerLayer with
+ static member fefaultFocusAdorner<'t, 'c when 't :> AdornerLayer and 'c :> Control>(value: ITemplate<'c>) : IAttr<'t> =
+ AttrBuilder<'t>.CreateProperty>(AdornerLayer.DefaultFocusAdornerProperty, value, ValueNone)
diff --git a/src/Avalonia.FuncUI/DSL/Primitives/CalendarItem.fs b/src/Avalonia.FuncUI/DSL/Primitives/CalendarItem.fs
new file mode 100644
index 00000000..a45c9b59
--- /dev/null
+++ b/src/Avalonia.FuncUI/DSL/Primitives/CalendarItem.fs
@@ -0,0 +1,40 @@
+namespace Avalonia.FuncUI.DSL
+
+[