diff --git a/src/Fabulous.Maui/AppHostBuilderExtensions.fs b/src/Fabulous.Maui/AppHostBuilderExtensions.fs index 64d447c..e21740f 100644 --- a/src/Fabulous.Maui/AppHostBuilderExtensions.fs +++ b/src/Fabulous.Maui/AppHostBuilderExtensions.fs @@ -23,7 +23,7 @@ module FabulousHandlers = | FabGridLayoutAttachedDataKeys.Row -> Microsoft.Maui.Controls.Grid.RowProperty | FabGridLayoutAttachedDataKeys.RowSpan -> Microsoft.Maui.Controls.Grid.RowSpanProperty | _ -> failwith $"Unknown key {key}" - + let getDefaultValueByKey (key: string) = match key with | FabGridLayoutAttachedDataKeys.Column -> box GridLayoutDefaults.Column diff --git a/src/Fabulous.Maui/Compatibility/Views/Controls/FormattedLabel.fs b/src/Fabulous.Maui/Compatibility/Views/Controls/FormattedLabel.fs index f7a9d1a..3e9ce86 100644 --- a/src/Fabulous.Maui/Compatibility/Views/Controls/FormattedLabel.fs +++ b/src/Fabulous.Maui/Compatibility/Views/Controls/FormattedLabel.fs @@ -51,4 +51,3 @@ type FormattedLabelYieldExtensions = x: WidgetBuilder<'msg, Memo.Memoized<'itemType>> ) : Content<'msg> = { Widgets = MutStackArray1.One(x.Compile()) } - \ No newline at end of file diff --git a/src/Fabulous.Maui/Compatibility/Views/Controls/_GestureElement.fs b/src/Fabulous.Maui/Compatibility/Views/Controls/_GestureElement.fs index 466e355..2d85d85 100644 --- a/src/Fabulous.Maui/Compatibility/Views/Controls/_GestureElement.fs +++ b/src/Fabulous.Maui/Compatibility/Views/Controls/_GestureElement.fs @@ -28,11 +28,11 @@ type GestureElementYieldExtensions = x: WidgetBuilder<'msg, #IFabCompatGestureRecognizer> ) : Content<'msg> = { Widgets = MutStackArray1.One(x.Compile()) } - + [] static member inline Yield ( _: AttributeCollectionBuilder<'msg, #IFabCompatGestureElement, IFabCompatGestureRecognizer>, x: WidgetBuilder<'msg, Memo.Memoized<#IFabCompatGestureRecognizer>> ) : Content<'msg> = - { Widgets = MutStackArray1.One(x.Compile()) } \ No newline at end of file + { Widgets = MutStackArray1.One(x.Compile()) } diff --git a/src/Fabulous.Maui/Compatibility/Views/Layouts/AbsoluteLayout.fs b/src/Fabulous.Maui/Compatibility/Views/Layouts/AbsoluteLayout.fs index 8af1482..59d3ee1 100644 --- a/src/Fabulous.Maui/Compatibility/Views/Layouts/AbsoluteLayout.fs +++ b/src/Fabulous.Maui/Compatibility/Views/Layouts/AbsoluteLayout.fs @@ -13,16 +13,19 @@ type IFabCompatAbsoluteLayout = inherit IAbsoluteLayout module FabCompatAbsoluteLayoutAttachedDataKeys = - let [] LayoutBounds = "FabCompatAbsoluteLayout_LayoutBounds" - let [] LayoutFlags = "FabCompatAbsoluteLayout_LayoutFlags" + [] + let LayoutBounds = "FabCompatAbsoluteLayout_LayoutBounds" + + [] + let LayoutFlags = "FabCompatAbsoluteLayout_LayoutFlags" module AbsoluteLayout = let WidgetKey = CompatWidgets.register() - + module AbsoluteLayoutAttachedData = let LayoutBounds = SharedAttributes.defineAttachedData FabCompatAbsoluteLayoutAttachedDataKeys.LayoutBounds - + let LayoutFlags = SharedAttributes.defineAttachedData FabCompatAbsoluteLayoutAttachedDataKeys.LayoutFlags diff --git a/src/Fabulous.Maui/Compatibility/Views/Layouts/_CompatLayoutOfView.fs b/src/Fabulous.Maui/Compatibility/Views/Layouts/_CompatLayoutOfView.fs index fbaac96..fb1ac89 100644 --- a/src/Fabulous.Maui/Compatibility/Views/Layouts/_CompatLayoutOfView.fs +++ b/src/Fabulous.Maui/Compatibility/Views/Layouts/_CompatLayoutOfView.fs @@ -15,17 +15,9 @@ module CompatLayoutOfView = [] type CompatLayoutOfViewYieldExtensions = [] - static member inline Yield - ( - _: CollectionBuilder<'msg, #IFabCompatLayoutOfView, IView>, - x: WidgetBuilder<'msg, 'itemType> - ) : Content<'msg> = + static member inline Yield(_: CollectionBuilder<'msg, #IFabCompatLayoutOfView, IView>, x: WidgetBuilder<'msg, 'itemType>) : Content<'msg> = { Widgets = MutStackArray1.One(x.Compile()) } - + [] - static member inline Yield - ( - _: CollectionBuilder<'msg, #IFabCompatLayoutOfView, IView>, - x: WidgetBuilder<'msg, Memo.Memoized<#IView>> - ) : Content<'msg> = - { Widgets = MutStackArray1.One(x.Compile()) } \ No newline at end of file + static member inline Yield(_: CollectionBuilder<'msg, #IFabCompatLayoutOfView, IView>, x: WidgetBuilder<'msg, Memo.Memoized<#IView>>) : Content<'msg> = + { Widgets = MutStackArray1.One(x.Compile()) } diff --git a/src/Fabulous.Maui/Compatibility/Views/Pages/NavigationPage.fs b/src/Fabulous.Maui/Compatibility/Views/Pages/NavigationPage.fs index 8c09d71..167f58f 100644 --- a/src/Fabulous.Maui/Compatibility/Views/Pages/NavigationPage.fs +++ b/src/Fabulous.Maui/Compatibility/Views/Pages/NavigationPage.fs @@ -448,9 +448,5 @@ type NavigationPagePlatformModifiers = [] type NavigationPageYieldExtensions = [] - static member inline Yield - ( - _: CollectionBuilder<'msg, 'marker, #IFabCompatPage>, - x: WidgetBuilder<'msg, Memo.Memoized<'itemType>> - ) : Content<'msg> = - { Widgets = MutStackArray1.One(x.Compile()) } \ No newline at end of file + static member inline Yield(_: CollectionBuilder<'msg, 'marker, #IFabCompatPage>, x: WidgetBuilder<'msg, Memo.Memoized<'itemType>>) : Content<'msg> = + { Widgets = MutStackArray1.One(x.Compile()) } diff --git a/src/Fabulous.Maui/Compatibility/Views/_CompatView.fs b/src/Fabulous.Maui/Compatibility/Views/_CompatView.fs index 8bace55..665b8b2 100644 --- a/src/Fabulous.Maui/Compatibility/Views/_CompatView.fs +++ b/src/Fabulous.Maui/Compatibility/Views/_CompatView.fs @@ -95,11 +95,11 @@ type CompatViewYieldExtensions = x: WidgetBuilder<'msg, #IFabCompatGestureRecognizer> ) : Content<'msg> = { Widgets = MutStackArray1.One(x.Compile()) } - + [] static member inline Yield ( _: AttributeCollectionBuilder<'msg, #IFabCompatView, IFabCompatGestureRecognizer>, x: WidgetBuilder<'msg, Memo.Memoized<#IFabCompatGestureRecognizer>> ) : Content<'msg> = - { Widgets = MutStackArray1.One(x.Compile()) } \ No newline at end of file + { Widgets = MutStackArray1.One(x.Compile()) } diff --git a/src/Fabulous.Maui/Core/Attributes.fs b/src/Fabulous.Maui/Core/Attributes.fs index 495faf5..363b5d5 100644 --- a/src/Fabulous.Maui/Core/Attributes.fs +++ b/src/Fabulous.Maui/Core/Attributes.fs @@ -52,11 +52,7 @@ module Attributes = if element.Handler <> null then element.Handler.UpdateValue(propertyName)) - let inline defineMauiFuncBool<'target, 'args> - (propertyName: string) - (defaultValue: Func) - ([] set: 'target -> Func -> unit) - = + let inline defineMauiFuncBool<'target, 'args> (propertyName: string) (defaultValue: Func) ([] set: 'target -> Func -> unit) = Attributes.defineSimpleScalar $"{typeof<'target>.Name}_{propertyName}" ScalarAttributeComparers.noCompare @@ -67,7 +63,7 @@ module Attributes = | ValueNone -> set target defaultValue | ValueSome curr -> let fn () = - let r = curr () + let r = curr() Dispatcher.dispatch node r true diff --git a/src/Fabulous.Maui/Core/Views/Controls/Image.fs b/src/Fabulous.Maui/Core/Views/Controls/Image.fs index 9e771e2..cb8c8bb 100644 --- a/src/Fabulous.Maui/Core/Views/Controls/Image.fs +++ b/src/Fabulous.Maui/Core/Views/Controls/Image.fs @@ -22,15 +22,12 @@ module Image = [] module ImageBuilders = type Fabulous.Maui.View with + static member inline Image(file: string) = WidgetBuilder<'msg, IFabImage>(Image.WidgetKey, ImageSourcePart.Source.WithValue(FabFileImageSource(file))) - + static member inline Image(file: string, aspect: Aspect) = - WidgetBuilder<'msg, IFabImage>( - Image.WidgetKey, - ImageSourcePart.Source.WithValue(FabFileImageSource(file)), - Image.Aspect.WithValue(aspect) - ) + WidgetBuilder<'msg, IFabImage>(Image.WidgetKey, ImageSourcePart.Source.WithValue(FabFileImageSource(file)), Image.Aspect.WithValue(aspect)) [] type ImageModifiers = diff --git a/src/Fabulous.Maui/Core/Views/Controls/ImageButton.fs b/src/Fabulous.Maui/Core/Views/Controls/ImageButton.fs index ef82506..71542b2 100644 --- a/src/Fabulous.Maui/Core/Views/Controls/ImageButton.fs +++ b/src/Fabulous.Maui/Core/Views/Controls/ImageButton.fs @@ -18,7 +18,7 @@ module ImageButtonBuilders = ImageSourcePart.Source.WithValue(FabFileImageSource(source)), Button.Clicked.WithValue(fun () -> box onClicked) ) - + static member inline ImageButton<'msg>(source: string, onClicked: 'msg, aspect: Aspect) = WidgetBuilder<'msg, IFabImageButton>( ImageButton.WidgetKey, diff --git a/src/Fabulous.Maui/Core/Views/Controls/Partials/_Button.fs b/src/Fabulous.Maui/Core/Views/Controls/Partials/_Button.fs index e15060b..ba122d8 100644 --- a/src/Fabulous.Maui/Core/Views/Controls/Partials/_Button.fs +++ b/src/Fabulous.Maui/Core/Views/Controls/Partials/_Button.fs @@ -6,9 +6,9 @@ open Fabulous.Maui.Controls module Button = let Clicked = Attributes.defineMauiAction "Clicked" ButtonDefaults.OnClicked (fun (target: IFabButton) -> target.SetOnClicked) - + let Pressed = Attributes.defineMauiAction "Pressed" ButtonDefaults.OnPressed (fun (target: IFabButton) -> target.SetOnPressed) - + let Released = Attributes.defineMauiAction "Released" ButtonDefaults.OnReleased (fun (target: IFabButton) -> target.SetOnReleased) diff --git a/src/Fabulous.Maui/Core/Views/Controls/Partials/_ButtonStroke.fs b/src/Fabulous.Maui/Core/Views/Controls/Partials/_ButtonStroke.fs index d03f4c1..e85c00c 100644 --- a/src/Fabulous.Maui/Core/Views/Controls/Partials/_ButtonStroke.fs +++ b/src/Fabulous.Maui/Core/Views/Controls/Partials/_ButtonStroke.fs @@ -24,7 +24,7 @@ type ButtonStrokeModifiers = [] static member strokeColor(this: WidgetBuilder<'msg, #IFabButtonStroke>, value: FabColor) = this.AddScalar(ButtonStroke.StrokeColor.WithValue(value.ToMauiColor())) - + [] static member strokeThickness(this: WidgetBuilder<'msg, #IFabButtonStroke>, value: float) = - this.AddScalar(ButtonStroke.StrokeThickness.WithValue(value)) \ No newline at end of file + this.AddScalar(ButtonStroke.StrokeThickness.WithValue(value)) diff --git a/src/Fabulous.Maui/Core/Views/Controls/Partials/_TextStyle.fs b/src/Fabulous.Maui/Core/Views/Controls/Partials/_TextStyle.fs index f224872..6edb1e3 100644 --- a/src/Fabulous.Maui/Core/Views/Controls/Partials/_TextStyle.fs +++ b/src/Fabulous.Maui/Core/Views/Controls/Partials/_TextStyle.fs @@ -28,9 +28,8 @@ type TextStyleModifiers = [] type TextStyleExtraModifiers = [] - static member inline textColor(this: WidgetBuilder<'msg, #IFabTextStyle>, value: FabColor) = - this.textColor(value.ToMauiColor()) - + static member inline textColor(this: WidgetBuilder<'msg, #IFabTextStyle>, value: FabColor) = this.textColor(value.ToMauiColor()) + [] static member inline font(this: WidgetBuilder<'msg, #IFabTextStyle>, ?size: float, ?fontFamily: string) = match size, fontFamily with diff --git a/src/Fabulous.Maui/Core/Views/Layouts/Grid.fs b/src/Fabulous.Maui/Core/Views/Layouts/Grid.fs index 70613b4..3be852a 100644 --- a/src/Fabulous.Maui/Core/Views/Layouts/Grid.fs +++ b/src/Fabulous.Maui/Core/Views/Layouts/Grid.fs @@ -61,8 +61,7 @@ module GridAttachedData = let ColumnSpan = SharedAttributes.defineAttachedData FabGridLayoutAttachedDataKeys.ColumnSpan - let Row = - SharedAttributes.defineAttachedData FabGridLayoutAttachedDataKeys.Row + let Row = SharedAttributes.defineAttachedData FabGridLayoutAttachedDataKeys.Row let RowSpan = SharedAttributes.defineAttachedData FabGridLayoutAttachedDataKeys.RowSpan diff --git a/src/Fabulous.Maui/Core/Views/Layouts/Partials/_BorderStroke.fs b/src/Fabulous.Maui/Core/Views/Layouts/Partials/_BorderStroke.fs index 72a030c..f1fb630 100644 --- a/src/Fabulous.Maui/Core/Views/Layouts/Partials/_BorderStroke.fs +++ b/src/Fabulous.Maui/Core/Views/Layouts/Partials/_BorderStroke.fs @@ -13,4 +13,4 @@ module BorderStroke = type BorderStrokeModifiers = [] static member shape(this: WidgetBuilder<'msg, #IFabBorderStroke>, shape: IShape) = - this.AddScalar(BorderStroke.Shape.WithValue(shape)) \ No newline at end of file + this.AddScalar(BorderStroke.Shape.WithValue(shape)) diff --git a/src/Fabulous.Maui/Core/Views/Layouts/Partials/_Stroke.fs b/src/Fabulous.Maui/Core/Views/Layouts/Partials/_Stroke.fs index 2253cab..3891243 100644 --- a/src/Fabulous.Maui/Core/Views/Layouts/Partials/_Stroke.fs +++ b/src/Fabulous.Maui/Core/Views/Layouts/Partials/_Stroke.fs @@ -32,33 +32,33 @@ type StrokeModifiers = [] static member stroke(this: WidgetBuilder<'msg, #IFabStroke>, value: Paint) = this.AddScalar(Stroke.Stroke.WithValue(value)) - + [] static member strokeThickness(this: WidgetBuilder<'msg, #IFabStroke>, value: float) = this.AddScalar(Stroke.StrokeThickness.WithValue(value)) - + [] static member strokeLineCap(this: WidgetBuilder<'msg, #IFabStroke>, value: LineCap) = this.AddScalar(Stroke.StrokeLineCap.WithValue(value)) - + [] static member strokeLineJoin(this: WidgetBuilder<'msg, #IFabStroke>, value: LineJoin) = this.AddScalar(Stroke.StrokeLineJoin.WithValue(value)) - + [] static member strokeDashPattern(this: WidgetBuilder<'msg, #IFabStroke>, value: float list) = this.AddScalar(Stroke.StrokeDashPattern.WithValue(value |> List.map float32 |> List.toArray)) - + [] static member strokeDashOffset(this: WidgetBuilder<'msg, #IFabStroke>, value: float) = this.AddScalar(Stroke.StrokeDashOffset.WithValue(float32 value)) - + [] static member strokeMiterLimit(this: WidgetBuilder<'msg, #IFabStroke>, value: float) = this.AddScalar(Stroke.StrokeMiterLimit.WithValue(float32 value)) - + [] type StrokeExtraModifiers = [] static member stroke(this: WidgetBuilder<'msg, #IFabStroke>, value: FabColor) = - this.stroke(SolidPaint(value.ToMauiColor())) \ No newline at end of file + this.stroke(SolidPaint(value.ToMauiColor())) diff --git a/src/Fabulous.Maui/Core/Views/Partials/_Transform.fs b/src/Fabulous.Maui/Core/Views/Partials/_Transform.fs index 314af0a..a712720 100644 --- a/src/Fabulous.Maui/Core/Views/Partials/_Transform.fs +++ b/src/Fabulous.Maui/Core/Views/Partials/_Transform.fs @@ -40,39 +40,39 @@ type TransformModifiers = [] static member anchorX(this: WidgetBuilder<'msg, #IFabTransform>, value: float) = this.AddScalar(Transform.AnchorX.WithValue(value)) - + [] static member anchorY(this: WidgetBuilder<'msg, #IFabTransform>, value: float) = this.AddScalar(Transform.AnchorY.WithValue(value)) - + [] static member rotation(this: WidgetBuilder<'msg, #IFabTransform>, value: float) = this.AddScalar(Transform.Rotation.WithValue(value)) - + [] static member rotationX(this: WidgetBuilder<'msg, #IFabTransform>, value: float) = this.AddScalar(Transform.RotationX.WithValue(value)) - + [] static member rotationY(this: WidgetBuilder<'msg, #IFabTransform>, value: float) = this.AddScalar(Transform.RotationY.WithValue(value)) - + [] static member scale(this: WidgetBuilder<'msg, #IFabTransform>, value: float) = this.AddScalar(Transform.Scale.WithValue(value)) - + [] static member scaleX(this: WidgetBuilder<'msg, #IFabTransform>, value: float) = this.AddScalar(Transform.ScaleX.WithValue(value)) - + [] static member scaleY(this: WidgetBuilder<'msg, #IFabTransform>, value: float) = this.AddScalar(Transform.ScaleY.WithValue(value)) - + [] static member translationX(this: WidgetBuilder<'msg, #IFabTransform>, value: float) = this.AddScalar(Transform.TranslationX.WithValue(value)) - + [] static member translationY(this: WidgetBuilder<'msg, #IFabTransform>, value: float) = - this.AddScalar(Transform.TranslationY.WithValue(value)) \ No newline at end of file + this.AddScalar(Transform.TranslationY.WithValue(value)) diff --git a/src/Fabulous.Maui/Core/Views/Partials/_View.fs b/src/Fabulous.Maui/Core/Views/Partials/_View.fs index 543f8a4..ac0d8df 100644 --- a/src/Fabulous.Maui/Core/Views/Partials/_View.fs +++ b/src/Fabulous.Maui/Core/Views/Partials/_View.fs @@ -172,9 +172,7 @@ type ViewExtraModifiers = [] static member inline center(this: WidgetBuilder<'msg, #IFabView>) = - this - .centerHorizontal() - .centerVertical() + this.centerHorizontal().centerVertical() [] static member inline alignStartHorizontal(this: WidgetBuilder<'msg, #IFabView>) = @@ -183,19 +181,19 @@ type ViewExtraModifiers = [] static member inline alignStartVertical(this: WidgetBuilder<'msg, #IFabView>) = this.verticalLayoutAlignment(LayoutAlignment.Start) - + [] static member inline alignEndHorizontal(this: WidgetBuilder<'msg, #IFabView>) = this.horizontalLayoutAlignment(LayoutAlignment.End) - + [] static member inline alignEndVertical(this: WidgetBuilder<'msg, #IFabView>) = this.verticalLayoutAlignment(LayoutAlignment.End) - + [] static member inline fillHorizontal(this: WidgetBuilder<'msg, #IFabView>) = this.horizontalLayoutAlignment(LayoutAlignment.Fill) - + [] static member inline fillVertical(this: WidgetBuilder<'msg, #IFabView>) = this.verticalLayoutAlignment(LayoutAlignment.Fill) @@ -210,22 +208,17 @@ type ViewExtraModifiers = [] static member margin(this: WidgetBuilder<'msg, #IFabView>, left: float, top: float, right: float, bottom: float) = this.margin(Thickness(left, top, right, bottom)) - + [] static member inline size(this: WidgetBuilder<'msg, #IFabView>, ?width: float, ?height: float) = match width, height with | None, None -> this | Some w, None -> this.AddScalar(View'.Width.WithValue(w)) | None, Some h -> this.AddScalar(View'.Height.WithValue(h)) - | Some w, Some h -> - this - .AddScalar(View'.Width.WithValue(w)) - .AddScalar(View'.Height.WithValue(h)) - - [] - static member inline background(this: WidgetBuilder<'msg, #IFabView>, value: Color) = - this.background(SolidPaint(value)) - - [] - static member inline background(this: WidgetBuilder<'msg, #IFabView>, value: FabColor) = - this.background(value.ToMauiColor()) + | Some w, Some h -> this.AddScalar(View'.Width.WithValue(w)).AddScalar(View'.Height.WithValue(h)) + + [] + static member inline background(this: WidgetBuilder<'msg, #IFabView>, value: Color) = this.background(SolidPaint(value)) + + [] + static member inline background(this: WidgetBuilder<'msg, #IFabView>, value: FabColor) = this.background(value.ToMauiColor()) diff --git a/src/Fabulous.Maui/Core/Views/Window.fs b/src/Fabulous.Maui/Core/Views/Window.fs index 9955138..8de451d 100644 --- a/src/Fabulous.Maui/Core/Views/Window.fs +++ b/src/Fabulous.Maui/Core/Views/Window.fs @@ -10,70 +10,72 @@ open Microsoft.Maui.Handlers.Defaults module Window = let WidgetKey = Widgets.register() - + let Content = Attributes.defineMauiPropertyWidget "Content" (fun target -> target.Content) (fun target -> target.SetContent) - + let FlowDirection = Attributes.defineMauiProperty' "FlowDirection" WindowDefaults.CreateFlowDirection (fun (target: IFabWindow) -> target.SetFlowDirection) - + let Height = Attributes.defineMauiProperty "Height" WindowDefaults.Height (fun (target: IFabWindow) -> target.SetHeight) - + let MaximumHeight = Attributes.defineMauiProperty "MaximumHeight" WindowDefaults.MaximumHeight (fun (target: IFabWindow) -> target.SetMaximumHeight) - + let MaximumWidth = Attributes.defineMauiProperty "MaximumWidth" WindowDefaults.MaximumWidth (fun (target: IFabWindow) -> target.SetMaximumWidth) - + let MinimumHeight = Attributes.defineMauiProperty "MinimumHeight" WindowDefaults.MinimumHeight (fun (target: IFabWindow) -> target.SetMinimumHeight) - + let MinimumWidth = Attributes.defineMauiProperty "MinimumWidth" WindowDefaults.MinimumWidth (fun (target: IFabWindow) -> target.SetMinimumWidth) - + let OnActivated = Attributes.defineMauiAction "OnActivated" WindowDefaults.OnActivated (fun (target: IFabWindow) -> target.SetOnActivated) let OnBackButtonClicked = Attributes.defineMauiFuncBool "OnBackButtonClicked" WindowDefaults.OnBackButtonClicked (fun (target: IFabWindow) -> target.SetOnBackButtonClicked) - + let OnBackgrounding = Attributes.defineMauiAction' "OnBackgrounding" WindowDefaults.OnBackgrounding (fun (target: IFabWindow) -> target.SetOnBackgrounding) - + let OnCreated = Attributes.defineMauiAction "OnCreated" WindowDefaults.OnCreated (fun (target: IFabWindow) -> target.SetOnCreated) - + let OnDeactivated = Attributes.defineMauiAction "OnDeactivated" WindowDefaults.OnDeactivated (fun (target: IFabWindow) -> target.SetOnDeactivated) - + let OnDestroying = Attributes.defineMauiAction "OnDestroying" WindowDefaults.OnDestroying (fun (target: IFabWindow) -> target.SetOnDestroying) - + let OnDisplayDensityChanged = - Attributes.defineMauiAction' "OnDisplayDensityChanged" WindowDefaults.OnDisplayDensityChanged (fun (target: IFabWindow) -> target.SetOnDisplayDensityChanged) - + Attributes.defineMauiAction' "OnDisplayDensityChanged" WindowDefaults.OnDisplayDensityChanged (fun (target: IFabWindow) -> + target.SetOnDisplayDensityChanged) + let OnFrameChanged = Attributes.defineMauiAction' "OnFrameChanged" WindowDefaults.OnFrameChanged (fun (target: IFabWindow) -> target.SetOnFrameChanged) - + let OnResumed = Attributes.defineMauiAction "OnResumed" WindowDefaults.OnResumed (fun (target: IFabWindow) -> target.SetOnResumed) - + let OnStopped = Attributes.defineMauiAction "OnStopped" WindowDefaults.OnStopped (fun (target: IFabWindow) -> target.SetOnStopped) - + let VisualDiagnosticsOverlay = - Attributes.defineMauiProperty "VisualDiagnosticsOverlay" WindowDefaults.VisualDiagnosticsOverlay (fun (target: IFabWindow) -> target.SetVisualDiagnosticsOverlay) - + Attributes.defineMauiProperty "VisualDiagnosticsOverlay" WindowDefaults.VisualDiagnosticsOverlay (fun (target: IFabWindow) -> + target.SetVisualDiagnosticsOverlay) + let Width = Attributes.defineMauiProperty "Width" WindowDefaults.Width (fun (target: IFabWindow) -> target.SetWidth) - + let X = Attributes.defineMauiProperty "X" WindowDefaults.X (fun (target: IFabWindow) -> target.SetX) - + let Y = Attributes.defineMauiProperty "Y" WindowDefaults.Y (fun (target: IFabWindow) -> target.SetY) - + [] module WindowBuilders = type Fabulous.Maui.View with @@ -89,80 +91,79 @@ type WindowModifiers = [] static member inline flowDirection(this: WidgetBuilder<'msg, #IFabWindow>, value: FlowDirection) = this.AddScalar(Window.FlowDirection.WithValue(value)) - + [] static member inline height(this: WidgetBuilder<'msg, #IFabWindow>, value: double) = this.AddScalar(Window.Height.WithValue(value)) - + [] static member inline maximumHeight(this: WidgetBuilder<'msg, #IFabWindow>, value: double) = this.AddScalar(Window.MaximumHeight.WithValue(value)) - + [] static member inline maximumWidth(this: WidgetBuilder<'msg, #IFabWindow>, value: double) = this.AddScalar(Window.MaximumWidth.WithValue(value)) - + [] static member inline minimumHeight(this: WidgetBuilder<'msg, #IFabWindow>, value: double) = this.AddScalar(Window.MinimumHeight.WithValue(value)) - + [] static member inline minimumWidth(this: WidgetBuilder<'msg, #IFabWindow>, value: double) = this.AddScalar(Window.MinimumWidth.WithValue(value)) - + [] static member inline onActivated(this: WidgetBuilder<'msg, #IFabWindow>, msg: 'msg) = this.AddScalar(Window.OnActivated.WithValue(fun () -> box msg)) - + [] static member inline onBackButtonClicked(this: WidgetBuilder<'msg, #IFabWindow>, msg: 'msg) = this.AddScalar(Window.OnBackButtonClicked.WithValue(fun () -> box msg)) - + [] static member inline onBackgrounding(this: WidgetBuilder<'msg, #IFabWindow>, fn: IPersistedState -> 'msg) = - this.AddScalar(Window.OnBackgrounding.WithValue(fun args -> box (fn args))) - + this.AddScalar(Window.OnBackgrounding.WithValue(fun args -> box(fn args))) + [] static member inline onCreated(this: WidgetBuilder<'msg, #IFabWindow>, msg: 'msg) = this.AddScalar(Window.OnCreated.WithValue(fun () -> box msg)) - + [] static member inline onDeactivated(this: WidgetBuilder<'msg, #IFabWindow>, msg: 'msg) = this.AddScalar(Window.OnDeactivated.WithValue(fun () -> box msg)) - + [] static member inline onDestroying(this: WidgetBuilder<'msg, #IFabWindow>, msg: 'msg) = this.AddScalar(Window.OnDestroying.WithValue(fun () -> box msg)) - + [] static member inline onDisplayDensityChanged(this: WidgetBuilder<'msg, #IFabWindow>, fn: float32 -> 'msg) = - this.AddScalar(Window.OnDisplayDensityChanged.WithValue(fun args -> box (fn args))) - + this.AddScalar(Window.OnDisplayDensityChanged.WithValue(fun args -> box(fn args))) + [] static member inline onFrameChanged(this: WidgetBuilder<'msg, #IFabWindow>, fn: Rect -> 'msg) = - this.AddScalar(Window.OnFrameChanged.WithValue(fun args -> box (fn args))) - + this.AddScalar(Window.OnFrameChanged.WithValue(fun args -> box(fn args))) + [] static member inline onResumed(this: WidgetBuilder<'msg, #IFabWindow>, msg: 'msg) = this.AddScalar(Window.OnResumed.WithValue(fun () -> box msg)) - + [] static member inline onStopped(this: WidgetBuilder<'msg, #IFabWindow>, msg: 'msg) = this.AddScalar(Window.OnStopped.WithValue(fun () -> box msg)) - + [] static member inline visualDiagnosticsOverlay(this: WidgetBuilder<'msg, #IFabWindow>, value: VisualDiagnosticsOverlay) = this.AddScalar(Window.VisualDiagnosticsOverlay.WithValue(value)) - + [] static member inline width(this: WidgetBuilder<'msg, #IFabWindow>, value: double) = this.AddScalar(Window.Width.WithValue(value)) - + [] static member inline x(this: WidgetBuilder<'msg, #IFabWindow>, value: double) = this.AddScalar(Window.X.WithValue(value)) - + [] static member inline y(this: WidgetBuilder<'msg, #IFabWindow>, value: double) = this.AddScalar(Window.Y.WithValue(value)) - \ No newline at end of file diff --git a/src/Fabulous.Maui/Style.fs b/src/Fabulous.Maui/Style.fs index c164be2..b75c326 100644 --- a/src/Fabulous.Maui/Style.fs +++ b/src/Fabulous.Maui/Style.fs @@ -7,5 +7,4 @@ open Microsoft.Maui [] type StyleExtensions = [] - static member inline style(this: WidgetBuilder<'msg, #IElement>, fn: WidgetBuilder<'msg, #IElement> -> WidgetBuilder<'msg, #IElement>) = - fn this \ No newline at end of file + static member inline style(this: WidgetBuilder<'msg, #IElement>, fn: WidgetBuilder<'msg, #IElement> -> WidgetBuilder<'msg, #IElement>) = fn this diff --git a/templates/content/blank/App.fs b/templates/content/blank/App.fs index 63f3136..7bdfc10 100644 --- a/templates/content/blank/App.fs +++ b/templates/content/blank/App.fs @@ -43,7 +43,12 @@ module App = .centerTextHorizontal() Label("Welcome to .NET Multi-platform App UI powered by Fabulous") - .semantics(Semantics(HeadingLevel = SemanticHeadingLevel.Level2, Description = "Welcome to dot net Multi platform App U I powered by Fabulous")) + .semantics( + Semantics( + HeadingLevel = SemanticHeadingLevel.Level2, + Description = "Welcome to dot net Multi platform App U I powered by Fabulous" + ) + ) .font(Font.SystemFontOfSize(18.)) .centerTextHorizontal() @@ -63,4 +68,4 @@ module App = ) } - let program = Program.statefulWithCmdMsg init update view mapCmd \ No newline at end of file + let program = Program.statefulWithCmdMsg init update view mapCmd