From f43b52e48cc5c17ea81a8cace2df958f6b76b639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9=20Larivi=C3=A8re?= Date: Sat, 9 Feb 2019 14:45:50 +0100 Subject: [PATCH 1/3] Reworked generator to separate parts into different modules --- build.fsx | 7 + docs/contents.md | 1 + docs/testing.md | 197 + docs/views-elements.md | 4 +- docs/views-extending.md | 14 +- docs/views-maps.md | 9 +- docs/views-oxyplot.md | 2 +- docs/views-skiasharp.md | 2 +- extensions/Maps/Xamarin.Forms.Maps.fs | 20 +- extensions/OxyPlot/OxyPlot.fs | 20 +- extensions/SkiaSharp/SkiaSharp.fs | 20 +- .../AllControls/AllControls/AllControls.fs | 6 +- .../CounterApp.Tests/CounterApp.Tests.fsproj | 21 + .../CounterApp/CounterApp.Tests/Program.fs | 7 + samples/CounterApp/CounterApp.Tests/Tests.fs | 121 + src/Fabulous.Core/Fabulous.Core.fsproj | 2 +- src/Fabulous.Core/ViewElement.fs | 6 + src/Fabulous.Core/ViewHelpers.fs | 40 - src/Fabulous.Core/Xamarin.Forms.Core.fs | 13206 ++++++++++------ .../CodeGeneratorPreparationTests.fs | 263 + tests/Generator.Tests/CodeGeneratorTests.fs | 459 +- tests/Generator.Tests/Generator.Tests.fsproj | 1 + tools/Generator/AssemblyResolver.fs | 10 +- tools/Generator/CodeGenerator.Models.fs | 94 + tools/Generator/CodeGenerator.Preparation.fs | 237 + tools/Generator/CodeGenerator.fs | 383 +- tools/Generator/Generator.fsproj | 2 + tools/Generator/Helpers.fs | 39 +- tools/Generator/Models.fs | 43 +- tools/Generator/Program.fs | 22 +- tools/Generator/Resolvers.fs | 296 +- tools/Generator/Xamarin.Forms.Core.json | 4 +- 32 files changed, 10346 insertions(+), 5212 deletions(-) create mode 100644 docs/testing.md create mode 100644 samples/CounterApp/CounterApp.Tests/CounterApp.Tests.fsproj create mode 100644 samples/CounterApp/CounterApp.Tests/Program.fs create mode 100644 samples/CounterApp/CounterApp.Tests/Tests.fs create mode 100644 tests/Generator.Tests/CodeGeneratorPreparationTests.fs create mode 100644 tools/Generator/CodeGenerator.Models.fs create mode 100644 tools/Generator/CodeGenerator.Preparation.fs diff --git a/build.fsx b/build.fsx index 543578887..786ebe3bc 100644 --- a/build.fsx +++ b/build.fsx @@ -169,6 +169,12 @@ Target.create "RunTests" (fun _ -> DotNet.test id testProject ) +Target.create "RunSamplesTests" (fun _ -> + let testProjects = !! "samples/**/*Tests.fsproj" + for testProject in testProjects do + DotNet.test id testProject +) + Target.create "TestTemplatesNuGet" (fun _ -> let restorePackageDotnetCli appName projectName pkgs = DotNet.exec id "restore" (sprintf "%s/%s/%s.fsproj --source https://api.nuget.org/v3/index.json --source %s" appName projectName projectName pkgs) |> ignore @@ -226,6 +232,7 @@ open Fake.Core.TargetOperators "Build" ==> "TestTemplatesNuGet" ==> "BuildSamples" + ==> "RunSamplesTests" ==> "Test" Target.runOrDefault "Build" diff --git a/docs/contents.md b/docs/contents.md index cf67de0f1..5e3096a42 100644 --- a/docs/contents.md +++ b/docs/contents.md @@ -4,5 +4,6 @@ * [Models](models.html) * [Update and Messages](update.html) * [Traces and Crashes](logging.html) +* [Unit testing](testing.html) * [Tools](tools.html) * [Further Resources](index.html#further-resources) diff --git a/docs/testing.md b/docs/testing.md new file mode 100644 index 000000000..616a22591 --- /dev/null +++ b/docs/testing.md @@ -0,0 +1,197 @@ +Fabulous - Guide +======= + +{% include_relative contents.md %} + +Testing +------ + +The Model-View-Update architecture used by Fabulous makes it simple to unit test every part of your application. +Apps are composed of 3 key pure F# functions: `init`, `update` and `view` +They take some parameters and return a value. Ideal for unit testing. + +### Testing `init` + +`init` is the easiest one to test. +It usually takes nothing and returns a value. + +Let's take this code for example: + +```fsharp +type Model = + { Count: int + Step: int } + +let init () = + { Count = 0; Step = 1 } +``` + +Here we can make sure that the default state stays exact throughout the life of the project. +So using our favorite unit test framework (here we use [FsUnit](https://fsprojects.github.io/FsUnit/) for this example), we can write a test that will check if the value returned by `init` is the one we expect. + +```fsharp +[] +let ``Init should return a valid initial state``() = + App.init () |> should equal { Count = 0; Step = 1 } +``` + +### Testing `update` + +`update` can be more complex but it remains a pure F# function. +Testing it is equivalent to what we just did with `init`. + +Let's take this code for example: + +```fsharp +type Model = + { Count: int + Step: int } + +type Msg = + | Increment + | Decrement + | Reset + +let update msg model = + match msg with + | Increment -> { model with Count = model.Count + model.Step } + | Decrement -> { model with Count = model.Count - model.Step } + | Reset -> { model with Count = 0; Step = 1 } +``` + +We can write the following tests: + +```fsharp +[] +let ``Given the message Increment, Update should increment Count by Step``() = + let initialModel = { Count = 5; Step = 4 } + let expectedModel = { Count = 9; Step = 4 } + App.update Increment initialModel |> should equal expectedModel + +[] +let ``Given the message Decrement, Update should decrement Count by Step``() = + let initialModel = { Count = 5; Step = 4 } + let expectedModel = { Count = 1; Step = 4 } + App.update Decrement initialModel |> should equal expectedModel + +[] +let ``Given the message Reset, Update should reset the state``() = + let initialModel = { Count = 5; Step = 4 } + let expectedModel = { Count = 0; Step = 1 } + App.update Reset initialModel |> should equal expectedModel +``` + +### Testing `init` and `update` when using `Cmd` + +You might have noticed the previous examples weren't using `Cmd`. +This is because `Cmd` can be complex to unit test and needs some further documentation on its own. + +#### Testing `Cmd.none` + +`Cmd.none` is an exception. It doesn't require anything special. +We can just compare it to itself + +```fsharp +let update msg model = + match msg with + | Increment -> { model with model.Count + 1 }, Cmd.none + + +[] +let ``Given the message Increment, Update should increment Count by 1``() = + let initialModel = { Count = 5 } + let expectedState = { Count = 6 }, Cmd.none // The expected state is a tuple of the model and a Cmd + App.update Increment initialModel |> should equal expectedState +``` + +#### Testing `Cmd`s + +TBA. See issues [#309](https://github.com/fsprojects/Fabulous/pull/309) and [#320](https://github.com/fsprojects/Fabulous/pull/320) + +### Testing view + +Views in Fabulous are testable as well, which makes it a clear advantage over more classic OOP frameworks (like C#/MVVM). +The `view` function returns a `ViewElement` value (which is a dictionary of attribute-value pairs). So we can check against that dictionary if we find the property we want, with the value we want. + +Unfortunately when creating a control through `View.XXX`, we lose the control's type and access to its properties. Fabulous creates a `ViewElement` which encapsulates all those data. + +In order to test in a safe way, Fabulous provides type-safe helpers for every controls from `Xamarin.Forms.Core`. +You can find them in the `Fabulous.DynamicViews` namespace. They are each named after the control they represent. + +Example: `StackLayoutViewer` will let you access the properties of a `StackLayout`. + +The Viewer only takes a `ViewElement` as a parameter. +(If you pass a `ViewElement` that represents a different control than the Viewer expects, the Viewer will throw an exception) + +Let's take this code for example: +```fsharp +let view (model: Model) dispatch = + View.ContentPage( + content=View.StackLayout( + children=[ + View.Label(text=sprintf "%d" model.Count) + View.Button(text="Increment", command=(fun () -> dispatch Increment)) + View.Button(text="Decrement", command=(fun () -> dispatch Decrement)) + View.StackLayout( + orientation=StackOrientation.Horizontal, + children=[ + View.Label(text="Timer") + View.Switch(isToggled=model.TimerOn, toggled=(fun on -> dispatch (TimerToggled on.Value))) + ]) + View.Slider(minimumMaximum=(0.0, 10.0), value=double model.Step, valueChanged=(fun args -> dispatch (SetStep (int args.NewValue)))) + View.Label(text=sprintf "Step size: %d" model.Step) + ])) +``` + +We want to make sure that if the state changes, the view will update accordingly. + +The first step is to call `view` with a given state and retrieve the generated `ViewElement`. +`view` is expecting a `dispatch` function as well. In our case, we don't need to test the dispatching of messages, so we pass the function `ignore` instead. + +From there, we create the Viewers to help us read the properties of the controls we want to check. + +And finally, we assert that the properties have the expected values. + +```fsharp +[] +let ``View should generate a valid interface``() = + let model = { Count = 5; Step = 4; TimerOn = true } + let actualView = App.view model ignore + + let contentPage = ContentPageViewer(actualView) + let stackLayout = StackLayoutViewer(contentPage.Content) + let countLabel = LabelViewer(stackLayout.Children.[0]) + let timerSwitch = SwitchViewer(StackLayoutViewer(stackLayout.Children.[3]).Children.[1]) + let stepSlider = SliderViewer(stackLayout.Children.[4]) + let stepSizeLabel = LabelViewer(stackLayout.Children.[5]) + + countLabel.Text |> should equal "5" + timerSwitch.IsToggled |> should equal true + stepSlider.Value |> should equal 4.0 + stepSizeLabel.Text |> should equal "Step size: 4" +``` + +### Testing if a control dispatches the correct message + +If you want to test your event handlers, you can retrieve them in the same way than a regular property. +Then, you can execute the event handler like a normal function and check its result through a mocked dispatch. + +```fsharp +[] +let ``Clicking the button Increment should send the message Increment``() = + let mockedDispatch msg = + msg |> should equal Increment + + let model = { Count = 5; Step = 4; TimerOn = true } + let actualView = App.view model mockedDispatch + + let contentPage = ContentPageViewer(actualView) + let stackLayout = StackLayoutViewer(contentPage.Content) + let incrementButton = ButtonViewer(stackLayout.Children.[1]) + + incrementButton.Command () +``` + + +### See also +- [CounterApp.Tests sample](https://github.com/fsprojects/Fabulous/tree/master/samples/CounterApp/CounterApp.Tests) \ No newline at end of file diff --git a/docs/views-elements.md b/docs/views-elements.md index 4ea0d2ae9..99aa58b5e 100644 --- a/docs/views-elements.md +++ b/docs/views-elements.md @@ -557,9 +557,9 @@ match confirm with | false -> (...) ``` -_Why don't we add an Fabulous wrapper for those?_ +_Why don't we add a Fabulous wrapper for those?_ Doing so would only end up duplicating the existing methods and compel us to maintain these in sync with Xamarin.Forms. -See https://github.com/fsprojects/Fabulous/pull/147 for more information +See [Pull Request #147](https://github.com/fsprojects/Fabulous/pull/147) for more information See also: diff --git a/docs/views-extending.md b/docs/views-extending.md index 31ffce54a..32e0cad86 100644 --- a/docs/views-extending.md +++ b/docs/views-extending.md @@ -26,7 +26,7 @@ collection property `Prop1` and one primitive property `Prop2`. (A collection property is a one that may contain further sub-elements, e.g. `children` for StackLayout, `gestureRecognizers` for any `View` and `pins` in the Maps example further below.) -An view element simply defines a static member that extends `Xaml` and returns a `ViewElement`. +An view element simply defines a static member that extends `View` and returns a `ViewElement`. The view element inherits attributes and update functionality from BASE via prototype inheritance. > **NOTE**: we are considering adding a code generator or type provider to automate this process, though the code is not complex to write. @@ -56,7 +56,7 @@ module MyViewExtensions = let attribCount = match prop2 with Some _ -> attribCount + 1 | None -> attribCount // Populate the attributes of the base element - let attribs = View._BuildBASE(attribCount, ... inherited attributes ... ) + let attribs = ViewBuilders.BuildBASE(attribCount, ... inherited attributes ... ) // Add our own attributes. match prop1 with None -> () | Some v -> attribs.Add (Prop1AttribKey, v) @@ -68,7 +68,7 @@ module MyViewExtensions = // The incremental update method let update (prev: ViewElement voption) (source: ViewElement) (target: ABC) = - View._UpdateBASE (prev, source, target) + ViewBuilders.UpdateBASE (prev, source, target) source.UpdateElementCollection (prev, rop1AttribKey, target.Prop1) source.UpdatePrimitive (prev, target, Prop2AttribKey, (fun target -> target.Prop2), (fun target v -> target.Prop2 <- v)) ... @@ -93,7 +93,7 @@ Sometimes it makes sense to "massage" the input values before storing them in at to a stored attribte value here: ```fsharp - match prop1 with None -> () | Some v -> attribs.Add(Prop1AttribKey, box (CONV v)) +match prop1 with None -> () | Some v -> attribs.Add(Prop1AttribKey, box (CONV v)) ``` It is common to mark view extensions as `inline`. This allows the F# compiler to create more optimized @@ -149,7 +149,7 @@ module MapsExtension = // Count and populate the inherited attributes let attribs = - View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, + ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, @@ -168,7 +168,7 @@ module MapsExtension = // The update method let update (prevOpt: ViewElement voption) (source: ViewElement) (target: Map) = - View.UpdateView(prevOpt, source, target) + ViewBuilders.UpdateView(prevOpt, source, target) source.UpdatePrimitive(prevOpt, target, MapHasScrollEnabledAttribKey, (fun target v -> target.HasScrollEnabled <- v)) source.UpdatePrimitive(prevOpt, target, MapHasZoomEnabledAttribKey, (fun target v -> target.HasZoomEnabled <- v)) source.UpdatePrimitive(prevOpt, target, MapIsShowingUserAttribKey, (fun target v -> target.IsShowingUser <- v)) @@ -212,7 +212,7 @@ In the above example, inherited properties from `View` (such as `margin` or `hor need not be added, you can set them on elements using the helper `With`, usable for all `View` properties: ```fsharp - View.Map(hasZoomEnabled = true, hasScrollEnabled = true).With(horizontalOptions = LayoutOptions.FillAndExpand) +View.Map(hasZoomEnabled = true, hasScrollEnabled = true).With(horizontalOptions = LayoutOptions.FillAndExpand) ``` See also: diff --git a/docs/views-maps.md b/docs/views-maps.md index 1904a2bc1..a0eef2999 100644 --- a/docs/views-maps.md +++ b/docs/views-maps.md @@ -6,18 +6,15 @@ Fabulous - Guide Using Maps ------ -The nuget `Fabulous.Maps` implements an [extension](views-extending.md) for the types [Map](https://docs.microsoft.com/dotnet/api/xamarin.forms.maps.map?view=xamarin-forms]) and +The nuget [`Fabulous.Maps`](https://www.nuget.org/packages/Fabulous.Maps) implements an [extension](views-extending.md) for the types [Map](https://docs.microsoft.com/dotnet/api/xamarin.forms.maps.map?view=xamarin-forms]) and [Pin](https://docs.microsoft.com/en-gb/dotnet/api/xamarin.forms.maps.pin?view=xamarin-forms). [![Maps example from Microsoft](https://user-images.githubusercontent.com/7204669/42186154-60437d42-7e43-11e8-805b-7200282f3b98.png)](https://user-images.githubusercontent.com/7204669/42186154-60437d42-7e43-11e8-805b-7200282f3b98.png) To use `Fabulous.Maps`, you must -1. Add a reference to `Xamarin.Forms.Maps` across your whole solution. This will add appropriate references to your platform-specific Android and iOS projects too. - > NOTE: At the time of writing some tooling made incorrect updates to targets/props in project files when adding these refereces. You may currently need - > to hand-edit your project files after this step. -2. Next add a reference to `Fabulous.Maps` across your whole solution. -3. Additionally [follow the instructions to initialize Xamarin.Forms Maps](https://docs.microsoft.com/xamarin/xamarin-forms/user-interface/map#Maps_Initialization). For example, on Android you must enable Google Play servies, add a call to `Xamarin.FormsMaps.Init(this, bundle)` to `MainActivity.fs` and add both and API key and `uses-permission` to `AndroidManifest.xml`. +1. Add a reference to `Fabulous.Maps` across your whole solution. +2. Additionally [follow the instructions to initialize Xamarin.Forms Maps](https://docs.microsoft.com/xamarin/xamarin-forms/user-interface/map#Maps_Initialization). For example, on Android you must enable Google Play servies, add a call to `Xamarin.FormsMaps.Init(this, bundle)` to `MainActivity.fs` and add both and API key and `uses-permission` to `AndroidManifest.xml`. After these steps you can use maps in your `view` function as follows: diff --git a/docs/views-oxyplot.md b/docs/views-oxyplot.md index 41d553d25..7b0da7614 100644 --- a/docs/views-oxyplot.md +++ b/docs/views-oxyplot.md @@ -9,7 +9,7 @@ Using OxyPlot Charts Below is an example of an extension for [OxyPlot](http://docs.oxyplot.org/). To use the extension: 1. Follow the instructions to [add references and initialize renderers](http://docs.oxyplot.org/en/latest/getting-started/hello-xamarin-forms.html) -2. Add a reference to the `Fabulous.OxyPlot` package across your solution. +2. Add a reference to the [`Fabulous.OxyPlot`](https://www.nuget.org/packages/Fabulous.OxyPlot) package across your solution. [![OxyPlot example](https://user-images.githubusercontent.com/7204669/42291878-777cb47c-7fc6-11e8-9eaa-4dfd784bddf2.png)](https://user-images.githubusercontent.com/7204669/42291878-777cb47c-7fc6-11e8-9eaa-4dfd784bddf2.png) diff --git a/docs/views-skiasharp.md b/docs/views-skiasharp.md index 83423fe91..102ba715e 100644 --- a/docs/views-skiasharp.md +++ b/docs/views-skiasharp.md @@ -8,7 +8,7 @@ Using SkiaSharp SkiaSharp is a 2D graphics system for .NET powered by the open-source Skia graphics engine that is used extensively in Google products. You can use SkiaSharp in your Xamarin.Forms applications to draw 2D vector graphics, bitmaps, and text. -The nuget `Fabulous.SkiaSharp` implements a view component for the type [SKCanvasView](https://developer.xamarin.com/api/type/SkiaSharp.Views.Forms.SKCanvasView/). +The nuget [`Fabulous.SkiaSharp`](https://www.nuget.org/packages/Fabulous.SkiaSharp) implements a view component for the type [SKCanvasView](https://developer.xamarin.com/api/type/SkiaSharp.Views.Forms.SKCanvasView/). [![SkiaSharp example from Microsoft](https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/graphics/skiasharp/curves/arcs-images/anglearc-small.png)](https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/graphics/skiasharp/curves/arcs-images/anglearc-small.png) diff --git a/extensions/Maps/Xamarin.Forms.Maps.fs b/extensions/Maps/Xamarin.Forms.Maps.fs index a19ad6b91..65bee08dc 100644 --- a/extensions/Maps/Xamarin.Forms.Maps.fs +++ b/extensions/Maps/Xamarin.Forms.Maps.fs @@ -42,15 +42,15 @@ module MapsExtension = // Count and populate the inherited attributes let attribs = - View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, - ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, - ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, - ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, - ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, - ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, - ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, - ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?classId=classId, ?styleId=styleId, - ?automationId=automationId, ?created=created, ?styleClass=styleClass) + ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, + ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, + ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, + ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, + ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, + ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?classId=classId, ?styleId=styleId, + ?automationId=automationId, ?created=created, ?styleClass=styleClass) // Add our own attributes. They must have unique names which must match the names below. match pins with None -> () | Some v -> attribs.Add(MapPinsAttribKey, v) @@ -62,7 +62,7 @@ module MapsExtension = // The update method let update (prevOpt: ViewElement voption) (source: ViewElement) (target: Map) = - View.UpdateView (prevOpt, source, target) + ViewBuilders.UpdateView (prevOpt, source, target) source.UpdatePrimitive(prevOpt, target, MapHasScrollEnabledAttribKey, (fun target v -> target.HasScrollEnabled <- v)) source.UpdatePrimitive(prevOpt, target, MapHasZoomEnabledAttribKey, (fun target v -> target.HasZoomEnabled <- v)) source.UpdatePrimitive(prevOpt, target, MapIsShowingUserAttribKey, (fun target v -> target.IsShowingUser <- v)) diff --git a/extensions/OxyPlot/OxyPlot.fs b/extensions/OxyPlot/OxyPlot.fs index 73635440a..f9dbeb528 100644 --- a/extensions/OxyPlot/OxyPlot.fs +++ b/extensions/OxyPlot/OxyPlot.fs @@ -31,15 +31,15 @@ module OxyPlotExtension = // Populate the attributes of the base element let attribs = - View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, - ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, - ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, - ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, - ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, - ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, - ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, - ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?classId=classId, ?styleId=styleId, - ?automationId=automationId, ?created=created, ?styleClass=styleClass) + ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, + ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, + ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, + ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, + ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, + ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?classId=classId, ?styleId=styleId, + ?automationId=automationId, ?created=created, ?styleClass=styleClass) // Add our own attributes. attribs.Add(ModelAttribKey, model) @@ -50,7 +50,7 @@ module OxyPlotExtension = // The update method let update (prevOpt: ViewElement voption) (source: ViewElement) (target: PlotView) = - View.UpdateView (prevOpt, source, target) + ViewBuilders.UpdateView (prevOpt, source, target) source.UpdatePrimitive(prevOpt, target, ModelAttribKey, (fun target v -> target.Model <- v)) source.UpdatePrimitive(prevOpt, target, ControllerAttribKey, (fun target v -> target.Controller <- v)) diff --git a/extensions/SkiaSharp/SkiaSharp.fs b/extensions/SkiaSharp/SkiaSharp.fs index bc6d5bd88..6928c8e51 100644 --- a/extensions/SkiaSharp/SkiaSharp.fs +++ b/extensions/SkiaSharp/SkiaSharp.fs @@ -34,15 +34,15 @@ module SkiaSharpExtension = // Populate the attributes of the base element let attribs = - View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, - ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, - ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, - ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, - ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, - ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, - ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, - ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?classId=classId, ?styleId=styleId, - ?automationId=automationId, ?created=created, ?styleClass=styleClass) + ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, + ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, + ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, + ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, + ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, + ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?classId=classId, ?styleId=styleId, + ?automationId=automationId, ?created=created, ?styleClass=styleClass) // Add our own attributes. They must have unique names which must match the names below. match enableTouchEvents with None -> () | Some v -> attribs.Add(CanvasEnableTouchEventsAttribKey, v) @@ -55,7 +55,7 @@ module SkiaSharpExtension = // The update method let update (prevOpt: ViewElement voption) (source: ViewElement) (target: SKCanvasView) = - View.UpdateView (prevOpt, source, target) + ViewBuilders.UpdateView (prevOpt, source, target) source.UpdatePrimitive(prevOpt, target, CanvasEnableTouchEventsAttribKey, (fun target v -> target.EnableTouchEvents <- v)) source.UpdatePrimitive(prevOpt, target, IgnorePixelScalingAttribKey, (fun target v -> target.IgnorePixelScaling <- v)) source.UpdateEvent(prevOpt, PaintSurfaceAttribKey, target.PaintSurface) diff --git a/samples/AllControls/AllControls/AllControls.fs b/samples/AllControls/AllControls/AllControls.fs index fd51c050c..580c845c7 100644 --- a/samples/AllControls/AllControls/AllControls.fs +++ b/samples/AllControls/AllControls/AllControls.fs @@ -116,12 +116,12 @@ module MyExtension = static member TestLabel(?text: string, ?fontFamily: string, ?backgroundColor, ?rotation) = - // Get the attributes for the base element. The number is the the expected number of attributes. + // Get the attributes for the base element. The number is the expected number of attributes. // You can add additional base element attributes here if you like let attribCount = 0 let attribCount = match text with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match fontFamily with Some _ -> attribCount + 1 | None -> attribCount - let attribs = View.BuildView(attribCount, ?backgroundColor = backgroundColor, ?rotation = rotation) + let attribs = ViewBuilders.BuildView(attribCount, ?backgroundColor = backgroundColor, ?rotation = rotation) // Add our own attributes. They must have unique names. match text with None -> () | Some v -> attribs.Add(TestLabelTextAttribKey, v) @@ -132,7 +132,7 @@ module MyExtension = // The incremental update method let update (prevOpt: ViewElement voption) (source: ViewElement) (target: Xamarin.Forms.Label) = - View.UpdateView(prevOpt, source, target) + ViewBuilders.UpdateView(prevOpt, source, target) source.UpdatePrimitive(prevOpt, target, TestLabelTextAttribKey, (fun target v -> target.Text <- v)) source.UpdatePrimitive(prevOpt, target, TestLabelFontFamilyAttribKey, (fun target v -> target.FontFamily <- v)) diff --git a/samples/CounterApp/CounterApp.Tests/CounterApp.Tests.fsproj b/samples/CounterApp/CounterApp.Tests/CounterApp.Tests.fsproj new file mode 100644 index 000000000..1a08439c1 --- /dev/null +++ b/samples/CounterApp/CounterApp.Tests/CounterApp.Tests.fsproj @@ -0,0 +1,21 @@ + + + netcoreapp2.1 + Library + false + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/CounterApp/CounterApp.Tests/Program.fs b/samples/CounterApp/CounterApp.Tests/Program.fs new file mode 100644 index 000000000..c56046bdb --- /dev/null +++ b/samples/CounterApp/CounterApp.Tests/Program.fs @@ -0,0 +1,7 @@ +// Copyright 2018 Fabulous contributors. See LICENSE.md for license. +namespace CounterApp.Tests + +module Program = + [] + let main (argv: string[]) = + 0 \ No newline at end of file diff --git a/samples/CounterApp/CounterApp.Tests/Tests.fs b/samples/CounterApp/CounterApp.Tests/Tests.fs new file mode 100644 index 000000000..160ff76a0 --- /dev/null +++ b/samples/CounterApp/CounterApp.Tests/Tests.fs @@ -0,0 +1,121 @@ +// Copyright 2018 Fabulous contributors. See LICENSE.md for license. +namespace CounterApp.Tests + +open NUnit.Framework +open FsUnit +open CounterApp +open CounterApp.App +open Fabulous.Core +open Fabulous.DynamicViews + +module ``Init tests`` = + [] + let ``Init should return a valid initial state``() = + let initialState = { Count = 0; Step = 1; TimerOn = false }, Cmd.none + App.init () |> should equal initialState + +module ``Update tests`` = + [] + let ``Given the message Increment, Update should increment Count using Step``() = + let initialModel = { Count = 5; Step = 4; TimerOn = false } + let expectedState = { Count = 9; Step = 4; TimerOn = false }, Cmd.none + App.update Increment initialModel |> should equal expectedState + + [] + let ``Given the message Decrement, Update should decrement Count using Step``() = + let initialModel = { Count = 5; Step = 4; TimerOn = false } + let expectedState = { Count = 1; Step = 4; TimerOn = false }, Cmd.none + App.update Decrement initialModel |> should equal expectedState + + [] + let ``Given the message Reset, Update should reset the state``() = + let initialModel = { Count = 5; Step = 4; TimerOn = false } + let expectedState = { Count = 0; Step = 1; TimerOn = false }, Cmd.none + App.update Reset initialModel |> should equal expectedState + + [] + let ``Given the message SetStep, Update should change the Step with the given value``() = + let initialModel = { Count = 5; Step = 4; TimerOn = false } + let expectedState = { Count = 5; Step = 12; TimerOn = false }, Cmd.none + App.update (SetStep 12) initialModel |> should equal expectedState + + [] + let ``Given the message TimerToggled false, Update should disable the timer``() = + let initialModel = { Count = 5; Step = 4; TimerOn = true } + let expectedState = { Count = 5; Step = 4; TimerOn = false }, Cmd.none + App.update (TimerToggled false) initialModel |> should equal expectedState + + [] + let ``Given the message TimerToggled true, Update should enable the timer and return a new TimerCmd``() = + let initialModel = { Count = 5; Step = 4; TimerOn = false } + let expectedModel = { Count = 5; Step = 4; TimerOn = true } + let expectedCommandMsg = [ TimedTick ] + + let actualModel, actualCmd = App.update (TimerToggled true) initialModel + //let actualCommandMsg = execute actualCmd + + actualModel |> should equal expectedModel + //actualCommandMsg |> should equal expectedCommandMsg + + [] + let ``Given the message TimedTick and the timer is still on, Update should increment Count using Step and return a new TimerCmd``() = + let initialModel = { Count = 5; Step = 4; TimerOn = true } + let expectedModel = { Count = 9; Step = 4; TimerOn = true } + let expectedCommandMsg = [ TimedTick ] + + let actualModel, actualCmd = App.update TimedTick initialModel + //let actualCommandMsg = execute actualCmd + + actualModel |> should equal expectedModel + //actualCommandMsg |> should equal expectedCommandMsg + + [] + let ``Given the message TimedTick and the timer is off, Update should do nothing``() = + let initialModel = { Count = 5; Step = 4; TimerOn = false } + let expectedState = { Count = 5; Step = 4; TimerOn = false }, Cmd.none + App.update TimedTick initialModel |> should equal expectedState + +module ``View tests`` = + [] + let ``View should generate a valid interface``() = + let model = { Count = 5; Step = 4; TimerOn = true } + let actualView = App.view model ignore + + let stackLayout = StackLayoutViewer(ContentPageViewer(actualView).Content) + let countLabel = LabelViewer(stackLayout.Children.[0]) + let timerSwitch = SwitchViewer(StackLayoutViewer(stackLayout.Children.[3]).Children.[1]) + let stepSlider = SliderViewer(stackLayout.Children.[4]) + let stepSizeLabel = LabelViewer(stackLayout.Children.[5]) + + countLabel.Text |> should equal "5" + timerSwitch.IsToggled |> should equal true + stepSlider.Value |> should equal 4.0 + stepSizeLabel.Text |> should equal "Step size: 4" + + [] + let ``Clicking the button Increment should send the message Increment``() = + let mockedDispatch msg = + msg |> should equal Increment + + let model = { Count = 5; Step = 4; TimerOn = true } + let actualView = App.view model mockedDispatch + + let contentPage = ContentPageViewer(actualView) + let stackLayout = StackLayoutViewer(contentPage.Content) + let incrementButton = ButtonViewer(stackLayout.Children.[1]) + + incrementButton.Command () + + [] + let ``Clicking the button Decrement should send the message Decrement``() = + let mockedDispatch msg = + msg |> should equal Decrement + + let model = { Count = 5; Step = 4; TimerOn = true } + let actualView = App.view model mockedDispatch + + let contentPage = ContentPageViewer(actualView) + let stackLayout = StackLayoutViewer(contentPage.Content) + let decrementButton = ButtonViewer(stackLayout.Children.[2]) + + decrementButton.Command () \ No newline at end of file diff --git a/src/Fabulous.Core/Fabulous.Core.fsproj b/src/Fabulous.Core/Fabulous.Core.fsproj index 250d95bbb..59d8b936d 100644 --- a/src/Fabulous.Core/Fabulous.Core.fsproj +++ b/src/Fabulous.Core/Fabulous.Core.fsproj @@ -10,8 +10,8 @@ - + diff --git a/src/Fabulous.Core/ViewElement.fs b/src/Fabulous.Core/ViewElement.fs index 877655f82..338550ab3 100644 --- a/src/Fabulous.Core/ViewElement.fs +++ b/src/Fabulous.Core/ViewElement.fs @@ -73,6 +73,12 @@ type ViewElement internal (targetType: Type, create: (unit -> obj), update: (Vie member x.TryGetAttribute<'T>(name: string) = x.TryGetAttributeKeyed<'T>(AttributeKey<'T> name) + /// Get an attribute of the visual element + member x.GetAttributeKeyed<'T>(key: AttributeKey<'T>) = + match attribs |> Array.tryFind (fun kvp -> kvp.Key = key.KeyValue) with + | Some kvp -> unbox<'T>(kvp.Value) + | None -> failwithf "Property '%s' does not exist on %s" key.Name x.TargetType.Name + /// Apply initial settings to a freshly created visual element member x.Update (target: obj) = update ValueNone x target diff --git a/src/Fabulous.Core/ViewHelpers.fs b/src/Fabulous.Core/ViewHelpers.fs index 6e3313c05..5a9d9438e 100644 --- a/src/Fabulous.Core/ViewHelpers.fs +++ b/src/Fabulous.Core/ViewHelpers.fs @@ -7,9 +7,6 @@ open System.Collections.Generic open System.Threading open Xamarin.Forms -[] -type Xaml = Fabulous.DynamicViews.View - [] module SimplerHelpers = type internal Memoizations() = @@ -94,43 +91,6 @@ module SimplerHelpers = false // Do not let the timer trigger a second time )) - type ViewElement with - member x.With(?horizontalOptions: Xamarin.Forms.LayoutOptions, ?verticalOptions: Xamarin.Forms.LayoutOptions, ?margin: obj, ?gestureRecognizers: ViewElement list, - ?anchorX: double, ?anchorY: double, ?backgroundColor: Xamarin.Forms.Color, ?heightRequest: double, ?inputTransparent: bool, - ?isEnabled: bool, ?isVisible: bool, ?minimumHeightRequest: double, ?minimumWidthRequest: double, ?opacity: double, - ?rotation: double, ?rotationX: double, ?rotationY: double, ?scale: double, ?style: Xamarin.Forms.Style, - ?translationX: double, ?translationY: double, ?widthRequest: double, ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, ?classId: string, ?styleId: string) = - let x = match horizontalOptions with None -> x | Some opt -> x.HorizontalOptions(opt) - let x = match verticalOptions with None -> x | Some opt -> x.VerticalOptions(opt) - let x = match margin with None -> x | Some opt -> x.Margin(opt) - let x = match gestureRecognizers with None -> x | Some opt -> x.GestureRecognizers(opt) - let x = match anchorX with None -> x | Some opt -> x.AnchorX(opt) - let x = match anchorY with None -> x | Some opt -> x.AnchorY(opt) - let x = match backgroundColor with None -> x | Some opt -> x.BackgroundColor(opt) - let x = match heightRequest with None -> x | Some opt -> x.HeightRequest(opt) - let x = match inputTransparent with None -> x | Some opt -> x.InputTransparent(opt) - let x = match isEnabled with None -> x | Some opt -> x.IsEnabled(opt) - let x = match isVisible with None -> x | Some opt -> x.IsVisible(opt) - let x = match minimumHeightRequest with None -> x | Some opt -> x.MinimumHeightRequest(opt) - let x = match minimumWidthRequest with None -> x | Some opt -> x.MinimumWidthRequest(opt) - let x = match opacity with None -> x | Some opt -> x.Opacity(opt) - let x = match rotation with None -> x | Some opt -> x.Rotation(opt) - let x = match rotationX with None -> x | Some opt -> x.RotationX(opt) - let x = match rotationY with None -> x | Some opt -> x.RotationY(opt) - let x = match scale with None -> x | Some opt -> x.Scale(opt) - let x = match style with None -> x | Some opt -> x.Style(opt) - let x = match translationX with None -> x | Some opt -> x.TranslationX(opt) - let x = match translationY with None -> x | Some opt -> x.TranslationY(opt) - let x = match widthRequest with None -> x | Some opt -> x.WidthRequest(opt) - let x = match resources with None -> x | Some opt -> x.Resources(opt) - let x = match styles with None -> x | Some opt -> x.Styles(opt) - let x = match styleSheets with None -> x | Some opt -> x.StyleSheets(opt) - let x = match styleSheets with None -> x | Some opt -> x.StyleSheets(opt) - let x = match classId with None -> x | Some opt -> x.ClassId(opt) - let x = match styleId with None -> x | Some opt -> x.StyleId(opt) - x - let ContentsAttribKey = AttributeKey<(obj -> ViewElement)> "Stateful_Contents" let localStateTable = System.Runtime.CompilerServices.ConditionalWeakTable() diff --git a/src/Fabulous.Core/Xamarin.Forms.Core.fs b/src/Fabulous.Core/Xamarin.Forms.Core.fs index e9ff71fc2..1737c0849 100644 --- a/src/Fabulous.Core/Xamarin.Forms.Core.fs +++ b/src/Fabulous.Core/Xamarin.Forms.Core.fs @@ -5,477 +5,303 @@ namespace Fabulous.DynamicViews #nowarn "66" // cast always holds #nowarn "67" // cast always holds -type View() = - - [] - static member val _ClassIdAttribKey : AttributeKey<_> = AttributeKey<_>("ClassId") - [] - static member val _StyleIdAttribKey : AttributeKey<_> = AttributeKey<_>("StyleId") - [] - static member val _AutomationIdAttribKey : AttributeKey<_> = AttributeKey<_>("AutomationId") - [] - static member val _ElementCreatedAttribKey : AttributeKey<_> = AttributeKey<_>("ElementCreated") - [] - static member val _ElementViewRefAttribKey : AttributeKey<_> = AttributeKey<_>("ElementViewRef") - [] - static member val _AnchorXAttribKey : AttributeKey<_> = AttributeKey<_>("AnchorX") - [] - static member val _AnchorYAttribKey : AttributeKey<_> = AttributeKey<_>("AnchorY") - [] - static member val _BackgroundColorAttribKey : AttributeKey<_> = AttributeKey<_>("BackgroundColor") - [] - static member val _HeightRequestAttribKey : AttributeKey<_> = AttributeKey<_>("HeightRequest") - [] - static member val _InputTransparentAttribKey : AttributeKey<_> = AttributeKey<_>("InputTransparent") - [] - static member val _IsEnabledAttribKey : AttributeKey<_> = AttributeKey<_>("IsEnabled") - [] - static member val _IsVisibleAttribKey : AttributeKey<_> = AttributeKey<_>("IsVisible") - [] - static member val _MinimumHeightRequestAttribKey : AttributeKey<_> = AttributeKey<_>("MinimumHeightRequest") - [] - static member val _MinimumWidthRequestAttribKey : AttributeKey<_> = AttributeKey<_>("MinimumWidthRequest") - [] - static member val _OpacityAttribKey : AttributeKey<_> = AttributeKey<_>("Opacity") - [] - static member val _RotationAttribKey : AttributeKey<_> = AttributeKey<_>("Rotation") - [] - static member val _RotationXAttribKey : AttributeKey<_> = AttributeKey<_>("RotationX") - [] - static member val _RotationYAttribKey : AttributeKey<_> = AttributeKey<_>("RotationY") - [] - static member val _ScaleAttribKey : AttributeKey<_> = AttributeKey<_>("Scale") - [] - static member val _StyleAttribKey : AttributeKey<_> = AttributeKey<_>("Style") - [] - static member val _StyleClassAttribKey : AttributeKey<_> = AttributeKey<_>("StyleClass") - [] - static member val _TranslationXAttribKey : AttributeKey<_> = AttributeKey<_>("TranslationX") - [] - static member val _TranslationYAttribKey : AttributeKey<_> = AttributeKey<_>("TranslationY") - [] - static member val _WidthRequestAttribKey : AttributeKey<_> = AttributeKey<_>("WidthRequest") - [] - static member val _ResourcesAttribKey : AttributeKey<_> = AttributeKey<_>("Resources") - [] - static member val _StylesAttribKey : AttributeKey<_> = AttributeKey<_>("Styles") - [] - static member val _StyleSheetsAttribKey : AttributeKey<_> = AttributeKey<_>("StyleSheets") - [] - static member val _IsTabStopAttribKey : AttributeKey<_> = AttributeKey<_>("IsTabStop") - [] - static member val _ScaleXAttribKey : AttributeKey<_> = AttributeKey<_>("ScaleX") - [] - static member val _ScaleYAttribKey : AttributeKey<_> = AttributeKey<_>("ScaleY") - [] - static member val _TabIndexAttribKey : AttributeKey<_> = AttributeKey<_>("TabIndex") - [] - static member val _HorizontalOptionsAttribKey : AttributeKey<_> = AttributeKey<_>("HorizontalOptions") - [] - static member val _VerticalOptionsAttribKey : AttributeKey<_> = AttributeKey<_>("VerticalOptions") - [] - static member val _MarginAttribKey : AttributeKey<_> = AttributeKey<_>("Margin") - [] - static member val _GestureRecognizersAttribKey : AttributeKey<_> = AttributeKey<_>("GestureRecognizers") - [] - static member val _TouchPointsAttribKey : AttributeKey<_> = AttributeKey<_>("TouchPoints") - [] - static member val _PanUpdatedAttribKey : AttributeKey<_> = AttributeKey<_>("PanUpdated") - [] - static member val _CommandAttribKey : AttributeKey<_> = AttributeKey<_>("Command") - [] - static member val _NumberOfTapsRequiredAttribKey : AttributeKey<_> = AttributeKey<_>("NumberOfTapsRequired") - [] - static member val _NumberOfClicksRequiredAttribKey : AttributeKey<_> = AttributeKey<_>("NumberOfClicksRequired") - [] - static member val _ButtonsAttribKey : AttributeKey<_> = AttributeKey<_>("Buttons") - [] - static member val _IsPinchingAttribKey : AttributeKey<_> = AttributeKey<_>("IsPinching") - [] - static member val _PinchUpdatedAttribKey : AttributeKey<_> = AttributeKey<_>("PinchUpdated") - [] - static member val _SwipeGestureRecognizerDirectionAttribKey : AttributeKey<_> = AttributeKey<_>("SwipeGestureRecognizerDirection") - [] - static member val _ThresholdAttribKey : AttributeKey<_> = AttributeKey<_>("Threshold") - [] - static member val _SwipedAttribKey : AttributeKey<_> = AttributeKey<_>("Swiped") - [] - static member val _ColorAttribKey : AttributeKey<_> = AttributeKey<_>("Color") - [] - static member val _IsRunningAttribKey : AttributeKey<_> = AttributeKey<_>("IsRunning") - [] - static member val _BoxViewCornerRadiusAttribKey : AttributeKey<_> = AttributeKey<_>("BoxViewCornerRadius") - [] - static member val _ProgressAttribKey : AttributeKey<_> = AttributeKey<_>("Progress") - [] - static member val _IsClippedToBoundsAttribKey : AttributeKey<_> = AttributeKey<_>("IsClippedToBounds") - [] - static member val _PaddingAttribKey : AttributeKey<_> = AttributeKey<_>("Padding") - [] - static member val _ContentAttribKey : AttributeKey<_> = AttributeKey<_>("Content") - [] - static member val _ScrollOrientationAttribKey : AttributeKey<_> = AttributeKey<_>("ScrollOrientation") - [] - static member val _HorizontalScrollBarVisibilityAttribKey : AttributeKey<_> = AttributeKey<_>("HorizontalScrollBarVisibility") - [] - static member val _VerticalScrollBarVisibilityAttribKey : AttributeKey<_> = AttributeKey<_>("VerticalScrollBarVisibility") - [] - static member val _CancelButtonColorAttribKey : AttributeKey<_> = AttributeKey<_>("CancelButtonColor") - [] - static member val _FontFamilyAttribKey : AttributeKey<_> = AttributeKey<_>("FontFamily") - [] - static member val _FontAttributesAttribKey : AttributeKey<_> = AttributeKey<_>("FontAttributes") - [] - static member val _FontSizeAttribKey : AttributeKey<_> = AttributeKey<_>("FontSize") - [] - static member val _HorizontalTextAlignmentAttribKey : AttributeKey<_> = AttributeKey<_>("HorizontalTextAlignment") - [] - static member val _PlaceholderAttribKey : AttributeKey<_> = AttributeKey<_>("Placeholder") - [] - static member val _PlaceholderColorAttribKey : AttributeKey<_> = AttributeKey<_>("PlaceholderColor") - [] - static member val _SearchBarCommandAttribKey : AttributeKey<_> = AttributeKey<_>("SearchBarCommand") - [] - static member val _SearchBarCanExecuteAttribKey : AttributeKey<_> = AttributeKey<_>("SearchBarCanExecute") - [] - static member val _TextAttribKey : AttributeKey<_> = AttributeKey<_>("Text") - [] - static member val _TextColorAttribKey : AttributeKey<_> = AttributeKey<_>("TextColor") - [] - static member val _SearchBarTextChangedAttribKey : AttributeKey<_> = AttributeKey<_>("SearchBarTextChanged") - [] - static member val _ButtonCommandAttribKey : AttributeKey<_> = AttributeKey<_>("ButtonCommand") - [] - static member val _ButtonCanExecuteAttribKey : AttributeKey<_> = AttributeKey<_>("ButtonCanExecute") - [] - static member val _BorderColorAttribKey : AttributeKey<_> = AttributeKey<_>("BorderColor") - [] - static member val _BorderWidthAttribKey : AttributeKey<_> = AttributeKey<_>("BorderWidth") - [] - static member val _CommandParameterAttribKey : AttributeKey<_> = AttributeKey<_>("CommandParameter") - [] - static member val _ContentLayoutAttribKey : AttributeKey<_> = AttributeKey<_>("ContentLayout") - [] - static member val _ButtonCornerRadiusAttribKey : AttributeKey<_> = AttributeKey<_>("ButtonCornerRadius") - [] - static member val _ButtonImageSourceAttribKey : AttributeKey<_> = AttributeKey<_>("ButtonImageSource") - [] - static member val _MinimumMaximumAttribKey : AttributeKey<_> = AttributeKey<_>("MinimumMaximum") - [] - static member val _ValueAttribKey : AttributeKey<_> = AttributeKey<_>("Value") - [] - static member val _ValueChangedAttribKey : AttributeKey<_> = AttributeKey<_>("ValueChanged") - [] - static member val _IncrementAttribKey : AttributeKey<_> = AttributeKey<_>("Increment") - [] - static member val _IsToggledAttribKey : AttributeKey<_> = AttributeKey<_>("IsToggled") - [] - static member val _ToggledAttribKey : AttributeKey<_> = AttributeKey<_>("Toggled") - [] - static member val _OnColorAttribKey : AttributeKey<_> = AttributeKey<_>("OnColor") - [] - static member val _HeightAttribKey : AttributeKey<_> = AttributeKey<_>("Height") - [] - static member val _OnAttribKey : AttributeKey<_> = AttributeKey<_>("On") - [] - static member val _OnChangedAttribKey : AttributeKey<_> = AttributeKey<_>("OnChanged") - [] - static member val _IntentAttribKey : AttributeKey<_> = AttributeKey<_>("Intent") - [] - static member val _HasUnevenRowsAttribKey : AttributeKey<_> = AttributeKey<_>("HasUnevenRows") - [] - static member val _RowHeightAttribKey : AttributeKey<_> = AttributeKey<_>("RowHeight") - [] - static member val _TableRootAttribKey : AttributeKey<_> = AttributeKey<_>("TableRoot") - [] - static member val _RowDefinitionHeightAttribKey : AttributeKey<_> = AttributeKey<_>("RowDefinitionHeight") - [] - static member val _ColumnDefinitionWidthAttribKey : AttributeKey<_> = AttributeKey<_>("ColumnDefinitionWidth") - [] - static member val _GridRowDefinitionsAttribKey : AttributeKey<_> = AttributeKey<_>("GridRowDefinitions") - [] - static member val _GridColumnDefinitionsAttribKey : AttributeKey<_> = AttributeKey<_>("GridColumnDefinitions") - [] - static member val _RowSpacingAttribKey : AttributeKey<_> = AttributeKey<_>("RowSpacing") - [] - static member val _ColumnSpacingAttribKey : AttributeKey<_> = AttributeKey<_>("ColumnSpacing") - [] - static member val _ChildrenAttribKey : AttributeKey<_> = AttributeKey<_>("Children") - [] - static member val _GridRowAttribKey : AttributeKey<_> = AttributeKey<_>("GridRow") - [] - static member val _GridRowSpanAttribKey : AttributeKey<_> = AttributeKey<_>("GridRowSpan") - [] - static member val _GridColumnAttribKey : AttributeKey<_> = AttributeKey<_>("GridColumn") - [] - static member val _GridColumnSpanAttribKey : AttributeKey<_> = AttributeKey<_>("GridColumnSpan") - [] - static member val _LayoutBoundsAttribKey : AttributeKey<_> = AttributeKey<_>("LayoutBounds") - [] - static member val _LayoutFlagsAttribKey : AttributeKey<_> = AttributeKey<_>("LayoutFlags") - [] - static member val _BoundsConstraintAttribKey : AttributeKey<_> = AttributeKey<_>("BoundsConstraint") - [] - static member val _HeightConstraintAttribKey : AttributeKey<_> = AttributeKey<_>("HeightConstraint") - [] - static member val _WidthConstraintAttribKey : AttributeKey<_> = AttributeKey<_>("WidthConstraint") - [] - static member val _XConstraintAttribKey : AttributeKey<_> = AttributeKey<_>("XConstraint") - [] - static member val _YConstraintAttribKey : AttributeKey<_> = AttributeKey<_>("YConstraint") - [] - static member val _AlignContentAttribKey : AttributeKey<_> = AttributeKey<_>("AlignContent") - [] - static member val _AlignItemsAttribKey : AttributeKey<_> = AttributeKey<_>("AlignItems") - [] - static member val _FlexLayoutDirectionAttribKey : AttributeKey<_> = AttributeKey<_>("FlexLayoutDirection") - [] - static member val _PositionAttribKey : AttributeKey<_> = AttributeKey<_>("Position") - [] - static member val _WrapAttribKey : AttributeKey<_> = AttributeKey<_>("Wrap") - [] - static member val _JustifyContentAttribKey : AttributeKey<_> = AttributeKey<_>("JustifyContent") - [] - static member val _FlexAlignSelfAttribKey : AttributeKey<_> = AttributeKey<_>("FlexAlignSelf") - [] - static member val _FlexOrderAttribKey : AttributeKey<_> = AttributeKey<_>("FlexOrder") - [] - static member val _FlexBasisAttribKey : AttributeKey<_> = AttributeKey<_>("FlexBasis") - [] - static member val _FlexGrowAttribKey : AttributeKey<_> = AttributeKey<_>("FlexGrow") - [] - static member val _FlexShrinkAttribKey : AttributeKey<_> = AttributeKey<_>("FlexShrink") - [] - static member val _DateAttribKey : AttributeKey<_> = AttributeKey<_>("Date") - [] - static member val _FormatAttribKey : AttributeKey<_> = AttributeKey<_>("Format") - [] - static member val _MinimumDateAttribKey : AttributeKey<_> = AttributeKey<_>("MinimumDate") - [] - static member val _MaximumDateAttribKey : AttributeKey<_> = AttributeKey<_>("MaximumDate") - [] - static member val _DateSelectedAttribKey : AttributeKey<_> = AttributeKey<_>("DateSelected") - [] - static member val _PickerItemsSourceAttribKey : AttributeKey<_> = AttributeKey<_>("PickerItemsSource") - [] - static member val _SelectedIndexAttribKey : AttributeKey<_> = AttributeKey<_>("SelectedIndex") - [] - static member val _TitleAttribKey : AttributeKey<_> = AttributeKey<_>("Title") - [] - static member val _SelectedIndexChangedAttribKey : AttributeKey<_> = AttributeKey<_>("SelectedIndexChanged") - [] - static member val _FrameCornerRadiusAttribKey : AttributeKey<_> = AttributeKey<_>("FrameCornerRadius") - [] - static member val _HasShadowAttribKey : AttributeKey<_> = AttributeKey<_>("HasShadow") - [] - static member val _ImageSourceAttribKey : AttributeKey<_> = AttributeKey<_>("ImageSource") - [] - static member val _AspectAttribKey : AttributeKey<_> = AttributeKey<_>("Aspect") - [] - static member val _IsOpaqueAttribKey : AttributeKey<_> = AttributeKey<_>("IsOpaque") - [] - static member val _ImageButtonCommandAttribKey : AttributeKey<_> = AttributeKey<_>("ImageButtonCommand") - [] - static member val _ImageButtonCornerRadiusAttribKey : AttributeKey<_> = AttributeKey<_>("ImageButtonCornerRadius") - [] - static member val _ClickedAttribKey : AttributeKey<_> = AttributeKey<_>("Clicked") - [] - static member val _PressedAttribKey : AttributeKey<_> = AttributeKey<_>("Pressed") - [] - static member val _ReleasedAttribKey : AttributeKey<_> = AttributeKey<_>("Released") - [] - static member val _KeyboardAttribKey : AttributeKey<_> = AttributeKey<_>("Keyboard") - [] - static member val _EditorCompletedAttribKey : AttributeKey<_> = AttributeKey<_>("EditorCompleted") - [] - static member val _TextChangedAttribKey : AttributeKey<_> = AttributeKey<_>("TextChanged") - [] - static member val _AutoSizeAttribKey : AttributeKey<_> = AttributeKey<_>("AutoSize") - [] - static member val _IsPasswordAttribKey : AttributeKey<_> = AttributeKey<_>("IsPassword") - [] - static member val _EntryCompletedAttribKey : AttributeKey<_> = AttributeKey<_>("EntryCompleted") - [] - static member val _IsTextPredictionEnabledAttribKey : AttributeKey<_> = AttributeKey<_>("IsTextPredictionEnabled") - [] - static member val _ReturnTypeAttribKey : AttributeKey<_> = AttributeKey<_>("ReturnType") - [] - static member val _ReturnCommandAttribKey : AttributeKey<_> = AttributeKey<_>("ReturnCommand") - [] - static member val _CursorPositionAttribKey : AttributeKey<_> = AttributeKey<_>("CursorPosition") - [] - static member val _SelectionLengthAttribKey : AttributeKey<_> = AttributeKey<_>("SelectionLength") - [] - static member val _LabelAttribKey : AttributeKey<_> = AttributeKey<_>("Label") - [] - static member val _EntryCellTextChangedAttribKey : AttributeKey<_> = AttributeKey<_>("EntryCellTextChanged") - [] - static member val _VerticalTextAlignmentAttribKey : AttributeKey<_> = AttributeKey<_>("VerticalTextAlignment") - [] - static member val _FormattedTextAttribKey : AttributeKey<_> = AttributeKey<_>("FormattedText") - [] - static member val _LineBreakModeAttribKey : AttributeKey<_> = AttributeKey<_>("LineBreakMode") - [] - static member val _LineHeightAttribKey : AttributeKey<_> = AttributeKey<_>("LineHeight") - [] - static member val _MaxLinesAttribKey : AttributeKey<_> = AttributeKey<_>("MaxLines") - [] - static member val _TextDecorationsAttribKey : AttributeKey<_> = AttributeKey<_>("TextDecorations") - [] - static member val _StackOrientationAttribKey : AttributeKey<_> = AttributeKey<_>("StackOrientation") - [] - static member val _SpacingAttribKey : AttributeKey<_> = AttributeKey<_>("Spacing") - [] - static member val _ForegroundColorAttribKey : AttributeKey<_> = AttributeKey<_>("ForegroundColor") - [] - static member val _PropertyChangedAttribKey : AttributeKey<_> = AttributeKey<_>("PropertyChanged") - [] - static member val _SpansAttribKey : AttributeKey<_> = AttributeKey<_>("Spans") - [] - static member val _TimeAttribKey : AttributeKey<_> = AttributeKey<_>("Time") - [] - static member val _WebSourceAttribKey : AttributeKey<_> = AttributeKey<_>("WebSource") - [] - static member val _ReloadAttribKey : AttributeKey<_> = AttributeKey<_>("Reload") - [] - static member val _NavigatedAttribKey : AttributeKey<_> = AttributeKey<_>("Navigated") - [] - static member val _NavigatingAttribKey : AttributeKey<_> = AttributeKey<_>("Navigating") - [] - static member val _ReloadRequestedAttribKey : AttributeKey<_> = AttributeKey<_>("ReloadRequested") - [] - static member val _BackgroundImageAttribKey : AttributeKey<_> = AttributeKey<_>("BackgroundImage") - [] - static member val _IconAttribKey : AttributeKey<_> = AttributeKey<_>("Icon") - [] - static member val _IsBusyAttribKey : AttributeKey<_> = AttributeKey<_>("IsBusy") - [] - static member val _ToolbarItemsAttribKey : AttributeKey<_> = AttributeKey<_>("ToolbarItems") - [] - static member val _UseSafeAreaAttribKey : AttributeKey<_> = AttributeKey<_>("UseSafeArea") - [] - static member val _Page_AppearingAttribKey : AttributeKey<_> = AttributeKey<_>("Page_Appearing") - [] - static member val _Page_DisappearingAttribKey : AttributeKey<_> = AttributeKey<_>("Page_Disappearing") - [] - static member val _Page_LayoutChangedAttribKey : AttributeKey<_> = AttributeKey<_>("Page_LayoutChanged") - [] - static member val _CarouselPage_CurrentPageAttribKey : AttributeKey<_> = AttributeKey<_>("CarouselPage_CurrentPage") - [] - static member val _CarouselPage_CurrentPageChangedAttribKey : AttributeKey<_> = AttributeKey<_>("CarouselPage_CurrentPageChanged") - [] - static member val _PagesAttribKey : AttributeKey<_> = AttributeKey<_>("Pages") - [] - static member val _BackButtonTitleAttribKey : AttributeKey<_> = AttributeKey<_>("BackButtonTitle") - [] - static member val _HasBackButtonAttribKey : AttributeKey<_> = AttributeKey<_>("HasBackButton") - [] - static member val _HasNavigationBarAttribKey : AttributeKey<_> = AttributeKey<_>("HasNavigationBar") - [] - static member val _TitleIconAttribKey : AttributeKey<_> = AttributeKey<_>("TitleIcon") - [] - static member val _TitleViewAttribKey : AttributeKey<_> = AttributeKey<_>("TitleView") - [] - static member val _BarBackgroundColorAttribKey : AttributeKey<_> = AttributeKey<_>("BarBackgroundColor") - [] - static member val _BarTextColorAttribKey : AttributeKey<_> = AttributeKey<_>("BarTextColor") - [] - static member val _PoppedAttribKey : AttributeKey<_> = AttributeKey<_>("Popped") - [] - static member val _PoppedToRootAttribKey : AttributeKey<_> = AttributeKey<_>("PoppedToRoot") - [] - static member val _PushedAttribKey : AttributeKey<_> = AttributeKey<_>("Pushed") - [] - static member val _TabbedPage_CurrentPageAttribKey : AttributeKey<_> = AttributeKey<_>("TabbedPage_CurrentPage") - [] - static member val _TabbedPage_CurrentPageChangedAttribKey : AttributeKey<_> = AttributeKey<_>("TabbedPage_CurrentPageChanged") - [] - static member val _OnSizeAllocatedCallbackAttribKey : AttributeKey<_> = AttributeKey<_>("OnSizeAllocatedCallback") - [] - static member val _MasterAttribKey : AttributeKey<_> = AttributeKey<_>("Master") - [] - static member val _DetailAttribKey : AttributeKey<_> = AttributeKey<_>("Detail") - [] - static member val _IsGestureEnabledAttribKey : AttributeKey<_> = AttributeKey<_>("IsGestureEnabled") - [] - static member val _IsPresentedAttribKey : AttributeKey<_> = AttributeKey<_>("IsPresented") - [] - static member val _MasterBehaviorAttribKey : AttributeKey<_> = AttributeKey<_>("MasterBehavior") - [] - static member val _IsPresentedChangedAttribKey : AttributeKey<_> = AttributeKey<_>("IsPresentedChanged") - [] - static member val _AcceleratorAttribKey : AttributeKey<_> = AttributeKey<_>("Accelerator") - [] - static member val _TextDetailAttribKey : AttributeKey<_> = AttributeKey<_>("TextDetail") - [] - static member val _TextDetailColorAttribKey : AttributeKey<_> = AttributeKey<_>("TextDetailColor") - [] - static member val _TextCellCommandAttribKey : AttributeKey<_> = AttributeKey<_>("TextCellCommand") - [] - static member val _TextCellCanExecuteAttribKey : AttributeKey<_> = AttributeKey<_>("TextCellCanExecute") - [] - static member val _OrderAttribKey : AttributeKey<_> = AttributeKey<_>("Order") - [] - static member val _PriorityAttribKey : AttributeKey<_> = AttributeKey<_>("Priority") - [] - static member val _ViewAttribKey : AttributeKey<_> = AttributeKey<_>("View") - [] - static member val _ListViewItemsAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewItems") - [] - static member val _FooterAttribKey : AttributeKey<_> = AttributeKey<_>("Footer") - [] - static member val _HeaderAttribKey : AttributeKey<_> = AttributeKey<_>("Header") - [] - static member val _HeaderTemplateAttribKey : AttributeKey<_> = AttributeKey<_>("HeaderTemplate") - [] - static member val _IsGroupingEnabledAttribKey : AttributeKey<_> = AttributeKey<_>("IsGroupingEnabled") - [] - static member val _IsPullToRefreshEnabledAttribKey : AttributeKey<_> = AttributeKey<_>("IsPullToRefreshEnabled") - [] - static member val _IsRefreshingAttribKey : AttributeKey<_> = AttributeKey<_>("IsRefreshing") - [] - static member val _RefreshCommandAttribKey : AttributeKey<_> = AttributeKey<_>("RefreshCommand") - [] - static member val _ListView_SelectedItemAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_SelectedItem") - [] - static member val _ListView_SeparatorVisibilityAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_SeparatorVisibility") - [] - static member val _ListView_SeparatorColorAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_SeparatorColor") - [] - static member val _ListView_ItemAppearingAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_ItemAppearing") - [] - static member val _ListView_ItemDisappearingAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_ItemDisappearing") - [] - static member val _ListView_ItemSelectedAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_ItemSelected") - [] - static member val _ListView_ItemTappedAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_ItemTapped") - [] - static member val _ListView_RefreshingAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_Refreshing") - [] - static member val _SelectionModeAttribKey : AttributeKey<_> = AttributeKey<_>("SelectionMode") - [] - static member val _ListViewGrouped_ItemsSourceAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_ItemsSource") - [] - static member val _ListViewGrouped_ShowJumpListAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_ShowJumpList") - [] - static member val _ListViewGrouped_SelectedItemAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_SelectedItem") - [] - static member val _SeparatorVisibilityAttribKey : AttributeKey<_> = AttributeKey<_>("SeparatorVisibility") - [] - static member val _SeparatorColorAttribKey : AttributeKey<_> = AttributeKey<_>("SeparatorColor") - [] - static member val _ListViewGrouped_ItemAppearingAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_ItemAppearing") - [] - static member val _ListViewGrouped_ItemDisappearingAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_ItemDisappearing") - [] - static member val _ListViewGrouped_ItemSelectedAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_ItemSelected") - [] - static member val _ListViewGrouped_ItemTappedAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_ItemTapped") - [] - static member val _RefreshingAttribKey : AttributeKey<_> = AttributeKey<_>("Refreshing") +module ViewAttributes = + let ClassIdAttribKey : AttributeKey<_> = AttributeKey<_>("ClassId") + let StyleIdAttribKey : AttributeKey<_> = AttributeKey<_>("StyleId") + let AutomationIdAttribKey : AttributeKey<_> = AttributeKey<_>("AutomationId") + let ElementCreatedAttribKey : AttributeKey<(obj -> unit)> = AttributeKey<(obj -> unit)>("ElementCreated") + let ElementViewRefAttribKey : AttributeKey<_> = AttributeKey<_>("ElementViewRef") + let AnchorXAttribKey : AttributeKey<_> = AttributeKey<_>("AnchorX") + let AnchorYAttribKey : AttributeKey<_> = AttributeKey<_>("AnchorY") + let BackgroundColorAttribKey : AttributeKey<_> = AttributeKey<_>("BackgroundColor") + let HeightRequestAttribKey : AttributeKey<_> = AttributeKey<_>("HeightRequest") + let InputTransparentAttribKey : AttributeKey<_> = AttributeKey<_>("InputTransparent") + let IsEnabledAttribKey : AttributeKey<_> = AttributeKey<_>("IsEnabled") + let IsVisibleAttribKey : AttributeKey<_> = AttributeKey<_>("IsVisible") + let MinimumHeightRequestAttribKey : AttributeKey<_> = AttributeKey<_>("MinimumHeightRequest") + let MinimumWidthRequestAttribKey : AttributeKey<_> = AttributeKey<_>("MinimumWidthRequest") + let OpacityAttribKey : AttributeKey<_> = AttributeKey<_>("Opacity") + let RotationAttribKey : AttributeKey<_> = AttributeKey<_>("Rotation") + let RotationXAttribKey : AttributeKey<_> = AttributeKey<_>("RotationX") + let RotationYAttribKey : AttributeKey<_> = AttributeKey<_>("RotationY") + let ScaleAttribKey : AttributeKey<_> = AttributeKey<_>("Scale") + let StyleAttribKey : AttributeKey<_> = AttributeKey<_>("Style") + let StyleClassAttribKey : AttributeKey<_> = AttributeKey<_>("StyleClass") + let TranslationXAttribKey : AttributeKey<_> = AttributeKey<_>("TranslationX") + let TranslationYAttribKey : AttributeKey<_> = AttributeKey<_>("TranslationY") + let WidthRequestAttribKey : AttributeKey<_> = AttributeKey<_>("WidthRequest") + let ResourcesAttribKey : AttributeKey<_> = AttributeKey<_>("Resources") + let StylesAttribKey : AttributeKey<_> = AttributeKey<_>("Styles") + let StyleSheetsAttribKey : AttributeKey<_> = AttributeKey<_>("StyleSheets") + let IsTabStopAttribKey : AttributeKey<_> = AttributeKey<_>("IsTabStop") + let ScaleXAttribKey : AttributeKey<_> = AttributeKey<_>("ScaleX") + let ScaleYAttribKey : AttributeKey<_> = AttributeKey<_>("ScaleY") + let TabIndexAttribKey : AttributeKey<_> = AttributeKey<_>("TabIndex") + let HorizontalOptionsAttribKey : AttributeKey<_> = AttributeKey<_>("HorizontalOptions") + let VerticalOptionsAttribKey : AttributeKey<_> = AttributeKey<_>("VerticalOptions") + let MarginAttribKey : AttributeKey<_> = AttributeKey<_>("Margin") + let GestureRecognizersAttribKey : AttributeKey<_> = AttributeKey<_>("GestureRecognizers") + let TouchPointsAttribKey : AttributeKey<_> = AttributeKey<_>("TouchPoints") + let PanUpdatedAttribKey : AttributeKey<_> = AttributeKey<_>("PanUpdated") + let CommandAttribKey : AttributeKey<_> = AttributeKey<_>("Command") + let NumberOfTapsRequiredAttribKey : AttributeKey<_> = AttributeKey<_>("NumberOfTapsRequired") + let NumberOfClicksRequiredAttribKey : AttributeKey<_> = AttributeKey<_>("NumberOfClicksRequired") + let ButtonsAttribKey : AttributeKey<_> = AttributeKey<_>("Buttons") + let IsPinchingAttribKey : AttributeKey<_> = AttributeKey<_>("IsPinching") + let PinchUpdatedAttribKey : AttributeKey<_> = AttributeKey<_>("PinchUpdated") + let SwipeGestureRecognizerDirectionAttribKey : AttributeKey<_> = AttributeKey<_>("SwipeGestureRecognizerDirection") + let ThresholdAttribKey : AttributeKey<_> = AttributeKey<_>("Threshold") + let SwipedAttribKey : AttributeKey<_> = AttributeKey<_>("Swiped") + let ColorAttribKey : AttributeKey<_> = AttributeKey<_>("Color") + let IsRunningAttribKey : AttributeKey<_> = AttributeKey<_>("IsRunning") + let BoxViewCornerRadiusAttribKey : AttributeKey<_> = AttributeKey<_>("BoxViewCornerRadius") + let ProgressAttribKey : AttributeKey<_> = AttributeKey<_>("Progress") + let IsClippedToBoundsAttribKey : AttributeKey<_> = AttributeKey<_>("IsClippedToBounds") + let PaddingAttribKey : AttributeKey<_> = AttributeKey<_>("Padding") + let ContentAttribKey : AttributeKey<_> = AttributeKey<_>("Content") + let ScrollOrientationAttribKey : AttributeKey<_> = AttributeKey<_>("ScrollOrientation") + let HorizontalScrollBarVisibilityAttribKey : AttributeKey<_> = AttributeKey<_>("HorizontalScrollBarVisibility") + let VerticalScrollBarVisibilityAttribKey : AttributeKey<_> = AttributeKey<_>("VerticalScrollBarVisibility") + let CancelButtonColorAttribKey : AttributeKey<_> = AttributeKey<_>("CancelButtonColor") + let FontFamilyAttribKey : AttributeKey<_> = AttributeKey<_>("FontFamily") + let FontAttributesAttribKey : AttributeKey<_> = AttributeKey<_>("FontAttributes") + let FontSizeAttribKey : AttributeKey<_> = AttributeKey<_>("FontSize") + let HorizontalTextAlignmentAttribKey : AttributeKey<_> = AttributeKey<_>("HorizontalTextAlignment") + let PlaceholderAttribKey : AttributeKey<_> = AttributeKey<_>("Placeholder") + let PlaceholderColorAttribKey : AttributeKey<_> = AttributeKey<_>("PlaceholderColor") + let SearchBarCommandAttribKey : AttributeKey<_> = AttributeKey<_>("SearchBarCommand") + let SearchBarCanExecuteAttribKey : AttributeKey<_> = AttributeKey<_>("SearchBarCanExecute") + let TextAttribKey : AttributeKey<_> = AttributeKey<_>("Text") + let TextColorAttribKey : AttributeKey<_> = AttributeKey<_>("TextColor") + let SearchBarTextChangedAttribKey : AttributeKey<_> = AttributeKey<_>("SearchBarTextChanged") + let ButtonCommandAttribKey : AttributeKey<_> = AttributeKey<_>("ButtonCommand") + let ButtonCanExecuteAttribKey : AttributeKey<_> = AttributeKey<_>("ButtonCanExecute") + let BorderColorAttribKey : AttributeKey<_> = AttributeKey<_>("BorderColor") + let BorderWidthAttribKey : AttributeKey<_> = AttributeKey<_>("BorderWidth") + let CommandParameterAttribKey : AttributeKey<_> = AttributeKey<_>("CommandParameter") + let ContentLayoutAttribKey : AttributeKey<_> = AttributeKey<_>("ContentLayout") + let ButtonCornerRadiusAttribKey : AttributeKey<_> = AttributeKey<_>("ButtonCornerRadius") + let ButtonImageSourceAttribKey : AttributeKey<_> = AttributeKey<_>("ButtonImageSource") + let MinimumMaximumAttribKey : AttributeKey<_> = AttributeKey<_>("MinimumMaximum") + let ValueAttribKey : AttributeKey<_> = AttributeKey<_>("Value") + let ValueChangedAttribKey : AttributeKey<_> = AttributeKey<_>("ValueChanged") + let IncrementAttribKey : AttributeKey<_> = AttributeKey<_>("Increment") + let IsToggledAttribKey : AttributeKey<_> = AttributeKey<_>("IsToggled") + let ToggledAttribKey : AttributeKey<_> = AttributeKey<_>("Toggled") + let OnColorAttribKey : AttributeKey<_> = AttributeKey<_>("OnColor") + let HeightAttribKey : AttributeKey<_> = AttributeKey<_>("Height") + let OnAttribKey : AttributeKey<_> = AttributeKey<_>("On") + let OnChangedAttribKey : AttributeKey<_> = AttributeKey<_>("OnChanged") + let IntentAttribKey : AttributeKey<_> = AttributeKey<_>("Intent") + let HasUnevenRowsAttribKey : AttributeKey<_> = AttributeKey<_>("HasUnevenRows") + let RowHeightAttribKey : AttributeKey<_> = AttributeKey<_>("RowHeight") + let TableRootAttribKey : AttributeKey<_> = AttributeKey<_>("TableRoot") + let RowDefinitionHeightAttribKey : AttributeKey<_> = AttributeKey<_>("RowDefinitionHeight") + let ColumnDefinitionWidthAttribKey : AttributeKey<_> = AttributeKey<_>("ColumnDefinitionWidth") + let GridRowDefinitionsAttribKey : AttributeKey<_> = AttributeKey<_>("GridRowDefinitions") + let GridColumnDefinitionsAttribKey : AttributeKey<_> = AttributeKey<_>("GridColumnDefinitions") + let RowSpacingAttribKey : AttributeKey<_> = AttributeKey<_>("RowSpacing") + let ColumnSpacingAttribKey : AttributeKey<_> = AttributeKey<_>("ColumnSpacing") + let ChildrenAttribKey : AttributeKey<_> = AttributeKey<_>("Children") + let GridRowAttribKey : AttributeKey<_> = AttributeKey<_>("GridRow") + let GridRowSpanAttribKey : AttributeKey<_> = AttributeKey<_>("GridRowSpan") + let GridColumnAttribKey : AttributeKey<_> = AttributeKey<_>("GridColumn") + let GridColumnSpanAttribKey : AttributeKey<_> = AttributeKey<_>("GridColumnSpan") + let LayoutBoundsAttribKey : AttributeKey<_> = AttributeKey<_>("LayoutBounds") + let LayoutFlagsAttribKey : AttributeKey<_> = AttributeKey<_>("LayoutFlags") + let BoundsConstraintAttribKey : AttributeKey<_> = AttributeKey<_>("BoundsConstraint") + let HeightConstraintAttribKey : AttributeKey<_> = AttributeKey<_>("HeightConstraint") + let WidthConstraintAttribKey : AttributeKey<_> = AttributeKey<_>("WidthConstraint") + let XConstraintAttribKey : AttributeKey<_> = AttributeKey<_>("XConstraint") + let YConstraintAttribKey : AttributeKey<_> = AttributeKey<_>("YConstraint") + let AlignContentAttribKey : AttributeKey<_> = AttributeKey<_>("AlignContent") + let AlignItemsAttribKey : AttributeKey<_> = AttributeKey<_>("AlignItems") + let FlexLayoutDirectionAttribKey : AttributeKey<_> = AttributeKey<_>("FlexLayoutDirection") + let PositionAttribKey : AttributeKey<_> = AttributeKey<_>("Position") + let WrapAttribKey : AttributeKey<_> = AttributeKey<_>("Wrap") + let JustifyContentAttribKey : AttributeKey<_> = AttributeKey<_>("JustifyContent") + let FlexAlignSelfAttribKey : AttributeKey<_> = AttributeKey<_>("FlexAlignSelf") + let FlexOrderAttribKey : AttributeKey<_> = AttributeKey<_>("FlexOrder") + let FlexBasisAttribKey : AttributeKey<_> = AttributeKey<_>("FlexBasis") + let FlexGrowAttribKey : AttributeKey<_> = AttributeKey<_>("FlexGrow") + let FlexShrinkAttribKey : AttributeKey<_> = AttributeKey<_>("FlexShrink") + let DateAttribKey : AttributeKey<_> = AttributeKey<_>("Date") + let FormatAttribKey : AttributeKey<_> = AttributeKey<_>("Format") + let MinimumDateAttribKey : AttributeKey<_> = AttributeKey<_>("MinimumDate") + let MaximumDateAttribKey : AttributeKey<_> = AttributeKey<_>("MaximumDate") + let DateSelectedAttribKey : AttributeKey<_> = AttributeKey<_>("DateSelected") + let PickerItemsSourceAttribKey : AttributeKey<_> = AttributeKey<_>("PickerItemsSource") + let SelectedIndexAttribKey : AttributeKey<_> = AttributeKey<_>("SelectedIndex") + let TitleAttribKey : AttributeKey<_> = AttributeKey<_>("Title") + let SelectedIndexChangedAttribKey : AttributeKey<_> = AttributeKey<_>("SelectedIndexChanged") + let FrameCornerRadiusAttribKey : AttributeKey<_> = AttributeKey<_>("FrameCornerRadius") + let HasShadowAttribKey : AttributeKey<_> = AttributeKey<_>("HasShadow") + let ImageSourceAttribKey : AttributeKey<_> = AttributeKey<_>("ImageSource") + let AspectAttribKey : AttributeKey<_> = AttributeKey<_>("Aspect") + let IsOpaqueAttribKey : AttributeKey<_> = AttributeKey<_>("IsOpaque") + let ImageButtonCommandAttribKey : AttributeKey<_> = AttributeKey<_>("ImageButtonCommand") + let ImageButtonCornerRadiusAttribKey : AttributeKey<_> = AttributeKey<_>("ImageButtonCornerRadius") + let ClickedAttribKey : AttributeKey<_> = AttributeKey<_>("Clicked") + let PressedAttribKey : AttributeKey<_> = AttributeKey<_>("Pressed") + let ReleasedAttribKey : AttributeKey<_> = AttributeKey<_>("Released") + let KeyboardAttribKey : AttributeKey<_> = AttributeKey<_>("Keyboard") + let EditorCompletedAttribKey : AttributeKey<_> = AttributeKey<_>("EditorCompleted") + let TextChangedAttribKey : AttributeKey<_> = AttributeKey<_>("TextChanged") + let AutoSizeAttribKey : AttributeKey<_> = AttributeKey<_>("AutoSize") + let IsPasswordAttribKey : AttributeKey<_> = AttributeKey<_>("IsPassword") + let EntryCompletedAttribKey : AttributeKey<_> = AttributeKey<_>("EntryCompleted") + let IsTextPredictionEnabledAttribKey : AttributeKey<_> = AttributeKey<_>("IsTextPredictionEnabled") + let ReturnTypeAttribKey : AttributeKey<_> = AttributeKey<_>("ReturnType") + let ReturnCommandAttribKey : AttributeKey<_> = AttributeKey<_>("ReturnCommand") + let CursorPositionAttribKey : AttributeKey<_> = AttributeKey<_>("CursorPosition") + let SelectionLengthAttribKey : AttributeKey<_> = AttributeKey<_>("SelectionLength") + let LabelAttribKey : AttributeKey<_> = AttributeKey<_>("Label") + let EntryCellTextChangedAttribKey : AttributeKey<_> = AttributeKey<_>("EntryCellTextChanged") + let VerticalTextAlignmentAttribKey : AttributeKey<_> = AttributeKey<_>("VerticalTextAlignment") + let FormattedTextAttribKey : AttributeKey<_> = AttributeKey<_>("FormattedText") + let LineBreakModeAttribKey : AttributeKey<_> = AttributeKey<_>("LineBreakMode") + let LineHeightAttribKey : AttributeKey<_> = AttributeKey<_>("LineHeight") + let MaxLinesAttribKey : AttributeKey<_> = AttributeKey<_>("MaxLines") + let TextDecorationsAttribKey : AttributeKey<_> = AttributeKey<_>("TextDecorations") + let StackOrientationAttribKey : AttributeKey<_> = AttributeKey<_>("StackOrientation") + let SpacingAttribKey : AttributeKey<_> = AttributeKey<_>("Spacing") + let ForegroundColorAttribKey : AttributeKey<_> = AttributeKey<_>("ForegroundColor") + let PropertyChangedAttribKey : AttributeKey<_> = AttributeKey<_>("PropertyChanged") + let SpansAttribKey : AttributeKey<_> = AttributeKey<_>("Spans") + let TimeAttribKey : AttributeKey<_> = AttributeKey<_>("Time") + let WebSourceAttribKey : AttributeKey<_> = AttributeKey<_>("WebSource") + let ReloadAttribKey : AttributeKey<_> = AttributeKey<_>("Reload") + let NavigatedAttribKey : AttributeKey<_> = AttributeKey<_>("Navigated") + let NavigatingAttribKey : AttributeKey<_> = AttributeKey<_>("Navigating") + let ReloadRequestedAttribKey : AttributeKey<_> = AttributeKey<_>("ReloadRequested") + let BackgroundImageAttribKey : AttributeKey<_> = AttributeKey<_>("BackgroundImage") + let IconAttribKey : AttributeKey<_> = AttributeKey<_>("Icon") + let IsBusyAttribKey : AttributeKey<_> = AttributeKey<_>("IsBusy") + let ToolbarItemsAttribKey : AttributeKey<_> = AttributeKey<_>("ToolbarItems") + let UseSafeAreaAttribKey : AttributeKey<_> = AttributeKey<_>("UseSafeArea") + let Page_AppearingAttribKey : AttributeKey<_> = AttributeKey<_>("Page_Appearing") + let Page_DisappearingAttribKey : AttributeKey<_> = AttributeKey<_>("Page_Disappearing") + let Page_LayoutChangedAttribKey : AttributeKey<_> = AttributeKey<_>("Page_LayoutChanged") + let CarouselPage_CurrentPageAttribKey : AttributeKey<_> = AttributeKey<_>("CarouselPage_CurrentPage") + let CarouselPage_CurrentPageChangedAttribKey : AttributeKey<_> = AttributeKey<_>("CarouselPage_CurrentPageChanged") + let PagesAttribKey : AttributeKey<_> = AttributeKey<_>("Pages") + let BackButtonTitleAttribKey : AttributeKey<_> = AttributeKey<_>("BackButtonTitle") + let HasBackButtonAttribKey : AttributeKey<_> = AttributeKey<_>("HasBackButton") + let HasNavigationBarAttribKey : AttributeKey<_> = AttributeKey<_>("HasNavigationBar") + let TitleIconAttribKey : AttributeKey<_> = AttributeKey<_>("TitleIcon") + let TitleViewAttribKey : AttributeKey<_> = AttributeKey<_>("TitleView") + let BarBackgroundColorAttribKey : AttributeKey<_> = AttributeKey<_>("BarBackgroundColor") + let BarTextColorAttribKey : AttributeKey<_> = AttributeKey<_>("BarTextColor") + let PoppedAttribKey : AttributeKey<_> = AttributeKey<_>("Popped") + let PoppedToRootAttribKey : AttributeKey<_> = AttributeKey<_>("PoppedToRoot") + let PushedAttribKey : AttributeKey<_> = AttributeKey<_>("Pushed") + let TabbedPage_CurrentPageAttribKey : AttributeKey<_> = AttributeKey<_>("TabbedPage_CurrentPage") + let TabbedPage_CurrentPageChangedAttribKey : AttributeKey<_> = AttributeKey<_>("TabbedPage_CurrentPageChanged") + let OnSizeAllocatedCallbackAttribKey : AttributeKey<_> = AttributeKey<_>("OnSizeAllocatedCallback") + let MasterAttribKey : AttributeKey<_> = AttributeKey<_>("Master") + let DetailAttribKey : AttributeKey<_> = AttributeKey<_>("Detail") + let IsGestureEnabledAttribKey : AttributeKey<_> = AttributeKey<_>("IsGestureEnabled") + let IsPresentedAttribKey : AttributeKey<_> = AttributeKey<_>("IsPresented") + let MasterBehaviorAttribKey : AttributeKey<_> = AttributeKey<_>("MasterBehavior") + let IsPresentedChangedAttribKey : AttributeKey<_> = AttributeKey<_>("IsPresentedChanged") + let AcceleratorAttribKey : AttributeKey<_> = AttributeKey<_>("Accelerator") + let TextDetailAttribKey : AttributeKey<_> = AttributeKey<_>("TextDetail") + let TextDetailColorAttribKey : AttributeKey<_> = AttributeKey<_>("TextDetailColor") + let TextCellCommandAttribKey : AttributeKey<_> = AttributeKey<_>("TextCellCommand") + let TextCellCanExecuteAttribKey : AttributeKey<_> = AttributeKey<_>("TextCellCanExecute") + let OrderAttribKey : AttributeKey<_> = AttributeKey<_>("Order") + let PriorityAttribKey : AttributeKey<_> = AttributeKey<_>("Priority") + let ViewAttribKey : AttributeKey<_> = AttributeKey<_>("View") + let ListViewItemsAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewItems") + let FooterAttribKey : AttributeKey<_> = AttributeKey<_>("Footer") + let HeaderAttribKey : AttributeKey<_> = AttributeKey<_>("Header") + let HeaderTemplateAttribKey : AttributeKey<_> = AttributeKey<_>("HeaderTemplate") + let IsGroupingEnabledAttribKey : AttributeKey<_> = AttributeKey<_>("IsGroupingEnabled") + let IsPullToRefreshEnabledAttribKey : AttributeKey<_> = AttributeKey<_>("IsPullToRefreshEnabled") + let IsRefreshingAttribKey : AttributeKey<_> = AttributeKey<_>("IsRefreshing") + let RefreshCommandAttribKey : AttributeKey<_> = AttributeKey<_>("RefreshCommand") + let ListView_SelectedItemAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_SelectedItem") + let ListView_SeparatorVisibilityAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_SeparatorVisibility") + let ListView_SeparatorColorAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_SeparatorColor") + let ListView_ItemAppearingAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_ItemAppearing") + let ListView_ItemDisappearingAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_ItemDisappearing") + let ListView_ItemSelectedAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_ItemSelected") + let ListView_ItemTappedAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_ItemTapped") + let ListView_RefreshingAttribKey : AttributeKey<_> = AttributeKey<_>("ListView_Refreshing") + let SelectionModeAttribKey : AttributeKey<_> = AttributeKey<_>("SelectionMode") + let ListViewGrouped_ItemsSourceAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_ItemsSource") + let ListViewGrouped_ShowJumpListAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_ShowJumpList") + let ListViewGrouped_SelectedItemAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_SelectedItem") + let SeparatorVisibilityAttribKey : AttributeKey<_> = AttributeKey<_>("SeparatorVisibility") + let SeparatorColorAttribKey : AttributeKey<_> = AttributeKey<_>("SeparatorColor") + let ListViewGrouped_ItemAppearingAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_ItemAppearing") + let ListViewGrouped_ItemDisappearingAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_ItemDisappearing") + let ListViewGrouped_ItemSelectedAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_ItemSelected") + let ListViewGrouped_ItemTappedAttribKey : AttributeKey<_> = AttributeKey<_>("ListViewGrouped_ItemTapped") + let RefreshingAttribKey : AttributeKey<_> = AttributeKey<_>("Refreshing") + +type ViewProto() = + static member val ProtoElement : ViewElement option = None with get, set + static member val ProtoVisualElement : ViewElement option = None with get, set + static member val ProtoView : ViewElement option = None with get, set + static member val ProtoIGestureRecognizer : ViewElement option = None with get, set + static member val ProtoPanGestureRecognizer : ViewElement option = None with get, set + static member val ProtoTapGestureRecognizer : ViewElement option = None with get, set + static member val ProtoClickGestureRecognizer : ViewElement option = None with get, set + static member val ProtoPinchGestureRecognizer : ViewElement option = None with get, set + static member val ProtoSwipeGestureRecognizer : ViewElement option = None with get, set + static member val ProtoActivityIndicator : ViewElement option = None with get, set + static member val ProtoBoxView : ViewElement option = None with get, set + static member val ProtoProgressBar : ViewElement option = None with get, set + static member val ProtoLayout : ViewElement option = None with get, set + static member val ProtoScrollView : ViewElement option = None with get, set + static member val ProtoSearchBar : ViewElement option = None with get, set + static member val ProtoButton : ViewElement option = None with get, set + static member val ProtoSlider : ViewElement option = None with get, set + static member val ProtoStepper : ViewElement option = None with get, set + static member val ProtoSwitch : ViewElement option = None with get, set + static member val ProtoCell : ViewElement option = None with get, set + static member val ProtoSwitchCell : ViewElement option = None with get, set + static member val ProtoTableView : ViewElement option = None with get, set + static member val ProtoRowDefinition : ViewElement option = None with get, set + static member val ProtoColumnDefinition : ViewElement option = None with get, set + static member val ProtoGrid : ViewElement option = None with get, set + static member val ProtoAbsoluteLayout : ViewElement option = None with get, set + static member val ProtoRelativeLayout : ViewElement option = None with get, set + static member val ProtoFlexLayout : ViewElement option = None with get, set + static member val ProtoTemplatedView : ViewElement option = None with get, set + static member val ProtoContentView : ViewElement option = None with get, set + static member val ProtoDatePicker : ViewElement option = None with get, set + static member val ProtoPicker : ViewElement option = None with get, set + static member val ProtoFrame : ViewElement option = None with get, set + static member val ProtoImage : ViewElement option = None with get, set + static member val ProtoImageButton : ViewElement option = None with get, set + static member val ProtoInputView : ViewElement option = None with get, set + static member val ProtoEditor : ViewElement option = None with get, set + static member val ProtoEntry : ViewElement option = None with get, set + static member val ProtoEntryCell : ViewElement option = None with get, set + static member val ProtoLabel : ViewElement option = None with get, set + static member val ProtoStackLayout : ViewElement option = None with get, set + static member val ProtoSpan : ViewElement option = None with get, set + static member val ProtoFormattedString : ViewElement option = None with get, set + static member val ProtoTimePicker : ViewElement option = None with get, set + static member val ProtoWebView : ViewElement option = None with get, set + static member val ProtoPage : ViewElement option = None with get, set + static member val ProtoCarouselPage : ViewElement option = None with get, set + static member val ProtoNavigationPage : ViewElement option = None with get, set + static member val ProtoTabbedPage : ViewElement option = None with get, set + static member val ProtoContentPage : ViewElement option = None with get, set + static member val ProtoMasterDetailPage : ViewElement option = None with get, set + static member val ProtoMenuItem : ViewElement option = None with get, set + static member val ProtoTextCell : ViewElement option = None with get, set + static member val ProtoToolbarItem : ViewElement option = None with get, set + static member val ProtoImageCell : ViewElement option = None with get, set + static member val ProtoViewCell : ViewElement option = None with get, set + static member val ProtoListView : ViewElement option = None with get, set + static member val ProtoListViewGrouped : ViewElement option = None with get, set +type ViewBuilders() = /// Builds the attributes for a Element in the view - [] static member inline BuildElement(attribCount: int, ?classId: string, ?styleId: string, @@ -490,24 +316,21 @@ type View() = let attribCount = match ref with Some _ -> attribCount + 1 | None -> attribCount let attribBuilder = new AttributesBuilder(attribCount) - match classId with None -> () | Some v -> attribBuilder.Add(View._ClassIdAttribKey, (v)) - match styleId with None -> () | Some v -> attribBuilder.Add(View._StyleIdAttribKey, (v)) - match automationId with None -> () | Some v -> attribBuilder.Add(View._AutomationIdAttribKey, (v)) - match created with None -> () | Some v -> attribBuilder.Add(View._ElementCreatedAttribKey, (v)) - match ref with None -> () | Some v -> attribBuilder.Add(View._ElementViewRefAttribKey, (v)) + match classId with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ClassIdAttribKey, (v)) + match styleId with None -> () | Some v -> attribBuilder.Add(ViewAttributes.StyleIdAttribKey, (v)) + match automationId with None -> () | Some v -> attribBuilder.Add(ViewAttributes.AutomationIdAttribKey, (v)) + match created with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ElementCreatedAttribKey, (v)) + match ref with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ElementViewRefAttribKey, (v)) attribBuilder - [] - static member val CreateFuncElement : (unit -> Xamarin.Forms.Element) = (fun () -> View.CreateElement()) + static member val CreateFuncElement : (unit -> Xamarin.Forms.Element) = (fun () -> ViewBuilders.CreateElement()) - [] - static member CreateElement () : Xamarin.Forms.Element = + static member CreateElement () : Xamarin.Forms.Element = failwith "can't create Xamarin.Forms.Element" - [] - static member val UpdateFuncElement = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Element) -> View.UpdateElement (prevOpt, curr, target)) + static member val UpdateFuncElement = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Element) -> ViewBuilders.UpdateElement (prevOpt, curr, target)) - [] static member UpdateElement (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Element) = let mutable prevClassIdOpt = ValueNone let mutable currClassIdOpt = ValueNone @@ -520,29 +343,29 @@ type View() = let mutable prevElementViewRefOpt = ValueNone let mutable currElementViewRefOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ClassIdAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ClassIdAttribKey.KeyValue then currClassIdOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._StyleIdAttribKey.KeyValue then + if kvp.Key = ViewAttributes.StyleIdAttribKey.KeyValue then currStyleIdOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._AutomationIdAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AutomationIdAttribKey.KeyValue then currAutomationIdOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._ElementCreatedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ElementCreatedAttribKey.KeyValue then currElementCreatedOpt <- ValueSome (kvp.Value :?> obj -> unit) - if kvp.Key = View._ElementViewRefAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ElementViewRefAttribKey.KeyValue then currElementViewRefOpt <- ValueSome (kvp.Value :?> ViewRef) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ClassIdAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ClassIdAttribKey.KeyValue then prevClassIdOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._StyleIdAttribKey.KeyValue then + if kvp.Key = ViewAttributes.StyleIdAttribKey.KeyValue then prevStyleIdOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._AutomationIdAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AutomationIdAttribKey.KeyValue then prevAutomationIdOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._ElementCreatedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ElementCreatedAttribKey.KeyValue then prevElementCreatedOpt <- ValueSome (kvp.Value :?> obj -> unit) - if kvp.Key = View._ElementViewRefAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ElementViewRefAttribKey.KeyValue then prevElementViewRefOpt <- ValueSome (kvp.Value :?> ViewRef) match prevClassIdOpt, currClassIdOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -562,27 +385,22 @@ type View() = (fun _ _ _ -> ()) prevElementCreatedOpt currElementCreatedOpt target (fun _ _ _ -> ()) prevElementViewRefOpt currElementViewRefOpt target - /// Describes a Element in the view - static member inline Element(?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Element -> unit), - ?ref: ViewRef) = + static member ConstructElement(?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Element -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildElement(0, + let attribBuilder = ViewBuilders.BuildElement(0, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncElement, View.UpdateFuncElement, attribBuilder) - - [] - static member val ProtoElement : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncElement, ViewBuilders.UpdateFuncElement, attribBuilder) /// Builds the attributes for a VisualElement in the view - [] static member inline BuildVisualElement(attribCount: int, ?anchorX: double, ?anchorY: double, @@ -643,49 +461,46 @@ type View() = let attribCount = match scaleY with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match tabIndex with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match anchorX with None -> () | Some v -> attribBuilder.Add(View._AnchorXAttribKey, (v)) - match anchorY with None -> () | Some v -> attribBuilder.Add(View._AnchorYAttribKey, (v)) - match backgroundColor with None -> () | Some v -> attribBuilder.Add(View._BackgroundColorAttribKey, (v)) - match heightRequest with None -> () | Some v -> attribBuilder.Add(View._HeightRequestAttribKey, (v)) - match inputTransparent with None -> () | Some v -> attribBuilder.Add(View._InputTransparentAttribKey, (v)) - match isEnabled with None -> () | Some v -> attribBuilder.Add(View._IsEnabledAttribKey, (v)) - match isVisible with None -> () | Some v -> attribBuilder.Add(View._IsVisibleAttribKey, (v)) - match minimumHeightRequest with None -> () | Some v -> attribBuilder.Add(View._MinimumHeightRequestAttribKey, (v)) - match minimumWidthRequest with None -> () | Some v -> attribBuilder.Add(View._MinimumWidthRequestAttribKey, (v)) - match opacity with None -> () | Some v -> attribBuilder.Add(View._OpacityAttribKey, (v)) - match rotation with None -> () | Some v -> attribBuilder.Add(View._RotationAttribKey, (v)) - match rotationX with None -> () | Some v -> attribBuilder.Add(View._RotationXAttribKey, (v)) - match rotationY with None -> () | Some v -> attribBuilder.Add(View._RotationYAttribKey, (v)) - match scale with None -> () | Some v -> attribBuilder.Add(View._ScaleAttribKey, (v)) - match style with None -> () | Some v -> attribBuilder.Add(View._StyleAttribKey, (v)) - match styleClass with None -> () | Some v -> attribBuilder.Add(View._StyleClassAttribKey, makeStyleClass(v)) - match translationX with None -> () | Some v -> attribBuilder.Add(View._TranslationXAttribKey, (v)) - match translationY with None -> () | Some v -> attribBuilder.Add(View._TranslationYAttribKey, (v)) - match widthRequest with None -> () | Some v -> attribBuilder.Add(View._WidthRequestAttribKey, (v)) - match resources with None -> () | Some v -> attribBuilder.Add(View._ResourcesAttribKey, (v)) - match styles with None -> () | Some v -> attribBuilder.Add(View._StylesAttribKey, (v)) - match styleSheets with None -> () | Some v -> attribBuilder.Add(View._StyleSheetsAttribKey, (v)) - match isTabStop with None -> () | Some v -> attribBuilder.Add(View._IsTabStopAttribKey, (v)) - match scaleX with None -> () | Some v -> attribBuilder.Add(View._ScaleXAttribKey, (v)) - match scaleY with None -> () | Some v -> attribBuilder.Add(View._ScaleYAttribKey, (v)) - match tabIndex with None -> () | Some v -> attribBuilder.Add(View._TabIndexAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match anchorX with None -> () | Some v -> attribBuilder.Add(ViewAttributes.AnchorXAttribKey, (v)) + match anchorY with None -> () | Some v -> attribBuilder.Add(ViewAttributes.AnchorYAttribKey, (v)) + match backgroundColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.BackgroundColorAttribKey, (v)) + match heightRequest with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HeightRequestAttribKey, (v)) + match inputTransparent with None -> () | Some v -> attribBuilder.Add(ViewAttributes.InputTransparentAttribKey, (v)) + match isEnabled with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsEnabledAttribKey, (v)) + match isVisible with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsVisibleAttribKey, (v)) + match minimumHeightRequest with None -> () | Some v -> attribBuilder.Add(ViewAttributes.MinimumHeightRequestAttribKey, (v)) + match minimumWidthRequest with None -> () | Some v -> attribBuilder.Add(ViewAttributes.MinimumWidthRequestAttribKey, (v)) + match opacity with None -> () | Some v -> attribBuilder.Add(ViewAttributes.OpacityAttribKey, (v)) + match rotation with None -> () | Some v -> attribBuilder.Add(ViewAttributes.RotationAttribKey, (v)) + match rotationX with None -> () | Some v -> attribBuilder.Add(ViewAttributes.RotationXAttribKey, (v)) + match rotationY with None -> () | Some v -> attribBuilder.Add(ViewAttributes.RotationYAttribKey, (v)) + match scale with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ScaleAttribKey, (v)) + match style with None -> () | Some v -> attribBuilder.Add(ViewAttributes.StyleAttribKey, (v)) + match styleClass with None -> () | Some v -> attribBuilder.Add(ViewAttributes.StyleClassAttribKey, makeStyleClass(v)) + match translationX with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TranslationXAttribKey, (v)) + match translationY with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TranslationYAttribKey, (v)) + match widthRequest with None -> () | Some v -> attribBuilder.Add(ViewAttributes.WidthRequestAttribKey, (v)) + match resources with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ResourcesAttribKey, (v)) + match styles with None -> () | Some v -> attribBuilder.Add(ViewAttributes.StylesAttribKey, (v)) + match styleSheets with None -> () | Some v -> attribBuilder.Add(ViewAttributes.StyleSheetsAttribKey, (v)) + match isTabStop with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsTabStopAttribKey, (v)) + match scaleX with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ScaleXAttribKey, (v)) + match scaleY with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ScaleYAttribKey, (v)) + match tabIndex with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TabIndexAttribKey, (v)) attribBuilder - [] - static member val CreateFuncVisualElement : (unit -> Xamarin.Forms.VisualElement) = (fun () -> View.CreateVisualElement()) + static member val CreateFuncVisualElement : (unit -> Xamarin.Forms.VisualElement) = (fun () -> ViewBuilders.CreateVisualElement()) - [] - static member CreateVisualElement () : Xamarin.Forms.VisualElement = + static member CreateVisualElement () : Xamarin.Forms.VisualElement = failwith "can't create Xamarin.Forms.VisualElement" - [] - static member val UpdateFuncVisualElement = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.VisualElement) -> View.UpdateVisualElement (prevOpt, curr, target)) + static member val UpdateFuncVisualElement = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.VisualElement) -> ViewBuilders.UpdateVisualElement (prevOpt, curr, target)) - [] static member UpdateVisualElement (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.VisualElement) = // update the inherited Element element - let baseElement = (if View.ProtoElement.IsNone then View.ProtoElement <- Some (View.Element())); View.ProtoElement.Value + let baseElement = (if ViewProto.ProtoElement.IsNone then ViewProto.ProtoElement <- Some (ViewBuilders.ConstructElement())); ViewProto.ProtoElement.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevAnchorXOpt = ValueNone let mutable currAnchorXOpt = ValueNone @@ -740,113 +555,113 @@ type View() = let mutable prevTabIndexOpt = ValueNone let mutable currTabIndexOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._AnchorXAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AnchorXAttribKey.KeyValue then currAnchorXOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._AnchorYAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AnchorYAttribKey.KeyValue then currAnchorYOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._BackgroundColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BackgroundColorAttribKey.KeyValue then currBackgroundColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._HeightRequestAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HeightRequestAttribKey.KeyValue then currHeightRequestOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._InputTransparentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.InputTransparentAttribKey.KeyValue then currInputTransparentOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._IsEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsEnabledAttribKey.KeyValue then currIsEnabledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._IsVisibleAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsVisibleAttribKey.KeyValue then currIsVisibleOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._MinimumHeightRequestAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MinimumHeightRequestAttribKey.KeyValue then currMinimumHeightRequestOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._MinimumWidthRequestAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MinimumWidthRequestAttribKey.KeyValue then currMinimumWidthRequestOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._OpacityAttribKey.KeyValue then + if kvp.Key = ViewAttributes.OpacityAttribKey.KeyValue then currOpacityOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._RotationAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RotationAttribKey.KeyValue then currRotationOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._RotationXAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RotationXAttribKey.KeyValue then currRotationXOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._RotationYAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RotationYAttribKey.KeyValue then currRotationYOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ScaleAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ScaleAttribKey.KeyValue then currScaleOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._StyleAttribKey.KeyValue then + if kvp.Key = ViewAttributes.StyleAttribKey.KeyValue then currStyleOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Style) - if kvp.Key = View._StyleClassAttribKey.KeyValue then + if kvp.Key = ViewAttributes.StyleClassAttribKey.KeyValue then currStyleClassOpt <- ValueSome (kvp.Value :?> System.Collections.Generic.IList) - if kvp.Key = View._TranslationXAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TranslationXAttribKey.KeyValue then currTranslationXOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._TranslationYAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TranslationYAttribKey.KeyValue then currTranslationYOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._WidthRequestAttribKey.KeyValue then + if kvp.Key = ViewAttributes.WidthRequestAttribKey.KeyValue then currWidthRequestOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ResourcesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ResourcesAttribKey.KeyValue then currResourcesOpt <- ValueSome (kvp.Value :?> (string * obj) list) - if kvp.Key = View._StylesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.StylesAttribKey.KeyValue then currStylesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Style list) - if kvp.Key = View._StyleSheetsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.StyleSheetsAttribKey.KeyValue then currStyleSheetsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.StyleSheets.StyleSheet list) - if kvp.Key = View._IsTabStopAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsTabStopAttribKey.KeyValue then currIsTabStopOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._ScaleXAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ScaleXAttribKey.KeyValue then currScaleXOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ScaleYAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ScaleYAttribKey.KeyValue then currScaleYOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._TabIndexAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TabIndexAttribKey.KeyValue then currTabIndexOpt <- ValueSome (kvp.Value :?> int) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._AnchorXAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AnchorXAttribKey.KeyValue then prevAnchorXOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._AnchorYAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AnchorYAttribKey.KeyValue then prevAnchorYOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._BackgroundColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BackgroundColorAttribKey.KeyValue then prevBackgroundColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._HeightRequestAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HeightRequestAttribKey.KeyValue then prevHeightRequestOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._InputTransparentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.InputTransparentAttribKey.KeyValue then prevInputTransparentOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._IsEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsEnabledAttribKey.KeyValue then prevIsEnabledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._IsVisibleAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsVisibleAttribKey.KeyValue then prevIsVisibleOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._MinimumHeightRequestAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MinimumHeightRequestAttribKey.KeyValue then prevMinimumHeightRequestOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._MinimumWidthRequestAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MinimumWidthRequestAttribKey.KeyValue then prevMinimumWidthRequestOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._OpacityAttribKey.KeyValue then + if kvp.Key = ViewAttributes.OpacityAttribKey.KeyValue then prevOpacityOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._RotationAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RotationAttribKey.KeyValue then prevRotationOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._RotationXAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RotationXAttribKey.KeyValue then prevRotationXOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._RotationYAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RotationYAttribKey.KeyValue then prevRotationYOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ScaleAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ScaleAttribKey.KeyValue then prevScaleOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._StyleAttribKey.KeyValue then + if kvp.Key = ViewAttributes.StyleAttribKey.KeyValue then prevStyleOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Style) - if kvp.Key = View._StyleClassAttribKey.KeyValue then + if kvp.Key = ViewAttributes.StyleClassAttribKey.KeyValue then prevStyleClassOpt <- ValueSome (kvp.Value :?> System.Collections.Generic.IList) - if kvp.Key = View._TranslationXAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TranslationXAttribKey.KeyValue then prevTranslationXOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._TranslationYAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TranslationYAttribKey.KeyValue then prevTranslationYOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._WidthRequestAttribKey.KeyValue then + if kvp.Key = ViewAttributes.WidthRequestAttribKey.KeyValue then prevWidthRequestOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ResourcesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ResourcesAttribKey.KeyValue then prevResourcesOpt <- ValueSome (kvp.Value :?> (string * obj) list) - if kvp.Key = View._StylesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.StylesAttribKey.KeyValue then prevStylesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Style list) - if kvp.Key = View._StyleSheetsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.StyleSheetsAttribKey.KeyValue then prevStyleSheetsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.StyleSheets.StyleSheet list) - if kvp.Key = View._IsTabStopAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsTabStopAttribKey.KeyValue then prevIsTabStopOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._ScaleXAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ScaleXAttribKey.KeyValue then prevScaleXOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ScaleYAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ScaleYAttribKey.KeyValue then prevScaleYOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._TabIndexAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TabIndexAttribKey.KeyValue then prevTabIndexOpt <- ValueSome (kvp.Value :?> int) match prevAnchorXOpt, currAnchorXOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -963,40 +778,39 @@ type View() = | ValueSome _, ValueNone -> target.TabIndex <- 0 | ValueNone, ValueNone -> () - /// Describes a VisualElement in the view - static member inline VisualElement(?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.VisualElement -> unit), - ?ref: ViewRef) = + static member ConstructVisualElement(?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.VisualElement -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildVisualElement(0, + let attribBuilder = ViewBuilders.BuildVisualElement(0, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, @@ -1029,13 +843,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncVisualElement, View.UpdateFuncVisualElement, attribBuilder) - - [] - static member val ProtoVisualElement : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncVisualElement, ViewBuilders.UpdateFuncVisualElement, attribBuilder) /// Builds the attributes for a View in the view - [] static member inline BuildView(attribCount: int, ?horizontalOptions: Xamarin.Forms.LayoutOptions, ?verticalOptions: Xamarin.Forms.LayoutOptions, @@ -1078,27 +888,24 @@ type View() = let attribCount = match margin with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match gestureRecognizers with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildVisualElement(attribCount, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match horizontalOptions with None -> () | Some v -> attribBuilder.Add(View._HorizontalOptionsAttribKey, (v)) - match verticalOptions with None -> () | Some v -> attribBuilder.Add(View._VerticalOptionsAttribKey, (v)) - match margin with None -> () | Some v -> attribBuilder.Add(View._MarginAttribKey, makeThickness(v)) - match gestureRecognizers with None -> () | Some v -> attribBuilder.Add(View._GestureRecognizersAttribKey, Array.ofList(v)) + let attribBuilder = ViewBuilders.BuildVisualElement(attribCount, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match horizontalOptions with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HorizontalOptionsAttribKey, (v)) + match verticalOptions with None -> () | Some v -> attribBuilder.Add(ViewAttributes.VerticalOptionsAttribKey, (v)) + match margin with None -> () | Some v -> attribBuilder.Add(ViewAttributes.MarginAttribKey, makeThickness(v)) + match gestureRecognizers with None -> () | Some v -> attribBuilder.Add(ViewAttributes.GestureRecognizersAttribKey, Array.ofList(v)) attribBuilder - [] - static member val CreateFuncView : (unit -> Xamarin.Forms.View) = (fun () -> View.CreateView()) + static member val CreateFuncView : (unit -> Xamarin.Forms.View) = (fun () -> ViewBuilders.CreateView()) - [] - static member CreateView () : Xamarin.Forms.View = + static member CreateView () : Xamarin.Forms.View = failwith "can't create Xamarin.Forms.View" - [] - static member val UpdateFuncView = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.View) -> View.UpdateView (prevOpt, curr, target)) + static member val UpdateFuncView = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.View) -> ViewBuilders.UpdateView (prevOpt, curr, target)) - [] static member UpdateView (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.View) = // update the inherited VisualElement element - let baseElement = (if View.ProtoVisualElement.IsNone then View.ProtoVisualElement <- Some (View.VisualElement())); View.ProtoVisualElement.Value + let baseElement = (if ViewProto.ProtoVisualElement.IsNone then ViewProto.ProtoVisualElement <- Some (ViewBuilders.ConstructVisualElement())); ViewProto.ProtoVisualElement.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevHorizontalOptionsOpt = ValueNone let mutable currHorizontalOptionsOpt = ValueNone @@ -1109,25 +916,25 @@ type View() = let mutable prevGestureRecognizersOpt = ValueNone let mutable currGestureRecognizersOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._HorizontalOptionsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HorizontalOptionsAttribKey.KeyValue then currHorizontalOptionsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.LayoutOptions) - if kvp.Key = View._VerticalOptionsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.VerticalOptionsAttribKey.KeyValue then currVerticalOptionsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.LayoutOptions) - if kvp.Key = View._MarginAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MarginAttribKey.KeyValue then currMarginOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Thickness) - if kvp.Key = View._GestureRecognizersAttribKey.KeyValue then + if kvp.Key = ViewAttributes.GestureRecognizersAttribKey.KeyValue then currGestureRecognizersOpt <- ValueSome (kvp.Value :?> ViewElement[]) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._HorizontalOptionsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HorizontalOptionsAttribKey.KeyValue then prevHorizontalOptionsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.LayoutOptions) - if kvp.Key = View._VerticalOptionsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.VerticalOptionsAttribKey.KeyValue then prevVerticalOptionsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.LayoutOptions) - if kvp.Key = View._MarginAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MarginAttribKey.KeyValue then prevMarginOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Thickness) - if kvp.Key = View._GestureRecognizersAttribKey.KeyValue then + if kvp.Key = ViewAttributes.GestureRecognizersAttribKey.KeyValue then prevGestureRecognizersOpt <- ValueSome (kvp.Value :?> ViewElement[]) match prevHorizontalOptionsOpt, currHorizontalOptionsOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -1150,44 +957,43 @@ type View() = canReuseChild updateChild - /// Describes a View in the view - static member inline View(?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.View -> unit), - ?ref: ViewRef) = + static member ConstructView(?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.View -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildView(0, + let attribBuilder = ViewBuilders.BuildView(0, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, @@ -1224,45 +1030,33 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncView, View.UpdateFuncView, attribBuilder) - - [] - static member val ProtoView : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncView, ViewBuilders.UpdateFuncView, attribBuilder) /// Builds the attributes for a IGestureRecognizer in the view - [] static member inline BuildIGestureRecognizer(attribCount: int) = let attribBuilder = new AttributesBuilder(attribCount) attribBuilder - [] - static member val CreateFuncIGestureRecognizer : (unit -> Xamarin.Forms.IGestureRecognizer) = (fun () -> View.CreateIGestureRecognizer()) + static member val CreateFuncIGestureRecognizer : (unit -> Xamarin.Forms.IGestureRecognizer) = (fun () -> ViewBuilders.CreateIGestureRecognizer()) - [] - static member CreateIGestureRecognizer () : Xamarin.Forms.IGestureRecognizer = + static member CreateIGestureRecognizer () : Xamarin.Forms.IGestureRecognizer = failwith "can't create Xamarin.Forms.IGestureRecognizer" - [] - static member val UpdateFuncIGestureRecognizer = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.IGestureRecognizer) -> View.UpdateIGestureRecognizer (prevOpt, curr, target)) + static member val UpdateFuncIGestureRecognizer = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.IGestureRecognizer) -> ViewBuilders.UpdateIGestureRecognizer (prevOpt, curr, target)) - [] static member UpdateIGestureRecognizer (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.IGestureRecognizer) = ignore prevOpt ignore curr ignore target - /// Describes a IGestureRecognizer in the view - static member inline IGestureRecognizer() = - - let attribBuilder = View.BuildIGestureRecognizer(0) + static member ConstructIGestureRecognizer() = - ViewElement.Create(View.CreateFuncIGestureRecognizer, View.UpdateFuncIGestureRecognizer, attribBuilder) + let attribBuilder = ViewBuilders.BuildIGestureRecognizer(0) - [] - static member val ProtoIGestureRecognizer : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncIGestureRecognizer, ViewBuilders.UpdateFuncIGestureRecognizer, attribBuilder) /// Builds the attributes for a PanGestureRecognizer in the view - [] static member inline BuildPanGestureRecognizer(attribCount: int, ?touchPoints: int, ?panUpdated: Xamarin.Forms.PanUpdatedEventArgs -> unit, @@ -1275,42 +1069,39 @@ type View() = let attribCount = match touchPoints with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match panUpdated with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match touchPoints with None -> () | Some v -> attribBuilder.Add(View._TouchPointsAttribKey, (v)) - match panUpdated with None -> () | Some v -> attribBuilder.Add(View._PanUpdatedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match touchPoints with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TouchPointsAttribKey, (v)) + match panUpdated with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PanUpdatedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) attribBuilder - [] - static member val CreateFuncPanGestureRecognizer : (unit -> Xamarin.Forms.PanGestureRecognizer) = (fun () -> View.CreatePanGestureRecognizer()) + static member val CreateFuncPanGestureRecognizer : (unit -> Xamarin.Forms.PanGestureRecognizer) = (fun () -> ViewBuilders.CreatePanGestureRecognizer()) - [] - static member CreatePanGestureRecognizer () : Xamarin.Forms.PanGestureRecognizer = + static member CreatePanGestureRecognizer () : Xamarin.Forms.PanGestureRecognizer = upcast (new Xamarin.Forms.PanGestureRecognizer()) - [] - static member val UpdateFuncPanGestureRecognizer = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.PanGestureRecognizer) -> View.UpdatePanGestureRecognizer (prevOpt, curr, target)) + static member val UpdateFuncPanGestureRecognizer = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.PanGestureRecognizer) -> ViewBuilders.UpdatePanGestureRecognizer (prevOpt, curr, target)) - [] static member UpdatePanGestureRecognizer (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.PanGestureRecognizer) = // update the inherited Element element - let baseElement = (if View.ProtoElement.IsNone then View.ProtoElement <- Some (View.Element())); View.ProtoElement.Value + let baseElement = (if ViewProto.ProtoElement.IsNone then ViewProto.ProtoElement <- Some (ViewBuilders.ConstructElement())); ViewProto.ProtoElement.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevTouchPointsOpt = ValueNone let mutable currTouchPointsOpt = ValueNone let mutable prevPanUpdatedOpt = ValueNone let mutable currPanUpdatedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._TouchPointsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TouchPointsAttribKey.KeyValue then currTouchPointsOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._PanUpdatedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PanUpdatedAttribKey.KeyValue then currPanUpdatedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._TouchPointsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TouchPointsAttribKey.KeyValue then prevTouchPointsOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._PanUpdatedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PanUpdatedAttribKey.KeyValue then prevPanUpdatedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevTouchPointsOpt, currTouchPointsOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -1324,16 +1115,15 @@ type View() = | ValueSome prevValue, ValueNone -> target.PanUpdated.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a PanGestureRecognizer in the view - static member inline PanGestureRecognizer(?touchPoints: int, - ?panUpdated: Xamarin.Forms.PanUpdatedEventArgs -> unit, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.PanGestureRecognizer -> unit), - ?ref: ViewRef) = + static member ConstructPanGestureRecognizer(?touchPoints: int, + ?panUpdated: Xamarin.Forms.PanUpdatedEventArgs -> unit, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.PanGestureRecognizer -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildPanGestureRecognizer(0, + let attribBuilder = ViewBuilders.BuildPanGestureRecognizer(0, ?touchPoints=touchPoints, ?panUpdated=panUpdated, ?classId=classId, @@ -1342,13 +1132,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncPanGestureRecognizer, View.UpdateFuncPanGestureRecognizer, attribBuilder) - - [] - static member val ProtoPanGestureRecognizer : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncPanGestureRecognizer, ViewBuilders.UpdateFuncPanGestureRecognizer, attribBuilder) /// Builds the attributes for a TapGestureRecognizer in the view - [] static member inline BuildTapGestureRecognizer(attribCount: int, ?command: unit -> unit, ?numberOfTapsRequired: int, @@ -1361,42 +1147,39 @@ type View() = let attribCount = match command with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match numberOfTapsRequired with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match command with None -> () | Some v -> attribBuilder.Add(View._CommandAttribKey, makeCommand(v)) - match numberOfTapsRequired with None -> () | Some v -> attribBuilder.Add(View._NumberOfTapsRequiredAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match command with None -> () | Some v -> attribBuilder.Add(ViewAttributes.CommandAttribKey, makeCommand(v)) + match numberOfTapsRequired with None -> () | Some v -> attribBuilder.Add(ViewAttributes.NumberOfTapsRequiredAttribKey, (v)) attribBuilder - [] - static member val CreateFuncTapGestureRecognizer : (unit -> Xamarin.Forms.TapGestureRecognizer) = (fun () -> View.CreateTapGestureRecognizer()) + static member val CreateFuncTapGestureRecognizer : (unit -> Xamarin.Forms.TapGestureRecognizer) = (fun () -> ViewBuilders.CreateTapGestureRecognizer()) - [] - static member CreateTapGestureRecognizer () : Xamarin.Forms.TapGestureRecognizer = + static member CreateTapGestureRecognizer () : Xamarin.Forms.TapGestureRecognizer = upcast (new Xamarin.Forms.TapGestureRecognizer()) - [] - static member val UpdateFuncTapGestureRecognizer = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TapGestureRecognizer) -> View.UpdateTapGestureRecognizer (prevOpt, curr, target)) + static member val UpdateFuncTapGestureRecognizer = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TapGestureRecognizer) -> ViewBuilders.UpdateTapGestureRecognizer (prevOpt, curr, target)) - [] static member UpdateTapGestureRecognizer (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.TapGestureRecognizer) = // update the inherited Element element - let baseElement = (if View.ProtoElement.IsNone then View.ProtoElement <- Some (View.Element())); View.ProtoElement.Value + let baseElement = (if ViewProto.ProtoElement.IsNone then ViewProto.ProtoElement <- Some (ViewBuilders.ConstructElement())); ViewProto.ProtoElement.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevCommandOpt = ValueNone let mutable currCommandOpt = ValueNone let mutable prevNumberOfTapsRequiredOpt = ValueNone let mutable currNumberOfTapsRequiredOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._CommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandAttribKey.KeyValue then currCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._NumberOfTapsRequiredAttribKey.KeyValue then + if kvp.Key = ViewAttributes.NumberOfTapsRequiredAttribKey.KeyValue then currNumberOfTapsRequiredOpt <- ValueSome (kvp.Value :?> int) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._CommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandAttribKey.KeyValue then prevCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._NumberOfTapsRequiredAttribKey.KeyValue then + if kvp.Key = ViewAttributes.NumberOfTapsRequiredAttribKey.KeyValue then prevNumberOfTapsRequiredOpt <- ValueSome (kvp.Value :?> int) match prevCommandOpt, currCommandOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -1409,16 +1192,15 @@ type View() = | ValueSome _, ValueNone -> target.NumberOfTapsRequired <- 1 | ValueNone, ValueNone -> () - /// Describes a TapGestureRecognizer in the view - static member inline TapGestureRecognizer(?command: unit -> unit, - ?numberOfTapsRequired: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.TapGestureRecognizer -> unit), - ?ref: ViewRef) = + static member ConstructTapGestureRecognizer(?command: unit -> unit, + ?numberOfTapsRequired: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TapGestureRecognizer -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildTapGestureRecognizer(0, + let attribBuilder = ViewBuilders.BuildTapGestureRecognizer(0, ?command=command, ?numberOfTapsRequired=numberOfTapsRequired, ?classId=classId, @@ -1427,13 +1209,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncTapGestureRecognizer, View.UpdateFuncTapGestureRecognizer, attribBuilder) - - [] - static member val ProtoTapGestureRecognizer : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncTapGestureRecognizer, ViewBuilders.UpdateFuncTapGestureRecognizer, attribBuilder) /// Builds the attributes for a ClickGestureRecognizer in the view - [] static member inline BuildClickGestureRecognizer(attribCount: int, ?command: unit -> unit, ?numberOfClicksRequired: int, @@ -1448,26 +1226,23 @@ type View() = let attribCount = match numberOfClicksRequired with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match buttons with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match command with None -> () | Some v -> attribBuilder.Add(View._CommandAttribKey, makeCommand(v)) - match numberOfClicksRequired with None -> () | Some v -> attribBuilder.Add(View._NumberOfClicksRequiredAttribKey, (v)) - match buttons with None -> () | Some v -> attribBuilder.Add(View._ButtonsAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match command with None -> () | Some v -> attribBuilder.Add(ViewAttributes.CommandAttribKey, makeCommand(v)) + match numberOfClicksRequired with None -> () | Some v -> attribBuilder.Add(ViewAttributes.NumberOfClicksRequiredAttribKey, (v)) + match buttons with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ButtonsAttribKey, (v)) attribBuilder - [] - static member val CreateFuncClickGestureRecognizer : (unit -> Xamarin.Forms.ClickGestureRecognizer) = (fun () -> View.CreateClickGestureRecognizer()) + static member val CreateFuncClickGestureRecognizer : (unit -> Xamarin.Forms.ClickGestureRecognizer) = (fun () -> ViewBuilders.CreateClickGestureRecognizer()) - [] - static member CreateClickGestureRecognizer () : Xamarin.Forms.ClickGestureRecognizer = + static member CreateClickGestureRecognizer () : Xamarin.Forms.ClickGestureRecognizer = upcast (new Xamarin.Forms.ClickGestureRecognizer()) - [] - static member val UpdateFuncClickGestureRecognizer = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ClickGestureRecognizer) -> View.UpdateClickGestureRecognizer (prevOpt, curr, target)) + static member val UpdateFuncClickGestureRecognizer = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ClickGestureRecognizer) -> ViewBuilders.UpdateClickGestureRecognizer (prevOpt, curr, target)) - [] static member UpdateClickGestureRecognizer (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ClickGestureRecognizer) = // update the inherited Element element - let baseElement = (if View.ProtoElement.IsNone then View.ProtoElement <- Some (View.Element())); View.ProtoElement.Value + let baseElement = (if ViewProto.ProtoElement.IsNone then ViewProto.ProtoElement <- Some (ViewBuilders.ConstructElement())); ViewProto.ProtoElement.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevCommandOpt = ValueNone let mutable currCommandOpt = ValueNone @@ -1476,21 +1251,21 @@ type View() = let mutable prevButtonsOpt = ValueNone let mutable currButtonsOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._CommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandAttribKey.KeyValue then currCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._NumberOfClicksRequiredAttribKey.KeyValue then + if kvp.Key = ViewAttributes.NumberOfClicksRequiredAttribKey.KeyValue then currNumberOfClicksRequiredOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._ButtonsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ButtonsAttribKey.KeyValue then currButtonsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ButtonsMask) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._CommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandAttribKey.KeyValue then prevCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._NumberOfClicksRequiredAttribKey.KeyValue then + if kvp.Key = ViewAttributes.NumberOfClicksRequiredAttribKey.KeyValue then prevNumberOfClicksRequiredOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._ButtonsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ButtonsAttribKey.KeyValue then prevButtonsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ButtonsMask) match prevCommandOpt, currCommandOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -1508,17 +1283,16 @@ type View() = | ValueSome _, ValueNone -> target.Buttons <- Xamarin.Forms.ButtonsMask.Primary | ValueNone, ValueNone -> () - /// Describes a ClickGestureRecognizer in the view - static member inline ClickGestureRecognizer(?command: unit -> unit, - ?numberOfClicksRequired: int, - ?buttons: Xamarin.Forms.ButtonsMask, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ClickGestureRecognizer -> unit), - ?ref: ViewRef) = + static member ConstructClickGestureRecognizer(?command: unit -> unit, + ?numberOfClicksRequired: int, + ?buttons: Xamarin.Forms.ButtonsMask, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ClickGestureRecognizer -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildClickGestureRecognizer(0, + let attribBuilder = ViewBuilders.BuildClickGestureRecognizer(0, ?command=command, ?numberOfClicksRequired=numberOfClicksRequired, ?buttons=buttons, @@ -1528,13 +1302,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncClickGestureRecognizer, View.UpdateFuncClickGestureRecognizer, attribBuilder) - - [] - static member val ProtoClickGestureRecognizer : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncClickGestureRecognizer, ViewBuilders.UpdateFuncClickGestureRecognizer, attribBuilder) /// Builds the attributes for a PinchGestureRecognizer in the view - [] static member inline BuildPinchGestureRecognizer(attribCount: int, ?isPinching: bool, ?pinchUpdated: Xamarin.Forms.PinchGestureUpdatedEventArgs -> unit, @@ -1547,42 +1317,39 @@ type View() = let attribCount = match isPinching with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match pinchUpdated with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match isPinching with None -> () | Some v -> attribBuilder.Add(View._IsPinchingAttribKey, (v)) - match pinchUpdated with None -> () | Some v -> attribBuilder.Add(View._PinchUpdatedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match isPinching with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsPinchingAttribKey, (v)) + match pinchUpdated with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PinchUpdatedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) attribBuilder - [] - static member val CreateFuncPinchGestureRecognizer : (unit -> Xamarin.Forms.PinchGestureRecognizer) = (fun () -> View.CreatePinchGestureRecognizer()) + static member val CreateFuncPinchGestureRecognizer : (unit -> Xamarin.Forms.PinchGestureRecognizer) = (fun () -> ViewBuilders.CreatePinchGestureRecognizer()) - [] - static member CreatePinchGestureRecognizer () : Xamarin.Forms.PinchGestureRecognizer = + static member CreatePinchGestureRecognizer () : Xamarin.Forms.PinchGestureRecognizer = upcast (new Xamarin.Forms.PinchGestureRecognizer()) - [] - static member val UpdateFuncPinchGestureRecognizer = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.PinchGestureRecognizer) -> View.UpdatePinchGestureRecognizer (prevOpt, curr, target)) + static member val UpdateFuncPinchGestureRecognizer = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.PinchGestureRecognizer) -> ViewBuilders.UpdatePinchGestureRecognizer (prevOpt, curr, target)) - [] static member UpdatePinchGestureRecognizer (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.PinchGestureRecognizer) = // update the inherited Element element - let baseElement = (if View.ProtoElement.IsNone then View.ProtoElement <- Some (View.Element())); View.ProtoElement.Value + let baseElement = (if ViewProto.ProtoElement.IsNone then ViewProto.ProtoElement <- Some (ViewBuilders.ConstructElement())); ViewProto.ProtoElement.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevIsPinchingOpt = ValueNone let mutable currIsPinchingOpt = ValueNone let mutable prevPinchUpdatedOpt = ValueNone let mutable currPinchUpdatedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._IsPinchingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsPinchingAttribKey.KeyValue then currIsPinchingOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._PinchUpdatedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PinchUpdatedAttribKey.KeyValue then currPinchUpdatedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._IsPinchingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsPinchingAttribKey.KeyValue then prevIsPinchingOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._PinchUpdatedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PinchUpdatedAttribKey.KeyValue then prevPinchUpdatedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevIsPinchingOpt, currIsPinchingOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -1596,16 +1363,15 @@ type View() = | ValueSome prevValue, ValueNone -> target.PinchUpdated.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a PinchGestureRecognizer in the view - static member inline PinchGestureRecognizer(?isPinching: bool, - ?pinchUpdated: Xamarin.Forms.PinchGestureUpdatedEventArgs -> unit, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.PinchGestureRecognizer -> unit), - ?ref: ViewRef) = + static member ConstructPinchGestureRecognizer(?isPinching: bool, + ?pinchUpdated: Xamarin.Forms.PinchGestureUpdatedEventArgs -> unit, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.PinchGestureRecognizer -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildPinchGestureRecognizer(0, + let attribBuilder = ViewBuilders.BuildPinchGestureRecognizer(0, ?isPinching=isPinching, ?pinchUpdated=pinchUpdated, ?classId=classId, @@ -1614,13 +1380,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncPinchGestureRecognizer, View.UpdateFuncPinchGestureRecognizer, attribBuilder) - - [] - static member val ProtoPinchGestureRecognizer : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncPinchGestureRecognizer, ViewBuilders.UpdateFuncPinchGestureRecognizer, attribBuilder) /// Builds the attributes for a SwipeGestureRecognizer in the view - [] static member inline BuildSwipeGestureRecognizer(attribCount: int, ?command: unit -> unit, ?direction: Xamarin.Forms.SwipeDirection, @@ -1637,27 +1399,24 @@ type View() = let attribCount = match threshold with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match swiped with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match command with None -> () | Some v -> attribBuilder.Add(View._CommandAttribKey, makeCommand(v)) - match direction with None -> () | Some v -> attribBuilder.Add(View._SwipeGestureRecognizerDirectionAttribKey, (v)) - match threshold with None -> () | Some v -> attribBuilder.Add(View._ThresholdAttribKey, (v)) - match swiped with None -> () | Some v -> attribBuilder.Add(View._SwipedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match command with None -> () | Some v -> attribBuilder.Add(ViewAttributes.CommandAttribKey, makeCommand(v)) + match direction with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SwipeGestureRecognizerDirectionAttribKey, (v)) + match threshold with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ThresholdAttribKey, (v)) + match swiped with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SwipedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) attribBuilder - [] - static member val CreateFuncSwipeGestureRecognizer : (unit -> Xamarin.Forms.SwipeGestureRecognizer) = (fun () -> View.CreateSwipeGestureRecognizer()) + static member val CreateFuncSwipeGestureRecognizer : (unit -> Xamarin.Forms.SwipeGestureRecognizer) = (fun () -> ViewBuilders.CreateSwipeGestureRecognizer()) - [] - static member CreateSwipeGestureRecognizer () : Xamarin.Forms.SwipeGestureRecognizer = + static member CreateSwipeGestureRecognizer () : Xamarin.Forms.SwipeGestureRecognizer = upcast (new Xamarin.Forms.SwipeGestureRecognizer()) - [] - static member val UpdateFuncSwipeGestureRecognizer = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.SwipeGestureRecognizer) -> View.UpdateSwipeGestureRecognizer (prevOpt, curr, target)) + static member val UpdateFuncSwipeGestureRecognizer = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.SwipeGestureRecognizer) -> ViewBuilders.UpdateSwipeGestureRecognizer (prevOpt, curr, target)) - [] static member UpdateSwipeGestureRecognizer (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.SwipeGestureRecognizer) = // update the inherited Element element - let baseElement = (if View.ProtoElement.IsNone then View.ProtoElement <- Some (View.Element())); View.ProtoElement.Value + let baseElement = (if ViewProto.ProtoElement.IsNone then ViewProto.ProtoElement <- Some (ViewBuilders.ConstructElement())); ViewProto.ProtoElement.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevCommandOpt = ValueNone let mutable currCommandOpt = ValueNone @@ -1668,25 +1427,25 @@ type View() = let mutable prevSwipedOpt = ValueNone let mutable currSwipedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._CommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandAttribKey.KeyValue then currCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._SwipeGestureRecognizerDirectionAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SwipeGestureRecognizerDirectionAttribKey.KeyValue then currSwipeGestureRecognizerDirectionOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.SwipeDirection) - if kvp.Key = View._ThresholdAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ThresholdAttribKey.KeyValue then currThresholdOpt <- ValueSome (kvp.Value :?> System.UInt32) - if kvp.Key = View._SwipedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SwipedAttribKey.KeyValue then currSwipedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._CommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandAttribKey.KeyValue then prevCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._SwipeGestureRecognizerDirectionAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SwipeGestureRecognizerDirectionAttribKey.KeyValue then prevSwipeGestureRecognizerDirectionOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.SwipeDirection) - if kvp.Key = View._ThresholdAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ThresholdAttribKey.KeyValue then prevThresholdOpt <- ValueSome (kvp.Value :?> System.UInt32) - if kvp.Key = View._SwipedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SwipedAttribKey.KeyValue then prevSwipedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevCommandOpt, currCommandOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -1710,18 +1469,17 @@ type View() = | ValueSome prevValue, ValueNone -> target.Swiped.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a SwipeGestureRecognizer in the view - static member inline SwipeGestureRecognizer(?command: unit -> unit, - ?direction: Xamarin.Forms.SwipeDirection, - ?threshold: System.UInt32, - ?swiped: Xamarin.Forms.SwipedEventArgs -> unit, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.SwipeGestureRecognizer -> unit), - ?ref: ViewRef) = + static member ConstructSwipeGestureRecognizer(?command: unit -> unit, + ?direction: Xamarin.Forms.SwipeDirection, + ?threshold: System.UInt32, + ?swiped: Xamarin.Forms.SwipedEventArgs -> unit, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.SwipeGestureRecognizer -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildSwipeGestureRecognizer(0, + let attribBuilder = ViewBuilders.BuildSwipeGestureRecognizer(0, ?command=command, ?direction=direction, ?threshold=threshold, @@ -1732,13 +1490,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncSwipeGestureRecognizer, View.UpdateFuncSwipeGestureRecognizer, attribBuilder) - - [] - static member val ProtoSwipeGestureRecognizer : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncSwipeGestureRecognizer, ViewBuilders.UpdateFuncSwipeGestureRecognizer, attribBuilder) /// Builds the attributes for a ActivityIndicator in the view - [] static member inline BuildActivityIndicator(attribCount: int, ?color: Xamarin.Forms.Color, ?isRunning: bool, @@ -1781,42 +1535,39 @@ type View() = let attribCount = match color with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match isRunning with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match color with None -> () | Some v -> attribBuilder.Add(View._ColorAttribKey, (v)) - match isRunning with None -> () | Some v -> attribBuilder.Add(View._IsRunningAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match color with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ColorAttribKey, (v)) + match isRunning with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsRunningAttribKey, (v)) attribBuilder - [] - static member val CreateFuncActivityIndicator : (unit -> Xamarin.Forms.ActivityIndicator) = (fun () -> View.CreateActivityIndicator()) + static member val CreateFuncActivityIndicator : (unit -> Xamarin.Forms.ActivityIndicator) = (fun () -> ViewBuilders.CreateActivityIndicator()) - [] - static member CreateActivityIndicator () : Xamarin.Forms.ActivityIndicator = + static member CreateActivityIndicator () : Xamarin.Forms.ActivityIndicator = upcast (new Xamarin.Forms.ActivityIndicator()) - [] - static member val UpdateFuncActivityIndicator = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ActivityIndicator) -> View.UpdateActivityIndicator (prevOpt, curr, target)) + static member val UpdateFuncActivityIndicator = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ActivityIndicator) -> ViewBuilders.UpdateActivityIndicator (prevOpt, curr, target)) - [] static member UpdateActivityIndicator (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ActivityIndicator) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevColorOpt = ValueNone let mutable currColorOpt = ValueNone let mutable prevIsRunningOpt = ValueNone let mutable currIsRunningOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ColorAttribKey.KeyValue then currColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._IsRunningAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsRunningAttribKey.KeyValue then currIsRunningOpt <- ValueSome (kvp.Value :?> bool) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ColorAttribKey.KeyValue then prevColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._IsRunningAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsRunningAttribKey.KeyValue then prevIsRunningOpt <- ValueSome (kvp.Value :?> bool) match prevColorOpt, currColorOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -1829,46 +1580,45 @@ type View() = | ValueSome _, ValueNone -> target.IsRunning <- false | ValueNone, ValueNone -> () - /// Describes a ActivityIndicator in the view - static member inline ActivityIndicator(?color: Xamarin.Forms.Color, - ?isRunning: bool, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ActivityIndicator -> unit), - ?ref: ViewRef) = + static member ConstructActivityIndicator(?color: Xamarin.Forms.Color, + ?isRunning: bool, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ActivityIndicator -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildActivityIndicator(0, + let attribBuilder = ViewBuilders.BuildActivityIndicator(0, ?color=color, ?isRunning=isRunning, ?horizontalOptions=horizontalOptions, @@ -1907,13 +1657,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncActivityIndicator, View.UpdateFuncActivityIndicator, attribBuilder) - - [] - static member val ProtoActivityIndicator : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncActivityIndicator, ViewBuilders.UpdateFuncActivityIndicator, attribBuilder) /// Builds the attributes for a BoxView in the view - [] static member inline BuildBoxView(attribCount: int, ?color: Xamarin.Forms.Color, ?cornerRadius: Xamarin.Forms.CornerRadius, @@ -1956,42 +1702,39 @@ type View() = let attribCount = match color with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match cornerRadius with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match color with None -> () | Some v -> attribBuilder.Add(View._ColorAttribKey, (v)) - match cornerRadius with None -> () | Some v -> attribBuilder.Add(View._BoxViewCornerRadiusAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match color with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ColorAttribKey, (v)) + match cornerRadius with None -> () | Some v -> attribBuilder.Add(ViewAttributes.BoxViewCornerRadiusAttribKey, (v)) attribBuilder - [] - static member val CreateFuncBoxView : (unit -> Xamarin.Forms.BoxView) = (fun () -> View.CreateBoxView()) + static member val CreateFuncBoxView : (unit -> Xamarin.Forms.BoxView) = (fun () -> ViewBuilders.CreateBoxView()) - [] - static member CreateBoxView () : Xamarin.Forms.BoxView = + static member CreateBoxView () : Xamarin.Forms.BoxView = upcast (new Xamarin.Forms.BoxView()) - [] - static member val UpdateFuncBoxView = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.BoxView) -> View.UpdateBoxView (prevOpt, curr, target)) + static member val UpdateFuncBoxView = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.BoxView) -> ViewBuilders.UpdateBoxView (prevOpt, curr, target)) - [] static member UpdateBoxView (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.BoxView) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevColorOpt = ValueNone let mutable currColorOpt = ValueNone let mutable prevBoxViewCornerRadiusOpt = ValueNone let mutable currBoxViewCornerRadiusOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ColorAttribKey.KeyValue then currColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._BoxViewCornerRadiusAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BoxViewCornerRadiusAttribKey.KeyValue then currBoxViewCornerRadiusOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.CornerRadius) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ColorAttribKey.KeyValue then prevColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._BoxViewCornerRadiusAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BoxViewCornerRadiusAttribKey.KeyValue then prevBoxViewCornerRadiusOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.CornerRadius) match prevColorOpt, currColorOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -2004,46 +1747,45 @@ type View() = | ValueSome _, ValueNone -> target.CornerRadius <- Unchecked.defaultof | ValueNone, ValueNone -> () - /// Describes a BoxView in the view - static member inline BoxView(?color: Xamarin.Forms.Color, - ?cornerRadius: Xamarin.Forms.CornerRadius, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.BoxView -> unit), - ?ref: ViewRef) = + static member ConstructBoxView(?color: Xamarin.Forms.Color, + ?cornerRadius: Xamarin.Forms.CornerRadius, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.BoxView -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildBoxView(0, + let attribBuilder = ViewBuilders.BuildBoxView(0, ?color=color, ?cornerRadius=cornerRadius, ?horizontalOptions=horizontalOptions, @@ -2082,13 +1824,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncBoxView, View.UpdateFuncBoxView, attribBuilder) - - [] - static member val ProtoBoxView : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncBoxView, ViewBuilders.UpdateFuncBoxView, attribBuilder) /// Builds the attributes for a ProgressBar in the view - [] static member inline BuildProgressBar(attribCount: int, ?progress: double, ?horizontalOptions: Xamarin.Forms.LayoutOptions, @@ -2129,35 +1867,32 @@ type View() = let attribCount = match progress with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match progress with None -> () | Some v -> attribBuilder.Add(View._ProgressAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match progress with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ProgressAttribKey, (v)) attribBuilder - [] - static member val CreateFuncProgressBar : (unit -> Xamarin.Forms.ProgressBar) = (fun () -> View.CreateProgressBar()) + static member val CreateFuncProgressBar : (unit -> Xamarin.Forms.ProgressBar) = (fun () -> ViewBuilders.CreateProgressBar()) - [] - static member CreateProgressBar () : Xamarin.Forms.ProgressBar = + static member CreateProgressBar () : Xamarin.Forms.ProgressBar = upcast (new Xamarin.Forms.ProgressBar()) - [] - static member val UpdateFuncProgressBar = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ProgressBar) -> View.UpdateProgressBar (prevOpt, curr, target)) + static member val UpdateFuncProgressBar = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ProgressBar) -> ViewBuilders.UpdateProgressBar (prevOpt, curr, target)) - [] static member UpdateProgressBar (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ProgressBar) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevProgressOpt = ValueNone let mutable currProgressOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ProgressAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ProgressAttribKey.KeyValue then currProgressOpt <- ValueSome (kvp.Value :?> double) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ProgressAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ProgressAttribKey.KeyValue then prevProgressOpt <- ValueSome (kvp.Value :?> double) match prevProgressOpt, currProgressOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -2165,45 +1900,44 @@ type View() = | ValueSome _, ValueNone -> target.Progress <- 0.0 | ValueNone, ValueNone -> () - /// Describes a ProgressBar in the view - static member inline ProgressBar(?progress: double, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ProgressBar -> unit), - ?ref: ViewRef) = + static member ConstructProgressBar(?progress: double, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ProgressBar -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildProgressBar(0, + let attribBuilder = ViewBuilders.BuildProgressBar(0, ?progress=progress, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, @@ -2241,13 +1975,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncProgressBar, View.UpdateFuncProgressBar, attribBuilder) - - [] - static member val ProtoProgressBar : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncProgressBar, ViewBuilders.UpdateFuncProgressBar, attribBuilder) /// Builds the attributes for a Layout in the view - [] static member inline BuildLayout(attribCount: int, ?isClippedToBounds: bool, ?padding: obj, @@ -2290,42 +2020,39 @@ type View() = let attribCount = match isClippedToBounds with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match padding with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match isClippedToBounds with None -> () | Some v -> attribBuilder.Add(View._IsClippedToBoundsAttribKey, (v)) - match padding with None -> () | Some v -> attribBuilder.Add(View._PaddingAttribKey, makeThickness(v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match isClippedToBounds with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsClippedToBoundsAttribKey, (v)) + match padding with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PaddingAttribKey, makeThickness(v)) attribBuilder - [] - static member val CreateFuncLayout : (unit -> Xamarin.Forms.Layout) = (fun () -> View.CreateLayout()) + static member val CreateFuncLayout : (unit -> Xamarin.Forms.Layout) = (fun () -> ViewBuilders.CreateLayout()) - [] - static member CreateLayout () : Xamarin.Forms.Layout = + static member CreateLayout () : Xamarin.Forms.Layout = failwith "can't create Xamarin.Forms.Layout" - [] - static member val UpdateFuncLayout = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Layout) -> View.UpdateLayout (prevOpt, curr, target)) + static member val UpdateFuncLayout = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Layout) -> ViewBuilders.UpdateLayout (prevOpt, curr, target)) - [] static member UpdateLayout (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Layout) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevIsClippedToBoundsOpt = ValueNone let mutable currIsClippedToBoundsOpt = ValueNone let mutable prevPaddingOpt = ValueNone let mutable currPaddingOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._IsClippedToBoundsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsClippedToBoundsAttribKey.KeyValue then currIsClippedToBoundsOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._PaddingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PaddingAttribKey.KeyValue then currPaddingOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Thickness) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._IsClippedToBoundsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsClippedToBoundsAttribKey.KeyValue then prevIsClippedToBoundsOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._PaddingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PaddingAttribKey.KeyValue then prevPaddingOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Thickness) match prevIsClippedToBoundsOpt, currIsClippedToBoundsOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -2338,49 +2065,48 @@ type View() = | ValueSome _, ValueNone -> target.Padding <- Unchecked.defaultof | ValueNone, ValueNone -> () - /// Describes a Layout in the view - static member inline Layout(?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Layout -> unit), - ?ref: ViewRef) = - - let attribBuilder = View.BuildLayout(0, - ?isClippedToBounds=isClippedToBounds, - ?padding=padding, - ?horizontalOptions=horizontalOptions, + static member ConstructLayout(?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Layout -> unit), + ?ref: ViewRef) = + + let attribBuilder = ViewBuilders.BuildLayout(0, + ?isClippedToBounds=isClippedToBounds, + ?padding=padding, + ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, @@ -2416,13 +2142,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncLayout, View.UpdateFuncLayout, attribBuilder) - - [] - static member val ProtoLayout : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncLayout, ViewBuilders.UpdateFuncLayout, attribBuilder) /// Builds the attributes for a ScrollView in the view - [] static member inline BuildScrollView(attribCount: int, ?content: ViewElement, ?orientation: Xamarin.Forms.ScrollOrientation, @@ -2471,27 +2193,24 @@ type View() = let attribCount = match horizontalScrollBarVisibility with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match verticalScrollBarVisibility with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match content with None -> () | Some v -> attribBuilder.Add(View._ContentAttribKey, (v)) - match orientation with None -> () | Some v -> attribBuilder.Add(View._ScrollOrientationAttribKey, (v)) - match horizontalScrollBarVisibility with None -> () | Some v -> attribBuilder.Add(View._HorizontalScrollBarVisibilityAttribKey, (v)) - match verticalScrollBarVisibility with None -> () | Some v -> attribBuilder.Add(View._VerticalScrollBarVisibilityAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match content with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ContentAttribKey, (v)) + match orientation with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ScrollOrientationAttribKey, (v)) + match horizontalScrollBarVisibility with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HorizontalScrollBarVisibilityAttribKey, (v)) + match verticalScrollBarVisibility with None -> () | Some v -> attribBuilder.Add(ViewAttributes.VerticalScrollBarVisibilityAttribKey, (v)) attribBuilder - [] - static member val CreateFuncScrollView : (unit -> Xamarin.Forms.ScrollView) = (fun () -> View.CreateScrollView()) + static member val CreateFuncScrollView : (unit -> Xamarin.Forms.ScrollView) = (fun () -> ViewBuilders.CreateScrollView()) - [] - static member CreateScrollView () : Xamarin.Forms.ScrollView = + static member CreateScrollView () : Xamarin.Forms.ScrollView = upcast (new Xamarin.Forms.ScrollView()) - [] - static member val UpdateFuncScrollView = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ScrollView) -> View.UpdateScrollView (prevOpt, curr, target)) + static member val UpdateFuncScrollView = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ScrollView) -> ViewBuilders.UpdateScrollView (prevOpt, curr, target)) - [] static member UpdateScrollView (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ScrollView) = // update the inherited Layout element - let baseElement = (if View.ProtoLayout.IsNone then View.ProtoLayout <- Some (View.Layout())); View.ProtoLayout.Value + let baseElement = (if ViewProto.ProtoLayout.IsNone then ViewProto.ProtoLayout <- Some (ViewBuilders.ConstructLayout())); ViewProto.ProtoLayout.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevContentOpt = ValueNone let mutable currContentOpt = ValueNone @@ -2502,25 +2221,25 @@ type View() = let mutable prevVerticalScrollBarVisibilityOpt = ValueNone let mutable currVerticalScrollBarVisibilityOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ContentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ContentAttribKey.KeyValue then currContentOpt <- ValueSome (kvp.Value :?> ViewElement) - if kvp.Key = View._ScrollOrientationAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ScrollOrientationAttribKey.KeyValue then currScrollOrientationOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ScrollOrientation) - if kvp.Key = View._HorizontalScrollBarVisibilityAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HorizontalScrollBarVisibilityAttribKey.KeyValue then currHorizontalScrollBarVisibilityOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ScrollBarVisibility) - if kvp.Key = View._VerticalScrollBarVisibilityAttribKey.KeyValue then + if kvp.Key = ViewAttributes.VerticalScrollBarVisibilityAttribKey.KeyValue then currVerticalScrollBarVisibilityOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ScrollBarVisibility) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ContentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ContentAttribKey.KeyValue then prevContentOpt <- ValueSome (kvp.Value :?> ViewElement) - if kvp.Key = View._ScrollOrientationAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ScrollOrientationAttribKey.KeyValue then prevScrollOrientationOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ScrollOrientation) - if kvp.Key = View._HorizontalScrollBarVisibilityAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HorizontalScrollBarVisibilityAttribKey.KeyValue then prevHorizontalScrollBarVisibilityOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ScrollBarVisibility) - if kvp.Key = View._VerticalScrollBarVisibilityAttribKey.KeyValue then + if kvp.Key = ViewAttributes.VerticalScrollBarVisibilityAttribKey.KeyValue then prevVerticalScrollBarVisibilityOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ScrollBarVisibility) match prevContentOpt, currContentOpt with // For structured objects, dependsOn on reference equality @@ -2548,50 +2267,49 @@ type View() = | ValueSome _, ValueNone -> target.VerticalScrollBarVisibility <- Xamarin.Forms.ScrollBarVisibility.Default | ValueNone, ValueNone -> () - /// Describes a ScrollView in the view - static member inline ScrollView(?content: ViewElement, - ?orientation: Xamarin.Forms.ScrollOrientation, - ?horizontalScrollBarVisibility: Xamarin.Forms.ScrollBarVisibility, - ?verticalScrollBarVisibility: Xamarin.Forms.ScrollBarVisibility, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ScrollView -> unit), - ?ref: ViewRef) = + static member ConstructScrollView(?content: ViewElement, + ?orientation: Xamarin.Forms.ScrollOrientation, + ?horizontalScrollBarVisibility: Xamarin.Forms.ScrollBarVisibility, + ?verticalScrollBarVisibility: Xamarin.Forms.ScrollBarVisibility, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ScrollView -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildScrollView(0, + let attribBuilder = ViewBuilders.BuildScrollView(0, ?content=content, ?orientation=orientation, ?horizontalScrollBarVisibility=horizontalScrollBarVisibility, @@ -2634,13 +2352,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncScrollView, View.UpdateFuncScrollView, attribBuilder) - - [] - static member val ProtoScrollView : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncScrollView, ViewBuilders.UpdateFuncScrollView, attribBuilder) /// Builds the attributes for a SearchBar in the view - [] static member inline BuildSearchBar(attribCount: int, ?cancelButtonColor: Xamarin.Forms.Color, ?fontFamily: string, @@ -2703,35 +2417,32 @@ type View() = let attribCount = match textColor with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match textChanged with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match cancelButtonColor with None -> () | Some v -> attribBuilder.Add(View._CancelButtonColorAttribKey, (v)) - match fontFamily with None -> () | Some v -> attribBuilder.Add(View._FontFamilyAttribKey, (v)) - match fontAttributes with None -> () | Some v -> attribBuilder.Add(View._FontAttributesAttribKey, (v)) - match fontSize with None -> () | Some v -> attribBuilder.Add(View._FontSizeAttribKey, makeFontSize(v)) - match horizontalTextAlignment with None -> () | Some v -> attribBuilder.Add(View._HorizontalTextAlignmentAttribKey, (v)) - match placeholder with None -> () | Some v -> attribBuilder.Add(View._PlaceholderAttribKey, (v)) - match placeholderColor with None -> () | Some v -> attribBuilder.Add(View._PlaceholderColorAttribKey, (v)) - match searchCommand with None -> () | Some v -> attribBuilder.Add(View._SearchBarCommandAttribKey, (v)) - match canExecute with None -> () | Some v -> attribBuilder.Add(View._SearchBarCanExecuteAttribKey, (v)) - match text with None -> () | Some v -> attribBuilder.Add(View._TextAttribKey, (v)) - match textColor with None -> () | Some v -> attribBuilder.Add(View._TextColorAttribKey, (v)) - match textChanged with None -> () | Some v -> attribBuilder.Add(View._SearchBarTextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match cancelButtonColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.CancelButtonColorAttribKey, (v)) + match fontFamily with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontFamilyAttribKey, (v)) + match fontAttributes with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontAttributesAttribKey, (v)) + match fontSize with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontSizeAttribKey, makeFontSize(v)) + match horizontalTextAlignment with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HorizontalTextAlignmentAttribKey, (v)) + match placeholder with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PlaceholderAttribKey, (v)) + match placeholderColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PlaceholderColorAttribKey, (v)) + match searchCommand with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SearchBarCommandAttribKey, (v)) + match canExecute with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SearchBarCanExecuteAttribKey, (v)) + match text with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextAttribKey, (v)) + match textColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextColorAttribKey, (v)) + match textChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SearchBarTextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) attribBuilder - [] - static member val CreateFuncSearchBar : (unit -> Xamarin.Forms.SearchBar) = (fun () -> View.CreateSearchBar()) + static member val CreateFuncSearchBar : (unit -> Xamarin.Forms.SearchBar) = (fun () -> ViewBuilders.CreateSearchBar()) - [] - static member CreateSearchBar () : Xamarin.Forms.SearchBar = + static member CreateSearchBar () : Xamarin.Forms.SearchBar = upcast (new Xamarin.Forms.SearchBar()) - [] - static member val UpdateFuncSearchBar = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.SearchBar) -> View.UpdateSearchBar (prevOpt, curr, target)) + static member val UpdateFuncSearchBar = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.SearchBar) -> ViewBuilders.UpdateSearchBar (prevOpt, curr, target)) - [] static member UpdateSearchBar (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.SearchBar) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevCancelButtonColorOpt = ValueNone let mutable currCancelButtonColorOpt = ValueNone @@ -2758,57 +2469,57 @@ type View() = let mutable prevSearchBarTextChangedOpt = ValueNone let mutable currSearchBarTextChangedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._CancelButtonColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CancelButtonColorAttribKey.KeyValue then currCancelButtonColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._FontFamilyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontFamilyAttribKey.KeyValue then currFontFamilyOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontAttributesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontAttributesAttribKey.KeyValue then currFontAttributesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FontAttributes) - if kvp.Key = View._FontSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontSizeAttribKey.KeyValue then currFontSizeOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._HorizontalTextAlignmentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HorizontalTextAlignmentAttribKey.KeyValue then currHorizontalTextAlignmentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextAlignment) - if kvp.Key = View._PlaceholderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderAttribKey.KeyValue then currPlaceholderOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._PlaceholderColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderColorAttribKey.KeyValue then currPlaceholderColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._SearchBarCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SearchBarCommandAttribKey.KeyValue then currSearchBarCommandOpt <- ValueSome (kvp.Value :?> string -> unit) - if kvp.Key = View._SearchBarCanExecuteAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SearchBarCanExecuteAttribKey.KeyValue then currSearchBarCanExecuteOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then currTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then currTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._SearchBarTextChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SearchBarTextChangedAttribKey.KeyValue then currSearchBarTextChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._CancelButtonColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CancelButtonColorAttribKey.KeyValue then prevCancelButtonColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._FontFamilyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontFamilyAttribKey.KeyValue then prevFontFamilyOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontAttributesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontAttributesAttribKey.KeyValue then prevFontAttributesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FontAttributes) - if kvp.Key = View._FontSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontSizeAttribKey.KeyValue then prevFontSizeOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._HorizontalTextAlignmentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HorizontalTextAlignmentAttribKey.KeyValue then prevHorizontalTextAlignmentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextAlignment) - if kvp.Key = View._PlaceholderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderAttribKey.KeyValue then prevPlaceholderOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._PlaceholderColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderColorAttribKey.KeyValue then prevPlaceholderColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._SearchBarCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SearchBarCommandAttribKey.KeyValue then prevSearchBarCommandOpt <- ValueSome (kvp.Value :?> string -> unit) - if kvp.Key = View._SearchBarCanExecuteAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SearchBarCanExecuteAttribKey.KeyValue then prevSearchBarCanExecuteOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then prevTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then prevTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._SearchBarTextChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SearchBarTextChangedAttribKey.KeyValue then prevSearchBarTextChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevCancelButtonColorOpt, currCancelButtonColorOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -2864,56 +2575,55 @@ type View() = | ValueSome prevValue, ValueNone -> target.TextChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a SearchBar in the view - static member inline SearchBar(?cancelButtonColor: Xamarin.Forms.Color, - ?fontFamily: string, - ?fontAttributes: Xamarin.Forms.FontAttributes, - ?fontSize: obj, - ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, - ?placeholder: string, - ?placeholderColor: Xamarin.Forms.Color, - ?searchCommand: string -> unit, - ?canExecute: bool, - ?text: string, - ?textColor: Xamarin.Forms.Color, - ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.SearchBar -> unit), - ?ref: ViewRef) = + static member ConstructSearchBar(?cancelButtonColor: Xamarin.Forms.Color, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?fontSize: obj, + ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, + ?placeholder: string, + ?placeholderColor: Xamarin.Forms.Color, + ?searchCommand: string -> unit, + ?canExecute: bool, + ?text: string, + ?textColor: Xamarin.Forms.Color, + ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.SearchBar -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildSearchBar(0, + let attribBuilder = ViewBuilders.BuildSearchBar(0, ?cancelButtonColor=cancelButtonColor, ?fontFamily=fontFamily, ?fontAttributes=fontAttributes, @@ -2962,13 +2672,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncSearchBar, View.UpdateFuncSearchBar, attribBuilder) - - [] - static member val ProtoSearchBar : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncSearchBar, ViewBuilders.UpdateFuncSearchBar, attribBuilder) /// Builds the attributes for a Button in the view - [] static member inline BuildButton(attribCount: int, ?text: string, ?command: unit -> unit, @@ -3035,37 +2741,34 @@ type View() = let attribCount = match textColor with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match padding with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match text with None -> () | Some v -> attribBuilder.Add(View._TextAttribKey, (v)) - match command with None -> () | Some v -> attribBuilder.Add(View._ButtonCommandAttribKey, (v)) - match canExecute with None -> () | Some v -> attribBuilder.Add(View._ButtonCanExecuteAttribKey, (v)) - match borderColor with None -> () | Some v -> attribBuilder.Add(View._BorderColorAttribKey, (v)) - match borderWidth with None -> () | Some v -> attribBuilder.Add(View._BorderWidthAttribKey, (v)) - match commandParameter with None -> () | Some v -> attribBuilder.Add(View._CommandParameterAttribKey, (v)) - match contentLayout with None -> () | Some v -> attribBuilder.Add(View._ContentLayoutAttribKey, (v)) - match cornerRadius with None -> () | Some v -> attribBuilder.Add(View._ButtonCornerRadiusAttribKey, (v)) - match fontFamily with None -> () | Some v -> attribBuilder.Add(View._FontFamilyAttribKey, (v)) - match fontAttributes with None -> () | Some v -> attribBuilder.Add(View._FontAttributesAttribKey, (v)) - match fontSize with None -> () | Some v -> attribBuilder.Add(View._FontSizeAttribKey, makeFontSize(v)) - match image with None -> () | Some v -> attribBuilder.Add(View._ButtonImageSourceAttribKey, (v)) - match textColor with None -> () | Some v -> attribBuilder.Add(View._TextColorAttribKey, (v)) - match padding with None -> () | Some v -> attribBuilder.Add(View._PaddingAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match text with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextAttribKey, (v)) + match command with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ButtonCommandAttribKey, (v)) + match canExecute with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ButtonCanExecuteAttribKey, (v)) + match borderColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.BorderColorAttribKey, (v)) + match borderWidth with None -> () | Some v -> attribBuilder.Add(ViewAttributes.BorderWidthAttribKey, (v)) + match commandParameter with None -> () | Some v -> attribBuilder.Add(ViewAttributes.CommandParameterAttribKey, (v)) + match contentLayout with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ContentLayoutAttribKey, (v)) + match cornerRadius with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ButtonCornerRadiusAttribKey, (v)) + match fontFamily with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontFamilyAttribKey, (v)) + match fontAttributes with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontAttributesAttribKey, (v)) + match fontSize with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontSizeAttribKey, makeFontSize(v)) + match image with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ButtonImageSourceAttribKey, (v)) + match textColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextColorAttribKey, (v)) + match padding with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PaddingAttribKey, (v)) attribBuilder - [] - static member val CreateFuncButton : (unit -> Xamarin.Forms.Button) = (fun () -> View.CreateButton()) + static member val CreateFuncButton : (unit -> Xamarin.Forms.Button) = (fun () -> ViewBuilders.CreateButton()) - [] - static member CreateButton () : Xamarin.Forms.Button = + static member CreateButton () : Xamarin.Forms.Button = upcast (new Xamarin.Forms.Button()) - [] - static member val UpdateFuncButton = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Button) -> View.UpdateButton (prevOpt, curr, target)) + static member val UpdateFuncButton = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Button) -> ViewBuilders.UpdateButton (prevOpt, curr, target)) - [] static member UpdateButton (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Button) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevTextOpt = ValueNone let mutable currTextOpt = ValueNone @@ -3096,65 +2799,65 @@ type View() = let mutable prevPaddingOpt = ValueNone let mutable currPaddingOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then currTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._ButtonCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ButtonCommandAttribKey.KeyValue then currButtonCommandOpt <- ValueSome (kvp.Value :?> unit -> unit) - if kvp.Key = View._ButtonCanExecuteAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ButtonCanExecuteAttribKey.KeyValue then currButtonCanExecuteOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._BorderColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BorderColorAttribKey.KeyValue then currBorderColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._BorderWidthAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BorderWidthAttribKey.KeyValue then currBorderWidthOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._CommandParameterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandParameterAttribKey.KeyValue then currCommandParameterOpt <- ValueSome (kvp.Value :?> System.Object) - if kvp.Key = View._ContentLayoutAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ContentLayoutAttribKey.KeyValue then currContentLayoutOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Button.ButtonContentLayout) - if kvp.Key = View._ButtonCornerRadiusAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ButtonCornerRadiusAttribKey.KeyValue then currButtonCornerRadiusOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._FontFamilyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontFamilyAttribKey.KeyValue then currFontFamilyOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontAttributesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontAttributesAttribKey.KeyValue then currFontAttributesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FontAttributes) - if kvp.Key = View._FontSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontSizeAttribKey.KeyValue then currFontSizeOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ButtonImageSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ButtonImageSourceAttribKey.KeyValue then currButtonImageSourceOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then currTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._PaddingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PaddingAttribKey.KeyValue then currPaddingOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Thickness) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then prevTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._ButtonCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ButtonCommandAttribKey.KeyValue then prevButtonCommandOpt <- ValueSome (kvp.Value :?> unit -> unit) - if kvp.Key = View._ButtonCanExecuteAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ButtonCanExecuteAttribKey.KeyValue then prevButtonCanExecuteOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._BorderColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BorderColorAttribKey.KeyValue then prevBorderColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._BorderWidthAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BorderWidthAttribKey.KeyValue then prevBorderWidthOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._CommandParameterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandParameterAttribKey.KeyValue then prevCommandParameterOpt <- ValueSome (kvp.Value :?> System.Object) - if kvp.Key = View._ContentLayoutAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ContentLayoutAttribKey.KeyValue then prevContentLayoutOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Button.ButtonContentLayout) - if kvp.Key = View._ButtonCornerRadiusAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ButtonCornerRadiusAttribKey.KeyValue then prevButtonCornerRadiusOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._FontFamilyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontFamilyAttribKey.KeyValue then prevFontFamilyOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontAttributesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontAttributesAttribKey.KeyValue then prevFontAttributesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FontAttributes) - if kvp.Key = View._FontSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontSizeAttribKey.KeyValue then prevFontSizeOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ButtonImageSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ButtonImageSourceAttribKey.KeyValue then prevButtonImageSourceOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then prevTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._PaddingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PaddingAttribKey.KeyValue then prevPaddingOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Thickness) match prevTextOpt, currTextOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -3219,58 +2922,57 @@ type View() = | ValueSome _, ValueNone -> target.Padding <- Unchecked.defaultof | ValueNone, ValueNone -> () - /// Describes a Button in the view - static member inline Button(?text: string, - ?command: unit -> unit, - ?canExecute: bool, - ?borderColor: Xamarin.Forms.Color, - ?borderWidth: double, - ?commandParameter: System.Object, - ?contentLayout: Xamarin.Forms.Button.ButtonContentLayout, - ?cornerRadius: int, - ?fontFamily: string, - ?fontAttributes: Xamarin.Forms.FontAttributes, - ?fontSize: obj, - ?image: string, - ?textColor: Xamarin.Forms.Color, - ?padding: Xamarin.Forms.Thickness, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Button -> unit), - ?ref: ViewRef) = + static member ConstructButton(?text: string, + ?command: unit -> unit, + ?canExecute: bool, + ?borderColor: Xamarin.Forms.Color, + ?borderWidth: double, + ?commandParameter: System.Object, + ?contentLayout: Xamarin.Forms.Button.ButtonContentLayout, + ?cornerRadius: int, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?fontSize: obj, + ?image: string, + ?textColor: Xamarin.Forms.Color, + ?padding: Xamarin.Forms.Thickness, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Button -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildButton(0, + let attribBuilder = ViewBuilders.BuildButton(0, ?text=text, ?command=command, ?canExecute=canExecute, @@ -3321,13 +3023,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncButton, View.UpdateFuncButton, attribBuilder) - - [] - static member val ProtoButton : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncButton, ViewBuilders.UpdateFuncButton, attribBuilder) /// Builds the attributes for a Slider in the view - [] static member inline BuildSlider(attribCount: int, ?minimumMaximum: float * float, ?value: double, @@ -3372,26 +3070,23 @@ type View() = let attribCount = match value with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match valueChanged with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match minimumMaximum with None -> () | Some v -> attribBuilder.Add(View._MinimumMaximumAttribKey, (v)) - match value with None -> () | Some v -> attribBuilder.Add(View._ValueAttribKey, (v)) - match valueChanged with None -> () | Some v -> attribBuilder.Add(View._ValueChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match minimumMaximum with None -> () | Some v -> attribBuilder.Add(ViewAttributes.MinimumMaximumAttribKey, (v)) + match value with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ValueAttribKey, (v)) + match valueChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ValueChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) attribBuilder - [] - static member val CreateFuncSlider : (unit -> Xamarin.Forms.Slider) = (fun () -> View.CreateSlider()) + static member val CreateFuncSlider : (unit -> Xamarin.Forms.Slider) = (fun () -> ViewBuilders.CreateSlider()) - [] - static member CreateSlider () : Xamarin.Forms.Slider = + static member CreateSlider () : Xamarin.Forms.Slider = upcast (new Xamarin.Forms.Slider()) - [] - static member val UpdateFuncSlider = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Slider) -> View.UpdateSlider (prevOpt, curr, target)) + static member val UpdateFuncSlider = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Slider) -> ViewBuilders.UpdateSlider (prevOpt, curr, target)) - [] static member UpdateSlider (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Slider) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevMinimumMaximumOpt = ValueNone let mutable currMinimumMaximumOpt = ValueNone @@ -3400,21 +3095,21 @@ type View() = let mutable prevValueChangedOpt = ValueNone let mutable currValueChangedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._MinimumMaximumAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MinimumMaximumAttribKey.KeyValue then currMinimumMaximumOpt <- ValueSome (kvp.Value :?> float * float) - if kvp.Key = View._ValueAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ValueAttribKey.KeyValue then currValueOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ValueChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ValueChangedAttribKey.KeyValue then currValueChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._MinimumMaximumAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MinimumMaximumAttribKey.KeyValue then prevMinimumMaximumOpt <- ValueSome (kvp.Value :?> float * float) - if kvp.Key = View._ValueAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ValueAttribKey.KeyValue then prevValueOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ValueChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ValueChangedAttribKey.KeyValue then prevValueChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) updateSliderMinimumMaximum prevMinimumMaximumOpt currMinimumMaximumOpt target match prevValueOpt, currValueOpt with @@ -3429,47 +3124,46 @@ type View() = | ValueSome prevValue, ValueNone -> target.ValueChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a Slider in the view - static member inline Slider(?minimumMaximum: float * float, - ?value: double, - ?valueChanged: Xamarin.Forms.ValueChangedEventArgs -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Slider -> unit), - ?ref: ViewRef) = + static member ConstructSlider(?minimumMaximum: float * float, + ?value: double, + ?valueChanged: Xamarin.Forms.ValueChangedEventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Slider -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildSlider(0, + let attribBuilder = ViewBuilders.BuildSlider(0, ?minimumMaximum=minimumMaximum, ?value=value, ?valueChanged=valueChanged, @@ -3509,13 +3203,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncSlider, View.UpdateFuncSlider, attribBuilder) - - [] - static member val ProtoSlider : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncSlider, ViewBuilders.UpdateFuncSlider, attribBuilder) /// Builds the attributes for a Stepper in the view - [] static member inline BuildStepper(attribCount: int, ?minimumMaximum: float * float, ?value: double, @@ -3562,27 +3252,24 @@ type View() = let attribCount = match increment with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match valueChanged with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match minimumMaximum with None -> () | Some v -> attribBuilder.Add(View._MinimumMaximumAttribKey, (v)) - match value with None -> () | Some v -> attribBuilder.Add(View._ValueAttribKey, (v)) - match increment with None -> () | Some v -> attribBuilder.Add(View._IncrementAttribKey, (v)) - match valueChanged with None -> () | Some v -> attribBuilder.Add(View._ValueChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match minimumMaximum with None -> () | Some v -> attribBuilder.Add(ViewAttributes.MinimumMaximumAttribKey, (v)) + match value with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ValueAttribKey, (v)) + match increment with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IncrementAttribKey, (v)) + match valueChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ValueChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) attribBuilder - [] - static member val CreateFuncStepper : (unit -> Xamarin.Forms.Stepper) = (fun () -> View.CreateStepper()) + static member val CreateFuncStepper : (unit -> Xamarin.Forms.Stepper) = (fun () -> ViewBuilders.CreateStepper()) - [] - static member CreateStepper () : Xamarin.Forms.Stepper = + static member CreateStepper () : Xamarin.Forms.Stepper = upcast (new Xamarin.Forms.Stepper()) - [] - static member val UpdateFuncStepper = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Stepper) -> View.UpdateStepper (prevOpt, curr, target)) + static member val UpdateFuncStepper = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Stepper) -> ViewBuilders.UpdateStepper (prevOpt, curr, target)) - [] static member UpdateStepper (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Stepper) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevMinimumMaximumOpt = ValueNone let mutable currMinimumMaximumOpt = ValueNone @@ -3593,25 +3280,25 @@ type View() = let mutable prevValueChangedOpt = ValueNone let mutable currValueChangedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._MinimumMaximumAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MinimumMaximumAttribKey.KeyValue then currMinimumMaximumOpt <- ValueSome (kvp.Value :?> float * float) - if kvp.Key = View._ValueAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ValueAttribKey.KeyValue then currValueOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._IncrementAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IncrementAttribKey.KeyValue then currIncrementOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ValueChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ValueChangedAttribKey.KeyValue then currValueChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._MinimumMaximumAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MinimumMaximumAttribKey.KeyValue then prevMinimumMaximumOpt <- ValueSome (kvp.Value :?> float * float) - if kvp.Key = View._ValueAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ValueAttribKey.KeyValue then prevValueOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._IncrementAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IncrementAttribKey.KeyValue then prevIncrementOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ValueChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ValueChangedAttribKey.KeyValue then prevValueChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) updateStepperMinimumMaximum prevMinimumMaximumOpt currMinimumMaximumOpt target match prevValueOpt, currValueOpt with @@ -3631,48 +3318,47 @@ type View() = | ValueSome prevValue, ValueNone -> target.ValueChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a Stepper in the view - static member inline Stepper(?minimumMaximum: float * float, - ?value: double, - ?increment: double, - ?valueChanged: Xamarin.Forms.ValueChangedEventArgs -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Stepper -> unit), - ?ref: ViewRef) = + static member ConstructStepper(?minimumMaximum: float * float, + ?value: double, + ?increment: double, + ?valueChanged: Xamarin.Forms.ValueChangedEventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Stepper -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildStepper(0, + let attribBuilder = ViewBuilders.BuildStepper(0, ?minimumMaximum=minimumMaximum, ?value=value, ?increment=increment, @@ -3713,13 +3399,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncStepper, View.UpdateFuncStepper, attribBuilder) - - [] - static member val ProtoStepper : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncStepper, ViewBuilders.UpdateFuncStepper, attribBuilder) /// Builds the attributes for a Switch in the view - [] static member inline BuildSwitch(attribCount: int, ?isToggled: bool, ?toggled: Xamarin.Forms.ToggledEventArgs -> unit, @@ -3764,26 +3446,23 @@ type View() = let attribCount = match toggled with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match onColor with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match isToggled with None -> () | Some v -> attribBuilder.Add(View._IsToggledAttribKey, (v)) - match toggled with None -> () | Some v -> attribBuilder.Add(View._ToggledAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) - match onColor with None -> () | Some v -> attribBuilder.Add(View._OnColorAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match isToggled with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsToggledAttribKey, (v)) + match toggled with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ToggledAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + match onColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.OnColorAttribKey, (v)) attribBuilder - [] - static member val CreateFuncSwitch : (unit -> Xamarin.Forms.Switch) = (fun () -> View.CreateSwitch()) + static member val CreateFuncSwitch : (unit -> Xamarin.Forms.Switch) = (fun () -> ViewBuilders.CreateSwitch()) - [] - static member CreateSwitch () : Xamarin.Forms.Switch = + static member CreateSwitch () : Xamarin.Forms.Switch = upcast (new Xamarin.Forms.Switch()) - [] - static member val UpdateFuncSwitch = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Switch) -> View.UpdateSwitch (prevOpt, curr, target)) + static member val UpdateFuncSwitch = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Switch) -> ViewBuilders.UpdateSwitch (prevOpt, curr, target)) - [] static member UpdateSwitch (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Switch) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevIsToggledOpt = ValueNone let mutable currIsToggledOpt = ValueNone @@ -3792,21 +3471,21 @@ type View() = let mutable prevOnColorOpt = ValueNone let mutable currOnColorOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._IsToggledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsToggledAttribKey.KeyValue then currIsToggledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._ToggledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ToggledAttribKey.KeyValue then currToggledOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._OnColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.OnColorAttribKey.KeyValue then currOnColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._IsToggledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsToggledAttribKey.KeyValue then prevIsToggledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._ToggledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ToggledAttribKey.KeyValue then prevToggledOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._OnColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.OnColorAttribKey.KeyValue then prevOnColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) match prevIsToggledOpt, currIsToggledOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -3825,78 +3504,77 @@ type View() = | ValueSome _, ValueNone -> target.OnColor <- Xamarin.Forms.Color.Default | ValueNone, ValueNone -> () - /// Describes a Switch in the view - static member inline Switch(?isToggled: bool, - ?toggled: Xamarin.Forms.ToggledEventArgs -> unit, - ?onColor: Xamarin.Forms.Color, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Switch -> unit), - ?ref: ViewRef) = - - let attribBuilder = View.BuildSwitch(0, - ?isToggled=isToggled, - ?toggled=toggled, - ?onColor=onColor, - ?horizontalOptions=horizontalOptions, - ?verticalOptions=verticalOptions, - ?margin=margin, - ?gestureRecognizers=gestureRecognizers, - ?anchorX=anchorX, - ?anchorY=anchorY, - ?backgroundColor=backgroundColor, - ?heightRequest=heightRequest, - ?inputTransparent=inputTransparent, - ?isEnabled=isEnabled, - ?isVisible=isVisible, - ?minimumHeightRequest=minimumHeightRequest, - ?minimumWidthRequest=minimumWidthRequest, - ?opacity=opacity, - ?rotation=rotation, - ?rotationX=rotationX, - ?rotationY=rotationY, - ?scale=scale, - ?style=style, - ?styleClass=styleClass, - ?translationX=translationX, - ?translationY=translationY, - ?widthRequest=widthRequest, - ?resources=resources, - ?styles=styles, - ?styleSheets=styleSheets, - ?isTabStop=isTabStop, - ?scaleX=scaleX, + static member ConstructSwitch(?isToggled: bool, + ?toggled: Xamarin.Forms.ToggledEventArgs -> unit, + ?onColor: Xamarin.Forms.Color, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Switch -> unit), + ?ref: ViewRef) = + + let attribBuilder = ViewBuilders.BuildSwitch(0, + ?isToggled=isToggled, + ?toggled=toggled, + ?onColor=onColor, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, @@ -3905,13 +3583,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncSwitch, View.UpdateFuncSwitch, attribBuilder) - - [] - static member val ProtoSwitch : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncSwitch, ViewBuilders.UpdateFuncSwitch, attribBuilder) /// Builds the attributes for a Cell in the view - [] static member inline BuildCell(attribCount: int, ?height: double, ?isEnabled: bool, @@ -3924,42 +3598,39 @@ type View() = let attribCount = match height with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match isEnabled with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match height with None -> () | Some v -> attribBuilder.Add(View._HeightAttribKey, (v)) - match isEnabled with None -> () | Some v -> attribBuilder.Add(View._IsEnabledAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match height with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HeightAttribKey, (v)) + match isEnabled with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsEnabledAttribKey, (v)) attribBuilder - [] - static member val CreateFuncCell : (unit -> Xamarin.Forms.Cell) = (fun () -> View.CreateCell()) + static member val CreateFuncCell : (unit -> Xamarin.Forms.Cell) = (fun () -> ViewBuilders.CreateCell()) - [] - static member CreateCell () : Xamarin.Forms.Cell = + static member CreateCell () : Xamarin.Forms.Cell = failwith "can't create Xamarin.Forms.Cell" - [] - static member val UpdateFuncCell = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Cell) -> View.UpdateCell (prevOpt, curr, target)) + static member val UpdateFuncCell = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Cell) -> ViewBuilders.UpdateCell (prevOpt, curr, target)) - [] static member UpdateCell (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Cell) = // update the inherited Element element - let baseElement = (if View.ProtoElement.IsNone then View.ProtoElement <- Some (View.Element())); View.ProtoElement.Value + let baseElement = (if ViewProto.ProtoElement.IsNone then ViewProto.ProtoElement <- Some (ViewBuilders.ConstructElement())); ViewProto.ProtoElement.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevHeightOpt = ValueNone let mutable currHeightOpt = ValueNone let mutable prevIsEnabledOpt = ValueNone let mutable currIsEnabledOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._HeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HeightAttribKey.KeyValue then currHeightOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._IsEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsEnabledAttribKey.KeyValue then currIsEnabledOpt <- ValueSome (kvp.Value :?> bool) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._HeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HeightAttribKey.KeyValue then prevHeightOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._IsEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsEnabledAttribKey.KeyValue then prevIsEnabledOpt <- ValueSome (kvp.Value :?> bool) match prevHeightOpt, currHeightOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -3972,16 +3643,15 @@ type View() = | ValueSome _, ValueNone -> target.IsEnabled <- true | ValueNone, ValueNone -> () - /// Describes a Cell in the view - static member inline Cell(?height: double, - ?isEnabled: bool, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Cell -> unit), - ?ref: ViewRef) = + static member ConstructCell(?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Cell -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildCell(0, + let attribBuilder = ViewBuilders.BuildCell(0, ?height=height, ?isEnabled=isEnabled, ?classId=classId, @@ -3990,13 +3660,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncCell, View.UpdateFuncCell, attribBuilder) - - [] - static member val ProtoCell : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncCell, ViewBuilders.UpdateFuncCell, attribBuilder) /// Builds the attributes for a SwitchCell in the view - [] static member inline BuildSwitchCell(attribCount: int, ?on: bool, ?text: string, @@ -4013,26 +3679,23 @@ type View() = let attribCount = match text with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match onChanged with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildCell(attribCount, ?height=height, ?isEnabled=isEnabled, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match on with None -> () | Some v -> attribBuilder.Add(View._OnAttribKey, (v)) - match text with None -> () | Some v -> attribBuilder.Add(View._TextAttribKey, (v)) - match onChanged with None -> () | Some v -> attribBuilder.Add(View._OnChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildCell(attribCount, ?height=height, ?isEnabled=isEnabled, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match on with None -> () | Some v -> attribBuilder.Add(ViewAttributes.OnAttribKey, (v)) + match text with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextAttribKey, (v)) + match onChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.OnChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) attribBuilder - [] - static member val CreateFuncSwitchCell : (unit -> Xamarin.Forms.SwitchCell) = (fun () -> View.CreateSwitchCell()) + static member val CreateFuncSwitchCell : (unit -> Xamarin.Forms.SwitchCell) = (fun () -> ViewBuilders.CreateSwitchCell()) - [] - static member CreateSwitchCell () : Xamarin.Forms.SwitchCell = + static member CreateSwitchCell () : Xamarin.Forms.SwitchCell = upcast (new Xamarin.Forms.SwitchCell()) - [] - static member val UpdateFuncSwitchCell = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.SwitchCell) -> View.UpdateSwitchCell (prevOpt, curr, target)) + static member val UpdateFuncSwitchCell = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.SwitchCell) -> ViewBuilders.UpdateSwitchCell (prevOpt, curr, target)) - [] static member UpdateSwitchCell (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.SwitchCell) = // update the inherited Cell element - let baseElement = (if View.ProtoCell.IsNone then View.ProtoCell <- Some (View.Cell())); View.ProtoCell.Value + let baseElement = (if ViewProto.ProtoCell.IsNone then ViewProto.ProtoCell <- Some (ViewBuilders.ConstructCell())); ViewProto.ProtoCell.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevOnOpt = ValueNone let mutable currOnOpt = ValueNone @@ -4041,21 +3704,21 @@ type View() = let mutable prevOnChangedOpt = ValueNone let mutable currOnChangedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._OnAttribKey.KeyValue then + if kvp.Key = ViewAttributes.OnAttribKey.KeyValue then currOnOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then currTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._OnChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.OnChangedAttribKey.KeyValue then currOnChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._OnAttribKey.KeyValue then + if kvp.Key = ViewAttributes.OnAttribKey.KeyValue then prevOnOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then prevTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._OnChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.OnChangedAttribKey.KeyValue then prevOnChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOnOpt, currOnOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -4074,19 +3737,18 @@ type View() = | ValueSome prevValue, ValueNone -> target.OnChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a SwitchCell in the view - static member inline SwitchCell(?on: bool, - ?text: string, - ?onChanged: Xamarin.Forms.ToggledEventArgs -> unit, - ?height: double, - ?isEnabled: bool, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.SwitchCell -> unit), - ?ref: ViewRef) = + static member ConstructSwitchCell(?on: bool, + ?text: string, + ?onChanged: Xamarin.Forms.ToggledEventArgs -> unit, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.SwitchCell -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildSwitchCell(0, + let attribBuilder = ViewBuilders.BuildSwitchCell(0, ?on=on, ?text=text, ?onChanged=onChanged, @@ -4098,13 +3760,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncSwitchCell, View.UpdateFuncSwitchCell, attribBuilder) - - [] - static member val ProtoSwitchCell : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncSwitchCell, ViewBuilders.UpdateFuncSwitchCell, attribBuilder) /// Builds the attributes for a TableView in the view - [] static member inline BuildTableView(attribCount: int, ?intent: Xamarin.Forms.TableIntent, ?hasUnevenRows: bool, @@ -4151,27 +3809,24 @@ type View() = let attribCount = match rowHeight with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match items with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match intent with None -> () | Some v -> attribBuilder.Add(View._IntentAttribKey, (v)) - match hasUnevenRows with None -> () | Some v -> attribBuilder.Add(View._HasUnevenRowsAttribKey, (v)) - match rowHeight with None -> () | Some v -> attribBuilder.Add(View._RowHeightAttribKey, (v)) - match items with None -> () | Some v -> attribBuilder.Add(View._TableRootAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun (title, es) -> (title, Array.ofList es)))(v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match intent with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IntentAttribKey, (v)) + match hasUnevenRows with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HasUnevenRowsAttribKey, (v)) + match rowHeight with None -> () | Some v -> attribBuilder.Add(ViewAttributes.RowHeightAttribKey, (v)) + match items with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TableRootAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun (title, es) -> (title, Array.ofList es)))(v)) attribBuilder - [] - static member val CreateFuncTableView : (unit -> Xamarin.Forms.TableView) = (fun () -> View.CreateTableView()) + static member val CreateFuncTableView : (unit -> Xamarin.Forms.TableView) = (fun () -> ViewBuilders.CreateTableView()) - [] - static member CreateTableView () : Xamarin.Forms.TableView = + static member CreateTableView () : Xamarin.Forms.TableView = upcast (new Xamarin.Forms.TableView()) - [] - static member val UpdateFuncTableView = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TableView) -> View.UpdateTableView (prevOpt, curr, target)) + static member val UpdateFuncTableView = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TableView) -> ViewBuilders.UpdateTableView (prevOpt, curr, target)) - [] static member UpdateTableView (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.TableView) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevIntentOpt = ValueNone let mutable currIntentOpt = ValueNone @@ -4182,25 +3837,25 @@ type View() = let mutable prevTableRootOpt = ValueNone let mutable currTableRootOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._IntentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IntentAttribKey.KeyValue then currIntentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TableIntent) - if kvp.Key = View._HasUnevenRowsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HasUnevenRowsAttribKey.KeyValue then currHasUnevenRowsOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._RowHeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RowHeightAttribKey.KeyValue then currRowHeightOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._TableRootAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TableRootAttribKey.KeyValue then currTableRootOpt <- ValueSome (kvp.Value :?> (string * ViewElement[])[]) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._IntentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IntentAttribKey.KeyValue then prevIntentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TableIntent) - if kvp.Key = View._HasUnevenRowsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HasUnevenRowsAttribKey.KeyValue then prevHasUnevenRowsOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._RowHeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RowHeightAttribKey.KeyValue then prevRowHeightOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._TableRootAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TableRootAttribKey.KeyValue then prevTableRootOpt <- ValueSome (kvp.Value :?> (string * ViewElement[])[]) match prevIntentOpt, currIntentOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -4219,48 +3874,47 @@ type View() = | ValueNone, ValueNone -> () updateTableViewItems prevTableRootOpt currTableRootOpt target - /// Describes a TableView in the view - static member inline TableView(?intent: Xamarin.Forms.TableIntent, - ?hasUnevenRows: bool, - ?rowHeight: int, - ?items: (string * ViewElement list) list, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.TableView -> unit), - ?ref: ViewRef) = + static member ConstructTableView(?intent: Xamarin.Forms.TableIntent, + ?hasUnevenRows: bool, + ?rowHeight: int, + ?items: (string * ViewElement list) list, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TableView -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildTableView(0, + let attribBuilder = ViewBuilders.BuildTableView(0, ?intent=intent, ?hasUnevenRows=hasUnevenRows, ?rowHeight=rowHeight, @@ -4301,44 +3955,37 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncTableView, View.UpdateFuncTableView, attribBuilder) - - [] - static member val ProtoTableView : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncTableView, ViewBuilders.UpdateFuncTableView, attribBuilder) /// Builds the attributes for a RowDefinition in the view - [] static member inline BuildRowDefinition(attribCount: int, ?height: obj) = let attribCount = match height with Some _ -> attribCount + 1 | None -> attribCount let attribBuilder = new AttributesBuilder(attribCount) - match height with None -> () | Some v -> attribBuilder.Add(View._RowDefinitionHeightAttribKey, makeGridLength(v)) + match height with None -> () | Some v -> attribBuilder.Add(ViewAttributes.RowDefinitionHeightAttribKey, makeGridLength(v)) attribBuilder - [] - static member val CreateFuncRowDefinition : (unit -> Xamarin.Forms.RowDefinition) = (fun () -> View.CreateRowDefinition()) + static member val CreateFuncRowDefinition : (unit -> Xamarin.Forms.RowDefinition) = (fun () -> ViewBuilders.CreateRowDefinition()) - [] - static member CreateRowDefinition () : Xamarin.Forms.RowDefinition = + static member CreateRowDefinition () : Xamarin.Forms.RowDefinition = upcast (new Xamarin.Forms.RowDefinition()) - [] - static member val UpdateFuncRowDefinition = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.RowDefinition) -> View.UpdateRowDefinition (prevOpt, curr, target)) + static member val UpdateFuncRowDefinition = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.RowDefinition) -> ViewBuilders.UpdateRowDefinition (prevOpt, curr, target)) - [] static member UpdateRowDefinition (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.RowDefinition) = let mutable prevRowDefinitionHeightOpt = ValueNone let mutable currRowDefinitionHeightOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._RowDefinitionHeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RowDefinitionHeightAttribKey.KeyValue then currRowDefinitionHeightOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.GridLength) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._RowDefinitionHeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RowDefinitionHeightAttribKey.KeyValue then prevRowDefinitionHeightOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.GridLength) match prevRowDefinitionHeightOpt, currRowDefinitionHeightOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -4346,50 +3993,42 @@ type View() = | ValueSome _, ValueNone -> target.Height <- Xamarin.Forms.GridLength.Auto | ValueNone, ValueNone -> () - /// Describes a RowDefinition in the view - static member inline RowDefinition(?height: obj) = + static member ConstructRowDefinition(?height: obj) = - let attribBuilder = View.BuildRowDefinition(0, + let attribBuilder = ViewBuilders.BuildRowDefinition(0, ?height=height) - ViewElement.Create(View.CreateFuncRowDefinition, View.UpdateFuncRowDefinition, attribBuilder) - - [] - static member val ProtoRowDefinition : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncRowDefinition, ViewBuilders.UpdateFuncRowDefinition, attribBuilder) /// Builds the attributes for a ColumnDefinition in the view - [] static member inline BuildColumnDefinition(attribCount: int, ?width: obj) = let attribCount = match width with Some _ -> attribCount + 1 | None -> attribCount let attribBuilder = new AttributesBuilder(attribCount) - match width with None -> () | Some v -> attribBuilder.Add(View._ColumnDefinitionWidthAttribKey, makeGridLength(v)) + match width with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ColumnDefinitionWidthAttribKey, makeGridLength(v)) attribBuilder - [] - static member val CreateFuncColumnDefinition : (unit -> Xamarin.Forms.ColumnDefinition) = (fun () -> View.CreateColumnDefinition()) + static member val CreateFuncColumnDefinition : (unit -> Xamarin.Forms.ColumnDefinition) = (fun () -> ViewBuilders.CreateColumnDefinition()) - [] - static member CreateColumnDefinition () : Xamarin.Forms.ColumnDefinition = + static member CreateColumnDefinition () : Xamarin.Forms.ColumnDefinition = upcast (new Xamarin.Forms.ColumnDefinition()) - [] - static member val UpdateFuncColumnDefinition = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ColumnDefinition) -> View.UpdateColumnDefinition (prevOpt, curr, target)) + static member val UpdateFuncColumnDefinition = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ColumnDefinition) -> ViewBuilders.UpdateColumnDefinition (prevOpt, curr, target)) - [] static member UpdateColumnDefinition (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ColumnDefinition) = let mutable prevColumnDefinitionWidthOpt = ValueNone let mutable currColumnDefinitionWidthOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ColumnDefinitionWidthAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ColumnDefinitionWidthAttribKey.KeyValue then currColumnDefinitionWidthOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.GridLength) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ColumnDefinitionWidthAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ColumnDefinitionWidthAttribKey.KeyValue then prevColumnDefinitionWidthOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.GridLength) match prevColumnDefinitionWidthOpt, currColumnDefinitionWidthOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -4397,19 +4036,14 @@ type View() = | ValueSome _, ValueNone -> target.Width <- Xamarin.Forms.GridLength.Auto | ValueNone, ValueNone -> () - /// Describes a ColumnDefinition in the view - static member inline ColumnDefinition(?width: obj) = + static member ConstructColumnDefinition(?width: obj) = - let attribBuilder = View.BuildColumnDefinition(0, + let attribBuilder = ViewBuilders.BuildColumnDefinition(0, ?width=width) - ViewElement.Create(View.CreateFuncColumnDefinition, View.UpdateFuncColumnDefinition, attribBuilder) - - [] - static member val ProtoColumnDefinition : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncColumnDefinition, ViewBuilders.UpdateFuncColumnDefinition, attribBuilder) /// Builds the attributes for a Grid in the view - [] static member inline BuildGrid(attribCount: int, ?rowdefs: obj list, ?coldefs: obj list, @@ -4460,28 +4094,25 @@ type View() = let attribCount = match columnSpacing with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match children with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match rowdefs with None -> () | Some v -> attribBuilder.Add(View._GridRowDefinitionsAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun h -> View.RowDefinition(height=h)))(v)) - match coldefs with None -> () | Some v -> attribBuilder.Add(View._GridColumnDefinitionsAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun h -> View.ColumnDefinition(width=h)))(v)) - match rowSpacing with None -> () | Some v -> attribBuilder.Add(View._RowSpacingAttribKey, (v)) - match columnSpacing with None -> () | Some v -> attribBuilder.Add(View._ColumnSpacingAttribKey, (v)) - match children with None -> () | Some v -> attribBuilder.Add(View._ChildrenAttribKey, Array.ofList(v)) + let attribBuilder = ViewBuilders.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match rowdefs with None -> () | Some v -> attribBuilder.Add(ViewAttributes.GridRowDefinitionsAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun h -> ViewBuilders.ConstructRowDefinition(height=h)))(v)) + match coldefs with None -> () | Some v -> attribBuilder.Add(ViewAttributes.GridColumnDefinitionsAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun h -> ViewBuilders.ConstructColumnDefinition(width=h)))(v)) + match rowSpacing with None -> () | Some v -> attribBuilder.Add(ViewAttributes.RowSpacingAttribKey, (v)) + match columnSpacing with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ColumnSpacingAttribKey, (v)) + match children with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ChildrenAttribKey, Array.ofList(v)) attribBuilder - [] - static member val CreateFuncGrid : (unit -> Xamarin.Forms.Grid) = (fun () -> View.CreateGrid()) + static member val CreateFuncGrid : (unit -> Xamarin.Forms.Grid) = (fun () -> ViewBuilders.CreateGrid()) - [] - static member CreateGrid () : Xamarin.Forms.Grid = + static member CreateGrid () : Xamarin.Forms.Grid = upcast (new Xamarin.Forms.Grid()) - [] - static member val UpdateFuncGrid = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Grid) -> View.UpdateGrid (prevOpt, curr, target)) + static member val UpdateFuncGrid = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Grid) -> ViewBuilders.UpdateGrid (prevOpt, curr, target)) - [] static member UpdateGrid (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Grid) = // update the inherited Layout element - let baseElement = (if View.ProtoLayout.IsNone then View.ProtoLayout <- Some (View.Layout())); View.ProtoLayout.Value + let baseElement = (if ViewProto.ProtoLayout.IsNone then ViewProto.ProtoLayout <- Some (ViewBuilders.ConstructLayout())); ViewProto.ProtoLayout.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevGridRowDefinitionsOpt = ValueNone let mutable currGridRowDefinitionsOpt = ValueNone @@ -4494,29 +4125,29 @@ type View() = let mutable prevChildrenOpt = ValueNone let mutable currChildrenOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._GridRowDefinitionsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.GridRowDefinitionsAttribKey.KeyValue then currGridRowDefinitionsOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._GridColumnDefinitionsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.GridColumnDefinitionsAttribKey.KeyValue then currGridColumnDefinitionsOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._RowSpacingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RowSpacingAttribKey.KeyValue then currRowSpacingOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ColumnSpacingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ColumnSpacingAttribKey.KeyValue then currColumnSpacingOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then currChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._GridRowDefinitionsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.GridRowDefinitionsAttribKey.KeyValue then prevGridRowDefinitionsOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._GridColumnDefinitionsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.GridColumnDefinitionsAttribKey.KeyValue then prevGridColumnDefinitionsOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._RowSpacingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RowSpacingAttribKey.KeyValue then prevRowSpacingOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ColumnSpacingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ColumnSpacingAttribKey.KeyValue then prevColumnSpacingOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then prevChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) updateCollectionGeneric prevGridRowDefinitionsOpt currGridRowDefinitionsOpt target.RowDefinitions (fun (x:ViewElement) -> x.Create() :?> Xamarin.Forms.RowDefinition) @@ -4542,32 +4173,32 @@ type View() = (fun (x:ViewElement) -> x.Create() :?> Xamarin.Forms.View) (fun prevChildOpt newChild targetChild -> // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._GridRowAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._GridRowAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.GridRowAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.GridRowAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.Grid.SetRow(targetChild, currChildValue) | ValueSome _, ValueNone -> Xamarin.Forms.Grid.SetRow(targetChild, 0) | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._GridRowSpanAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._GridRowSpanAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.GridRowSpanAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.GridRowSpanAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.Grid.SetRowSpan(targetChild, currChildValue) | ValueSome _, ValueNone -> Xamarin.Forms.Grid.SetRowSpan(targetChild, 0) | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._GridColumnAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._GridColumnAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.GridColumnAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.GridColumnAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.Grid.SetColumn(targetChild, currChildValue) | ValueSome _, ValueNone -> Xamarin.Forms.Grid.SetColumn(targetChild, 0) | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._GridColumnSpanAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._GridColumnSpanAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.GridColumnSpanAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.GridColumnSpanAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.Grid.SetColumnSpan(targetChild, currChildValue) @@ -4577,51 +4208,50 @@ type View() = canReuseChild updateChild - /// Describes a Grid in the view - static member inline Grid(?rowdefs: obj list, - ?coldefs: obj list, - ?rowSpacing: double, - ?columnSpacing: double, - ?children: ViewElement list, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Grid -> unit), - ?ref: ViewRef) = + static member ConstructGrid(?rowdefs: obj list, + ?coldefs: obj list, + ?rowSpacing: double, + ?columnSpacing: double, + ?children: ViewElement list, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Grid -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildGrid(0, + let attribBuilder = ViewBuilders.BuildGrid(0, ?rowdefs=rowdefs, ?coldefs=coldefs, ?rowSpacing=rowSpacing, @@ -4665,13 +4295,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncGrid, View.UpdateFuncGrid, attribBuilder) - - [] - static member val ProtoGrid : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncGrid, ViewBuilders.UpdateFuncGrid, attribBuilder) /// Builds the attributes for a AbsoluteLayout in the view - [] static member inline BuildAbsoluteLayout(attribCount: int, ?children: ViewElement list, ?isClippedToBounds: bool, @@ -4714,50 +4340,47 @@ type View() = let attribCount = match children with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match children with None -> () | Some v -> attribBuilder.Add(View._ChildrenAttribKey, Array.ofList(v)) + let attribBuilder = ViewBuilders.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match children with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ChildrenAttribKey, Array.ofList(v)) attribBuilder - [] - static member val CreateFuncAbsoluteLayout : (unit -> Xamarin.Forms.AbsoluteLayout) = (fun () -> View.CreateAbsoluteLayout()) + static member val CreateFuncAbsoluteLayout : (unit -> Xamarin.Forms.AbsoluteLayout) = (fun () -> ViewBuilders.CreateAbsoluteLayout()) - [] - static member CreateAbsoluteLayout () : Xamarin.Forms.AbsoluteLayout = + static member CreateAbsoluteLayout () : Xamarin.Forms.AbsoluteLayout = upcast (new Xamarin.Forms.AbsoluteLayout()) - [] - static member val UpdateFuncAbsoluteLayout = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.AbsoluteLayout) -> View.UpdateAbsoluteLayout (prevOpt, curr, target)) + static member val UpdateFuncAbsoluteLayout = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.AbsoluteLayout) -> ViewBuilders.UpdateAbsoluteLayout (prevOpt, curr, target)) - [] static member UpdateAbsoluteLayout (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.AbsoluteLayout) = // update the inherited Layout element - let baseElement = (if View.ProtoLayout.IsNone then View.ProtoLayout <- Some (View.Layout())); View.ProtoLayout.Value + let baseElement = (if ViewProto.ProtoLayout.IsNone then ViewProto.ProtoLayout <- Some (ViewBuilders.ConstructLayout())); ViewProto.ProtoLayout.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevChildrenOpt = ValueNone let mutable currChildrenOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then currChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then prevChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) updateCollectionGeneric prevChildrenOpt currChildrenOpt target.Children (fun (x:ViewElement) -> x.Create() :?> Xamarin.Forms.View) (fun prevChildOpt newChild targetChild -> // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._LayoutBoundsAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._LayoutBoundsAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.LayoutBoundsAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.LayoutBoundsAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.AbsoluteLayout.SetLayoutBounds(targetChild, currChildValue) | ValueSome _, ValueNone -> Xamarin.Forms.AbsoluteLayout.SetLayoutBounds(targetChild, Xamarin.Forms.Rectangle.Zero) | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._LayoutFlagsAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._LayoutFlagsAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.LayoutFlagsAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.LayoutFlagsAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.AbsoluteLayout.SetLayoutFlags(targetChild, currChildValue) @@ -4767,47 +4390,46 @@ type View() = canReuseChild updateChild - /// Describes a AbsoluteLayout in the view - static member inline AbsoluteLayout(?children: ViewElement list, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.AbsoluteLayout -> unit), - ?ref: ViewRef) = + static member ConstructAbsoluteLayout(?children: ViewElement list, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.AbsoluteLayout -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildAbsoluteLayout(0, + let attribBuilder = ViewBuilders.BuildAbsoluteLayout(0, ?children=children, ?isClippedToBounds=isClippedToBounds, ?padding=padding, @@ -4847,13 +4469,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncAbsoluteLayout, View.UpdateFuncAbsoluteLayout, attribBuilder) - - [] - static member val ProtoAbsoluteLayout : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncAbsoluteLayout, ViewBuilders.UpdateFuncAbsoluteLayout, attribBuilder) /// Builds the attributes for a RelativeLayout in the view - [] static member inline BuildRelativeLayout(attribCount: int, ?children: ViewElement list, ?isClippedToBounds: bool, @@ -4896,74 +4514,71 @@ type View() = let attribCount = match children with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match children with None -> () | Some v -> attribBuilder.Add(View._ChildrenAttribKey, Array.ofList(v)) + let attribBuilder = ViewBuilders.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match children with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ChildrenAttribKey, Array.ofList(v)) attribBuilder - [] - static member val CreateFuncRelativeLayout : (unit -> Xamarin.Forms.RelativeLayout) = (fun () -> View.CreateRelativeLayout()) + static member val CreateFuncRelativeLayout : (unit -> Xamarin.Forms.RelativeLayout) = (fun () -> ViewBuilders.CreateRelativeLayout()) - [] - static member CreateRelativeLayout () : Xamarin.Forms.RelativeLayout = + static member CreateRelativeLayout () : Xamarin.Forms.RelativeLayout = upcast (new Xamarin.Forms.RelativeLayout()) - [] - static member val UpdateFuncRelativeLayout = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.RelativeLayout) -> View.UpdateRelativeLayout (prevOpt, curr, target)) + static member val UpdateFuncRelativeLayout = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.RelativeLayout) -> ViewBuilders.UpdateRelativeLayout (prevOpt, curr, target)) - [] static member UpdateRelativeLayout (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.RelativeLayout) = // update the inherited Layout element - let baseElement = (if View.ProtoLayout.IsNone then View.ProtoLayout <- Some (View.Layout())); View.ProtoLayout.Value + let baseElement = (if ViewProto.ProtoLayout.IsNone then ViewProto.ProtoLayout <- Some (ViewBuilders.ConstructLayout())); ViewProto.ProtoLayout.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevChildrenOpt = ValueNone let mutable currChildrenOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then currChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then prevChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) updateCollectionGeneric prevChildrenOpt currChildrenOpt target.Children (fun (x:ViewElement) -> x.Create() :?> Xamarin.Forms.View) (fun prevChildOpt newChild targetChild -> // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._BoundsConstraintAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._BoundsConstraintAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.BoundsConstraintAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.BoundsConstraintAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.RelativeLayout.SetBoundsConstraint(targetChild, currChildValue) | ValueSome _, ValueNone -> Xamarin.Forms.RelativeLayout.SetBoundsConstraint(targetChild, null) | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._HeightConstraintAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._HeightConstraintAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.HeightConstraintAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.HeightConstraintAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.RelativeLayout.SetHeightConstraint(targetChild, currChildValue) | ValueSome _, ValueNone -> Xamarin.Forms.RelativeLayout.SetHeightConstraint(targetChild, null) | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._WidthConstraintAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._WidthConstraintAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.WidthConstraintAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.WidthConstraintAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.RelativeLayout.SetWidthConstraint(targetChild, currChildValue) | ValueSome _, ValueNone -> Xamarin.Forms.RelativeLayout.SetWidthConstraint(targetChild, null) | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._XConstraintAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._XConstraintAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.XConstraintAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.XConstraintAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.RelativeLayout.SetXConstraint(targetChild, currChildValue) | ValueSome _, ValueNone -> Xamarin.Forms.RelativeLayout.SetXConstraint(targetChild, null) | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._YConstraintAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._YConstraintAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.YConstraintAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.YConstraintAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.RelativeLayout.SetYConstraint(targetChild, currChildValue) @@ -4973,47 +4588,46 @@ type View() = canReuseChild updateChild - /// Describes a RelativeLayout in the view - static member inline RelativeLayout(?children: ViewElement list, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.RelativeLayout -> unit), - ?ref: ViewRef) = + static member ConstructRelativeLayout(?children: ViewElement list, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.RelativeLayout -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildRelativeLayout(0, + let attribBuilder = ViewBuilders.BuildRelativeLayout(0, ?children=children, ?isClippedToBounds=isClippedToBounds, ?padding=padding, @@ -5053,13 +4667,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncRelativeLayout, View.UpdateFuncRelativeLayout, attribBuilder) - - [] - static member val ProtoRelativeLayout : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncRelativeLayout, ViewBuilders.UpdateFuncRelativeLayout, attribBuilder) /// Builds the attributes for a FlexLayout in the view - [] static member inline BuildFlexLayout(attribCount: int, ?alignContent: Xamarin.Forms.FlexAlignContent, ?alignItems: Xamarin.Forms.FlexAlignItems, @@ -5114,30 +4724,27 @@ type View() = let attribCount = match justifyContent with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match children with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match alignContent with None -> () | Some v -> attribBuilder.Add(View._AlignContentAttribKey, (v)) - match alignItems with None -> () | Some v -> attribBuilder.Add(View._AlignItemsAttribKey, (v)) - match direction with None -> () | Some v -> attribBuilder.Add(View._FlexLayoutDirectionAttribKey, (v)) - match position with None -> () | Some v -> attribBuilder.Add(View._PositionAttribKey, (v)) - match wrap with None -> () | Some v -> attribBuilder.Add(View._WrapAttribKey, (v)) - match justifyContent with None -> () | Some v -> attribBuilder.Add(View._JustifyContentAttribKey, (v)) - match children with None -> () | Some v -> attribBuilder.Add(View._ChildrenAttribKey, Array.ofList(v)) + let attribBuilder = ViewBuilders.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match alignContent with None -> () | Some v -> attribBuilder.Add(ViewAttributes.AlignContentAttribKey, (v)) + match alignItems with None -> () | Some v -> attribBuilder.Add(ViewAttributes.AlignItemsAttribKey, (v)) + match direction with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FlexLayoutDirectionAttribKey, (v)) + match position with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PositionAttribKey, (v)) + match wrap with None -> () | Some v -> attribBuilder.Add(ViewAttributes.WrapAttribKey, (v)) + match justifyContent with None -> () | Some v -> attribBuilder.Add(ViewAttributes.JustifyContentAttribKey, (v)) + match children with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ChildrenAttribKey, Array.ofList(v)) attribBuilder - [] - static member val CreateFuncFlexLayout : (unit -> Xamarin.Forms.FlexLayout) = (fun () -> View.CreateFlexLayout()) + static member val CreateFuncFlexLayout : (unit -> Xamarin.Forms.FlexLayout) = (fun () -> ViewBuilders.CreateFlexLayout()) - [] - static member CreateFlexLayout () : Xamarin.Forms.FlexLayout = + static member CreateFlexLayout () : Xamarin.Forms.FlexLayout = upcast (new Xamarin.Forms.FlexLayout()) - [] - static member val UpdateFuncFlexLayout = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.FlexLayout) -> View.UpdateFlexLayout (prevOpt, curr, target)) + static member val UpdateFuncFlexLayout = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.FlexLayout) -> ViewBuilders.UpdateFlexLayout (prevOpt, curr, target)) - [] static member UpdateFlexLayout (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.FlexLayout) = // update the inherited Layout element - let baseElement = (if View.ProtoLayout.IsNone then View.ProtoLayout <- Some (View.Layout())); View.ProtoLayout.Value + let baseElement = (if ViewProto.ProtoLayout.IsNone then ViewProto.ProtoLayout <- Some (ViewBuilders.ConstructLayout())); ViewProto.ProtoLayout.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevAlignContentOpt = ValueNone let mutable currAlignContentOpt = ValueNone @@ -5154,37 +4761,37 @@ type View() = let mutable prevChildrenOpt = ValueNone let mutable currChildrenOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._AlignContentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AlignContentAttribKey.KeyValue then currAlignContentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FlexAlignContent) - if kvp.Key = View._AlignItemsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AlignItemsAttribKey.KeyValue then currAlignItemsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FlexAlignItems) - if kvp.Key = View._FlexLayoutDirectionAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FlexLayoutDirectionAttribKey.KeyValue then currFlexLayoutDirectionOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FlexDirection) - if kvp.Key = View._PositionAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PositionAttribKey.KeyValue then currPositionOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FlexPosition) - if kvp.Key = View._WrapAttribKey.KeyValue then + if kvp.Key = ViewAttributes.WrapAttribKey.KeyValue then currWrapOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FlexWrap) - if kvp.Key = View._JustifyContentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.JustifyContentAttribKey.KeyValue then currJustifyContentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FlexJustify) - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then currChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._AlignContentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AlignContentAttribKey.KeyValue then prevAlignContentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FlexAlignContent) - if kvp.Key = View._AlignItemsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AlignItemsAttribKey.KeyValue then prevAlignItemsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FlexAlignItems) - if kvp.Key = View._FlexLayoutDirectionAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FlexLayoutDirectionAttribKey.KeyValue then prevFlexLayoutDirectionOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FlexDirection) - if kvp.Key = View._PositionAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PositionAttribKey.KeyValue then prevPositionOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FlexPosition) - if kvp.Key = View._WrapAttribKey.KeyValue then + if kvp.Key = ViewAttributes.WrapAttribKey.KeyValue then prevWrapOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FlexWrap) - if kvp.Key = View._JustifyContentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.JustifyContentAttribKey.KeyValue then prevJustifyContentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FlexJustify) - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then prevChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) match prevAlignContentOpt, currAlignContentOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -5220,40 +4827,40 @@ type View() = (fun (x:ViewElement) -> x.Create() :?> Xamarin.Forms.View) (fun prevChildOpt newChild targetChild -> // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._FlexAlignSelfAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._FlexAlignSelfAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.FlexAlignSelfAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.FlexAlignSelfAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.FlexLayout.SetAlignSelf(targetChild, currChildValue) | ValueSome _, ValueNone -> Xamarin.Forms.FlexLayout.SetAlignSelf(targetChild, Unchecked.defaultof) | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._FlexOrderAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._FlexOrderAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.FlexOrderAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.FlexOrderAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.FlexLayout.SetOrder(targetChild, currChildValue) | ValueSome _, ValueNone -> Xamarin.Forms.FlexLayout.SetOrder(targetChild, 0) | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._FlexBasisAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._FlexBasisAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.FlexBasisAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.FlexBasisAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.FlexLayout.SetBasis(targetChild, currChildValue) | ValueSome _, ValueNone -> Xamarin.Forms.FlexLayout.SetBasis(targetChild, Unchecked.defaultof) | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._FlexGrowAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._FlexGrowAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.FlexGrowAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.FlexGrowAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.FlexLayout.SetGrow(targetChild, currChildValue) | ValueSome _, ValueNone -> Xamarin.Forms.FlexLayout.SetGrow(targetChild, 0.0f) | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._FlexShrinkAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._FlexShrinkAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.FlexShrinkAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.FlexShrinkAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currChildValue when prevChildValue = currChildValue -> () | _, ValueSome currChildValue -> Xamarin.Forms.FlexLayout.SetShrink(targetChild, currChildValue) @@ -5263,53 +4870,52 @@ type View() = canReuseChild updateChild - /// Describes a FlexLayout in the view - static member inline FlexLayout(?alignContent: Xamarin.Forms.FlexAlignContent, - ?alignItems: Xamarin.Forms.FlexAlignItems, - ?direction: Xamarin.Forms.FlexDirection, - ?position: Xamarin.Forms.FlexPosition, - ?wrap: Xamarin.Forms.FlexWrap, - ?justifyContent: Xamarin.Forms.FlexJustify, - ?children: ViewElement list, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.FlexLayout -> unit), - ?ref: ViewRef) = + static member ConstructFlexLayout(?alignContent: Xamarin.Forms.FlexAlignContent, + ?alignItems: Xamarin.Forms.FlexAlignItems, + ?direction: Xamarin.Forms.FlexDirection, + ?position: Xamarin.Forms.FlexPosition, + ?wrap: Xamarin.Forms.FlexWrap, + ?justifyContent: Xamarin.Forms.FlexJustify, + ?children: ViewElement list, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.FlexLayout -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildFlexLayout(0, + let attribBuilder = ViewBuilders.BuildFlexLayout(0, ?alignContent=alignContent, ?alignItems=alignItems, ?direction=direction, @@ -5355,13 +4961,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncFlexLayout, View.UpdateFuncFlexLayout, attribBuilder) - - [] - static member val ProtoFlexLayout : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncFlexLayout, ViewBuilders.UpdateFuncFlexLayout, attribBuilder) /// Builds the attributes for a TemplatedView in the view - [] static member inline BuildTemplatedView(attribCount: int, ?isClippedToBounds: bool, ?padding: obj, @@ -5400,68 +5002,64 @@ type View() = ?automationId: string, ?created: obj -> unit, ?ref: ViewRef) = - let attribBuilder = View.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + let attribBuilder = ViewBuilders.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) attribBuilder - [] - static member val CreateFuncTemplatedView : (unit -> Xamarin.Forms.TemplatedView) = (fun () -> View.CreateTemplatedView()) + static member val CreateFuncTemplatedView : (unit -> Xamarin.Forms.TemplatedView) = (fun () -> ViewBuilders.CreateTemplatedView()) - [] - static member CreateTemplatedView () : Xamarin.Forms.TemplatedView = + static member CreateTemplatedView () : Xamarin.Forms.TemplatedView = upcast (new Xamarin.Forms.TemplatedView()) - [] - static member val UpdateFuncTemplatedView = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TemplatedView) -> View.UpdateTemplatedView (prevOpt, curr, target)) + static member val UpdateFuncTemplatedView = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TemplatedView) -> ViewBuilders.UpdateTemplatedView (prevOpt, curr, target)) - [] static member UpdateTemplatedView (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.TemplatedView) = // update the inherited Layout element - let baseElement = (if View.ProtoLayout.IsNone then View.ProtoLayout <- Some (View.Layout())); View.ProtoLayout.Value + let baseElement = (if ViewProto.ProtoLayout.IsNone then ViewProto.ProtoLayout <- Some (ViewBuilders.ConstructLayout())); ViewProto.ProtoLayout.Value baseElement.UpdateInherited (prevOpt, curr, target) ignore prevOpt ignore curr ignore target - /// Describes a TemplatedView in the view - static member inline TemplatedView(?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.TemplatedView -> unit), - ?ref: ViewRef) = + static member ConstructTemplatedView(?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TemplatedView -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildTemplatedView(0, + let attribBuilder = ViewBuilders.BuildTemplatedView(0, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, @@ -5500,13 +5098,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncTemplatedView, View.UpdateFuncTemplatedView, attribBuilder) - - [] - static member val ProtoTemplatedView : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncTemplatedView, ViewBuilders.UpdateFuncTemplatedView, attribBuilder) /// Builds the attributes for a ContentView in the view - [] static member inline BuildContentView(attribCount: int, ?content: ViewElement, ?isClippedToBounds: bool, @@ -5549,35 +5143,32 @@ type View() = let attribCount = match content with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildTemplatedView(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match content with None -> () | Some v -> attribBuilder.Add(View._ContentAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildTemplatedView(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match content with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ContentAttribKey, (v)) attribBuilder - [] - static member val CreateFuncContentView : (unit -> Xamarin.Forms.ContentView) = (fun () -> View.CreateContentView()) + static member val CreateFuncContentView : (unit -> Xamarin.Forms.ContentView) = (fun () -> ViewBuilders.CreateContentView()) - [] - static member CreateContentView () : Xamarin.Forms.ContentView = + static member CreateContentView () : Xamarin.Forms.ContentView = upcast (new Xamarin.Forms.ContentView()) - [] - static member val UpdateFuncContentView = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ContentView) -> View.UpdateContentView (prevOpt, curr, target)) + static member val UpdateFuncContentView = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ContentView) -> ViewBuilders.UpdateContentView (prevOpt, curr, target)) - [] static member UpdateContentView (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ContentView) = // update the inherited TemplatedView element - let baseElement = (if View.ProtoTemplatedView.IsNone then View.ProtoTemplatedView <- Some (View.TemplatedView())); View.ProtoTemplatedView.Value + let baseElement = (if ViewProto.ProtoTemplatedView.IsNone then ViewProto.ProtoTemplatedView <- Some (ViewBuilders.ConstructTemplatedView())); ViewProto.ProtoTemplatedView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevContentOpt = ValueNone let mutable currContentOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ContentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ContentAttribKey.KeyValue then currContentOpt <- ValueSome (kvp.Value :?> ViewElement) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ContentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ContentAttribKey.KeyValue then prevContentOpt <- ValueSome (kvp.Value :?> ViewElement) match prevContentOpt, currContentOpt with // For structured objects, dependsOn on reference equality @@ -5590,47 +5181,46 @@ type View() = target.Content <- null | ValueNone, ValueNone -> () - /// Describes a ContentView in the view - static member inline ContentView(?content: ViewElement, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ContentView -> unit), - ?ref: ViewRef) = + static member ConstructContentView(?content: ViewElement, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ContentView -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildContentView(0, + let attribBuilder = ViewBuilders.BuildContentView(0, ?content=content, ?isClippedToBounds=isClippedToBounds, ?padding=padding, @@ -5670,13 +5260,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncContentView, View.UpdateFuncContentView, attribBuilder) - - [] - static member val ProtoContentView : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncContentView, ViewBuilders.UpdateFuncContentView, attribBuilder) /// Builds the attributes for a DatePicker in the view - [] static member inline BuildDatePicker(attribCount: int, ?date: System.DateTime, ?format: string, @@ -5725,28 +5311,25 @@ type View() = let attribCount = match maximumDate with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match dateSelected with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match date with None -> () | Some v -> attribBuilder.Add(View._DateAttribKey, (v)) - match format with None -> () | Some v -> attribBuilder.Add(View._FormatAttribKey, (v)) - match minimumDate with None -> () | Some v -> attribBuilder.Add(View._MinimumDateAttribKey, (v)) - match maximumDate with None -> () | Some v -> attribBuilder.Add(View._MaximumDateAttribKey, (v)) - match dateSelected with None -> () | Some v -> attribBuilder.Add(View._DateSelectedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match date with None -> () | Some v -> attribBuilder.Add(ViewAttributes.DateAttribKey, (v)) + match format with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FormatAttribKey, (v)) + match minimumDate with None -> () | Some v -> attribBuilder.Add(ViewAttributes.MinimumDateAttribKey, (v)) + match maximumDate with None -> () | Some v -> attribBuilder.Add(ViewAttributes.MaximumDateAttribKey, (v)) + match dateSelected with None -> () | Some v -> attribBuilder.Add(ViewAttributes.DateSelectedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) attribBuilder - [] - static member val CreateFuncDatePicker : (unit -> Xamarin.Forms.DatePicker) = (fun () -> View.CreateDatePicker()) + static member val CreateFuncDatePicker : (unit -> Xamarin.Forms.DatePicker) = (fun () -> ViewBuilders.CreateDatePicker()) - [] - static member CreateDatePicker () : Xamarin.Forms.DatePicker = + static member CreateDatePicker () : Xamarin.Forms.DatePicker = upcast (new Xamarin.Forms.DatePicker()) - [] - static member val UpdateFuncDatePicker = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.DatePicker) -> View.UpdateDatePicker (prevOpt, curr, target)) + static member val UpdateFuncDatePicker = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.DatePicker) -> ViewBuilders.UpdateDatePicker (prevOpt, curr, target)) - [] static member UpdateDatePicker (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.DatePicker) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevDateOpt = ValueNone let mutable currDateOpt = ValueNone @@ -5759,29 +5342,29 @@ type View() = let mutable prevDateSelectedOpt = ValueNone let mutable currDateSelectedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._DateAttribKey.KeyValue then + if kvp.Key = ViewAttributes.DateAttribKey.KeyValue then currDateOpt <- ValueSome (kvp.Value :?> System.DateTime) - if kvp.Key = View._FormatAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FormatAttribKey.KeyValue then currFormatOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._MinimumDateAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MinimumDateAttribKey.KeyValue then currMinimumDateOpt <- ValueSome (kvp.Value :?> System.DateTime) - if kvp.Key = View._MaximumDateAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MaximumDateAttribKey.KeyValue then currMaximumDateOpt <- ValueSome (kvp.Value :?> System.DateTime) - if kvp.Key = View._DateSelectedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.DateSelectedAttribKey.KeyValue then currDateSelectedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._DateAttribKey.KeyValue then + if kvp.Key = ViewAttributes.DateAttribKey.KeyValue then prevDateOpt <- ValueSome (kvp.Value :?> System.DateTime) - if kvp.Key = View._FormatAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FormatAttribKey.KeyValue then prevFormatOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._MinimumDateAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MinimumDateAttribKey.KeyValue then prevMinimumDateOpt <- ValueSome (kvp.Value :?> System.DateTime) - if kvp.Key = View._MaximumDateAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MaximumDateAttribKey.KeyValue then prevMaximumDateOpt <- ValueSome (kvp.Value :?> System.DateTime) - if kvp.Key = View._DateSelectedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.DateSelectedAttribKey.KeyValue then prevDateSelectedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevDateOpt, currDateOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -5810,49 +5393,48 @@ type View() = | ValueSome prevValue, ValueNone -> target.DateSelected.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a DatePicker in the view - static member inline DatePicker(?date: System.DateTime, - ?format: string, - ?minimumDate: System.DateTime, - ?maximumDate: System.DateTime, - ?dateSelected: Xamarin.Forms.DateChangedEventArgs -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.DatePicker -> unit), - ?ref: ViewRef) = + static member ConstructDatePicker(?date: System.DateTime, + ?format: string, + ?minimumDate: System.DateTime, + ?maximumDate: System.DateTime, + ?dateSelected: Xamarin.Forms.DateChangedEventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.DatePicker -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildDatePicker(0, + let attribBuilder = ViewBuilders.BuildDatePicker(0, ?date=date, ?format=format, ?minimumDate=minimumDate, @@ -5894,13 +5476,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncDatePicker, View.UpdateFuncDatePicker, attribBuilder) - - [] - static member val ProtoDatePicker : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncDatePicker, ViewBuilders.UpdateFuncDatePicker, attribBuilder) /// Builds the attributes for a Picker in the view - [] static member inline BuildPicker(attribCount: int, ?itemsSource: seq<'T>, ?selectedIndex: int, @@ -5949,28 +5527,25 @@ type View() = let attribCount = match textColor with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match selectedIndexChanged with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match itemsSource with None -> () | Some v -> attribBuilder.Add(View._PickerItemsSourceAttribKey, seqToIListUntyped(v)) - match selectedIndex with None -> () | Some v -> attribBuilder.Add(View._SelectedIndexAttribKey, (v)) - match title with None -> () | Some v -> attribBuilder.Add(View._TitleAttribKey, (v)) - match textColor with None -> () | Some v -> attribBuilder.Add(View._TextColorAttribKey, (v)) - match selectedIndexChanged with None -> () | Some v -> attribBuilder.Add(View._SelectedIndexChangedAttribKey, (fun f -> System.EventHandler(fun sender args -> let picker = (sender :?> Xamarin.Forms.Picker) in f (picker.SelectedIndex, (picker.SelectedItem |> Option.ofObj |> Option.map unbox<'T>))))(v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match itemsSource with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PickerItemsSourceAttribKey, seqToIListUntyped(v)) + match selectedIndex with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SelectedIndexAttribKey, (v)) + match title with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TitleAttribKey, (v)) + match textColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextColorAttribKey, (v)) + match selectedIndexChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SelectedIndexChangedAttribKey, (fun f -> System.EventHandler(fun sender args -> let picker = (sender :?> Xamarin.Forms.Picker) in f (picker.SelectedIndex, (picker.SelectedItem |> Option.ofObj |> Option.map unbox<'T>))))(v)) attribBuilder - [] - static member val CreateFuncPicker : (unit -> Xamarin.Forms.Picker) = (fun () -> View.CreatePicker()) + static member val CreateFuncPicker : (unit -> Xamarin.Forms.Picker) = (fun () -> ViewBuilders.CreatePicker()) - [] - static member CreatePicker () : Xamarin.Forms.Picker = + static member CreatePicker () : Xamarin.Forms.Picker = upcast (new Xamarin.Forms.Picker()) - [] - static member val UpdateFuncPicker = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Picker) -> View.UpdatePicker (prevOpt, curr, target)) + static member val UpdateFuncPicker = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Picker) -> ViewBuilders.UpdatePicker (prevOpt, curr, target)) - [] static member UpdatePicker (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Picker) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevPickerItemsSourceOpt = ValueNone let mutable currPickerItemsSourceOpt = ValueNone @@ -5983,29 +5558,29 @@ type View() = let mutable prevSelectedIndexChangedOpt = ValueNone let mutable currSelectedIndexChangedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._PickerItemsSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PickerItemsSourceAttribKey.KeyValue then currPickerItemsSourceOpt <- ValueSome (kvp.Value :?> System.Collections.IList) - if kvp.Key = View._SelectedIndexAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SelectedIndexAttribKey.KeyValue then currSelectedIndexOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._TitleAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TitleAttribKey.KeyValue then currTitleOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then currTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._SelectedIndexChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SelectedIndexChangedAttribKey.KeyValue then currSelectedIndexChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._PickerItemsSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PickerItemsSourceAttribKey.KeyValue then prevPickerItemsSourceOpt <- ValueSome (kvp.Value :?> System.Collections.IList) - if kvp.Key = View._SelectedIndexAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SelectedIndexAttribKey.KeyValue then prevSelectedIndexOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._TitleAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TitleAttribKey.KeyValue then prevTitleOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then prevTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._SelectedIndexChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SelectedIndexChangedAttribKey.KeyValue then prevSelectedIndexChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevPickerItemsSourceOpt, currPickerItemsSourceOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -6034,70 +5609,69 @@ type View() = | ValueSome prevValue, ValueNone -> target.SelectedIndexChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a Picker in the view - static member inline Picker(?itemsSource: seq<'T>, - ?selectedIndex: int, - ?title: string, - ?textColor: Xamarin.Forms.Color, - ?selectedIndexChanged: (int * 'T option) -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Picker -> unit), - ?ref: ViewRef) = - - let attribBuilder = View.BuildPicker(0, - ?itemsSource=itemsSource, - ?selectedIndex=selectedIndex, - ?title=title, - ?textColor=textColor, - ?selectedIndexChanged=selectedIndexChanged, - ?horizontalOptions=horizontalOptions, - ?verticalOptions=verticalOptions, - ?margin=margin, - ?gestureRecognizers=gestureRecognizers, - ?anchorX=anchorX, - ?anchorY=anchorY, - ?backgroundColor=backgroundColor, - ?heightRequest=heightRequest, - ?inputTransparent=inputTransparent, - ?isEnabled=isEnabled, - ?isVisible=isVisible, - ?minimumHeightRequest=minimumHeightRequest, - ?minimumWidthRequest=minimumWidthRequest, - ?opacity=opacity, - ?rotation=rotation, - ?rotationX=rotationX, + static member ConstructPicker(?itemsSource: seq<'T>, + ?selectedIndex: int, + ?title: string, + ?textColor: Xamarin.Forms.Color, + ?selectedIndexChanged: (int * 'T option) -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Picker -> unit), + ?ref: ViewRef) = + + let attribBuilder = ViewBuilders.BuildPicker(0, + ?itemsSource=itemsSource, + ?selectedIndex=selectedIndex, + ?title=title, + ?textColor=textColor, + ?selectedIndexChanged=selectedIndexChanged, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, @@ -6118,13 +5692,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncPicker, View.UpdateFuncPicker, attribBuilder) - - [] - static member val ProtoPicker : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncPicker, ViewBuilders.UpdateFuncPicker, attribBuilder) /// Builds the attributes for a Frame in the view - [] static member inline BuildFrame(attribCount: int, ?borderColor: Xamarin.Forms.Color, ?cornerRadius: double, @@ -6172,26 +5742,23 @@ type View() = let attribCount = match cornerRadius with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match hasShadow with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildContentView(attribCount, ?content=content, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match borderColor with None -> () | Some v -> attribBuilder.Add(View._BorderColorAttribKey, (v)) - match cornerRadius with None -> () | Some v -> attribBuilder.Add(View._FrameCornerRadiusAttribKey, single(v)) - match hasShadow with None -> () | Some v -> attribBuilder.Add(View._HasShadowAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildContentView(attribCount, ?content=content, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match borderColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.BorderColorAttribKey, (v)) + match cornerRadius with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FrameCornerRadiusAttribKey, single(v)) + match hasShadow with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HasShadowAttribKey, (v)) attribBuilder - [] - static member val CreateFuncFrame : (unit -> Xamarin.Forms.Frame) = (fun () -> View.CreateFrame()) + static member val CreateFuncFrame : (unit -> Xamarin.Forms.Frame) = (fun () -> ViewBuilders.CreateFrame()) - [] - static member CreateFrame () : Xamarin.Forms.Frame = + static member CreateFrame () : Xamarin.Forms.Frame = upcast (new Xamarin.Forms.Frame()) - [] - static member val UpdateFuncFrame = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Frame) -> View.UpdateFrame (prevOpt, curr, target)) + static member val UpdateFuncFrame = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Frame) -> ViewBuilders.UpdateFrame (prevOpt, curr, target)) - [] static member UpdateFrame (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Frame) = // update the inherited ContentView element - let baseElement = (if View.ProtoContentView.IsNone then View.ProtoContentView <- Some (View.ContentView())); View.ProtoContentView.Value + let baseElement = (if ViewProto.ProtoContentView.IsNone then ViewProto.ProtoContentView <- Some (ViewBuilders.ConstructContentView())); ViewProto.ProtoContentView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevBorderColorOpt = ValueNone let mutable currBorderColorOpt = ValueNone @@ -6200,21 +5767,21 @@ type View() = let mutable prevHasShadowOpt = ValueNone let mutable currHasShadowOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._BorderColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BorderColorAttribKey.KeyValue then currBorderColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._FrameCornerRadiusAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FrameCornerRadiusAttribKey.KeyValue then currFrameCornerRadiusOpt <- ValueSome (kvp.Value :?> single) - if kvp.Key = View._HasShadowAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HasShadowAttribKey.KeyValue then currHasShadowOpt <- ValueSome (kvp.Value :?> bool) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._BorderColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BorderColorAttribKey.KeyValue then prevBorderColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._FrameCornerRadiusAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FrameCornerRadiusAttribKey.KeyValue then prevFrameCornerRadiusOpt <- ValueSome (kvp.Value :?> single) - if kvp.Key = View._HasShadowAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HasShadowAttribKey.KeyValue then prevHasShadowOpt <- ValueSome (kvp.Value :?> bool) match prevBorderColorOpt, currBorderColorOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -6232,50 +5799,49 @@ type View() = | ValueSome _, ValueNone -> target.HasShadow <- true | ValueNone, ValueNone -> () - /// Describes a Frame in the view - static member inline Frame(?borderColor: Xamarin.Forms.Color, - ?cornerRadius: double, - ?hasShadow: bool, - ?content: ViewElement, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Frame -> unit), - ?ref: ViewRef) = + static member ConstructFrame(?borderColor: Xamarin.Forms.Color, + ?cornerRadius: double, + ?hasShadow: bool, + ?content: ViewElement, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Frame -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildFrame(0, + let attribBuilder = ViewBuilders.BuildFrame(0, ?borderColor=borderColor, ?cornerRadius=cornerRadius, ?hasShadow=hasShadow, @@ -6318,13 +5884,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncFrame, View.UpdateFuncFrame, attribBuilder) - - [] - static member val ProtoFrame : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncFrame, ViewBuilders.UpdateFuncFrame, attribBuilder) /// Builds the attributes for a Image in the view - [] static member inline BuildImage(attribCount: int, ?source: obj, ?aspect: Xamarin.Forms.Aspect, @@ -6369,26 +5931,23 @@ type View() = let attribCount = match aspect with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match isOpaque with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match source with None -> () | Some v -> attribBuilder.Add(View._ImageSourceAttribKey, (v)) - match aspect with None -> () | Some v -> attribBuilder.Add(View._AspectAttribKey, (v)) - match isOpaque with None -> () | Some v -> attribBuilder.Add(View._IsOpaqueAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match source with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ImageSourceAttribKey, (v)) + match aspect with None -> () | Some v -> attribBuilder.Add(ViewAttributes.AspectAttribKey, (v)) + match isOpaque with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsOpaqueAttribKey, (v)) attribBuilder - [] - static member val CreateFuncImage : (unit -> Xamarin.Forms.Image) = (fun () -> View.CreateImage()) + static member val CreateFuncImage : (unit -> Xamarin.Forms.Image) = (fun () -> ViewBuilders.CreateImage()) - [] - static member CreateImage () : Xamarin.Forms.Image = + static member CreateImage () : Xamarin.Forms.Image = upcast (new Xamarin.Forms.Image()) - [] - static member val UpdateFuncImage = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Image) -> View.UpdateImage (prevOpt, curr, target)) + static member val UpdateFuncImage = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Image) -> ViewBuilders.UpdateImage (prevOpt, curr, target)) - [] static member UpdateImage (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Image) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevImageSourceOpt = ValueNone let mutable currImageSourceOpt = ValueNone @@ -6397,21 +5956,21 @@ type View() = let mutable prevIsOpaqueOpt = ValueNone let mutable currIsOpaqueOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ImageSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ImageSourceAttribKey.KeyValue then currImageSourceOpt <- ValueSome (kvp.Value :?> obj) - if kvp.Key = View._AspectAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AspectAttribKey.KeyValue then currAspectOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Aspect) - if kvp.Key = View._IsOpaqueAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsOpaqueAttribKey.KeyValue then currIsOpaqueOpt <- ValueSome (kvp.Value :?> bool) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ImageSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ImageSourceAttribKey.KeyValue then prevImageSourceOpt <- ValueSome (kvp.Value :?> obj) - if kvp.Key = View._AspectAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AspectAttribKey.KeyValue then prevAspectOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Aspect) - if kvp.Key = View._IsOpaqueAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsOpaqueAttribKey.KeyValue then prevIsOpaqueOpt <- ValueSome (kvp.Value :?> bool) match prevImageSourceOpt, currImageSourceOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -6429,47 +5988,46 @@ type View() = | ValueSome _, ValueNone -> target.IsOpaque <- true | ValueNone, ValueNone -> () - /// Describes a Image in the view - static member inline Image(?source: obj, - ?aspect: Xamarin.Forms.Aspect, - ?isOpaque: bool, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Image -> unit), - ?ref: ViewRef) = + static member ConstructImage(?source: obj, + ?aspect: Xamarin.Forms.Aspect, + ?isOpaque: bool, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Image -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildImage(0, + let attribBuilder = ViewBuilders.BuildImage(0, ?source=source, ?aspect=aspect, ?isOpaque=isOpaque, @@ -6509,13 +6067,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncImage, View.UpdateFuncImage, attribBuilder) - - [] - static member val ProtoImage : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncImage, ViewBuilders.UpdateFuncImage, attribBuilder) /// Builds the attributes for a ImageButton in the view - [] static member inline BuildImageButton(attribCount: int, ?command: unit -> unit, ?source: obj, @@ -6576,34 +6130,31 @@ type View() = let attribCount = match pressed with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match released with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match command with None -> () | Some v -> attribBuilder.Add(View._ImageButtonCommandAttribKey, (v)) - match source with None -> () | Some v -> attribBuilder.Add(View._ImageSourceAttribKey, (v)) - match aspect with None -> () | Some v -> attribBuilder.Add(View._AspectAttribKey, (v)) - match borderColor with None -> () | Some v -> attribBuilder.Add(View._BorderColorAttribKey, (v)) - match borderWidth with None -> () | Some v -> attribBuilder.Add(View._BorderWidthAttribKey, (v)) - match cornerRadius with None -> () | Some v -> attribBuilder.Add(View._ImageButtonCornerRadiusAttribKey, (v)) - match isOpaque with None -> () | Some v -> attribBuilder.Add(View._IsOpaqueAttribKey, (v)) - match padding with None -> () | Some v -> attribBuilder.Add(View._PaddingAttribKey, (v)) - match clicked with None -> () | Some v -> attribBuilder.Add(View._ClickedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) - match pressed with None -> () | Some v -> attribBuilder.Add(View._PressedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) - match released with None -> () | Some v -> attribBuilder.Add(View._ReleasedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match command with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ImageButtonCommandAttribKey, (v)) + match source with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ImageSourceAttribKey, (v)) + match aspect with None -> () | Some v -> attribBuilder.Add(ViewAttributes.AspectAttribKey, (v)) + match borderColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.BorderColorAttribKey, (v)) + match borderWidth with None -> () | Some v -> attribBuilder.Add(ViewAttributes.BorderWidthAttribKey, (v)) + match cornerRadius with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ImageButtonCornerRadiusAttribKey, (v)) + match isOpaque with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsOpaqueAttribKey, (v)) + match padding with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PaddingAttribKey, (v)) + match clicked with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ClickedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + match pressed with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PressedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + match released with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ReleasedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) attribBuilder - [] - static member val CreateFuncImageButton : (unit -> Xamarin.Forms.ImageButton) = (fun () -> View.CreateImageButton()) + static member val CreateFuncImageButton : (unit -> Xamarin.Forms.ImageButton) = (fun () -> ViewBuilders.CreateImageButton()) - [] - static member CreateImageButton () : Xamarin.Forms.ImageButton = + static member CreateImageButton () : Xamarin.Forms.ImageButton = upcast (new Xamarin.Forms.ImageButton()) - [] - static member val UpdateFuncImageButton = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ImageButton) -> View.UpdateImageButton (prevOpt, curr, target)) + static member val UpdateFuncImageButton = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ImageButton) -> ViewBuilders.UpdateImageButton (prevOpt, curr, target)) - [] static member UpdateImageButton (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ImageButton) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevImageButtonCommandOpt = ValueNone let mutable currImageButtonCommandOpt = ValueNone @@ -6628,53 +6179,53 @@ type View() = let mutable prevReleasedOpt = ValueNone let mutable currReleasedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ImageButtonCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ImageButtonCommandAttribKey.KeyValue then currImageButtonCommandOpt <- ValueSome (kvp.Value :?> unit -> unit) - if kvp.Key = View._ImageSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ImageSourceAttribKey.KeyValue then currImageSourceOpt <- ValueSome (kvp.Value :?> obj) - if kvp.Key = View._AspectAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AspectAttribKey.KeyValue then currAspectOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Aspect) - if kvp.Key = View._BorderColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BorderColorAttribKey.KeyValue then currBorderColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._BorderWidthAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BorderWidthAttribKey.KeyValue then currBorderWidthOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ImageButtonCornerRadiusAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ImageButtonCornerRadiusAttribKey.KeyValue then currImageButtonCornerRadiusOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._IsOpaqueAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsOpaqueAttribKey.KeyValue then currIsOpaqueOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._PaddingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PaddingAttribKey.KeyValue then currPaddingOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Thickness) - if kvp.Key = View._ClickedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ClickedAttribKey.KeyValue then currClickedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._PressedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PressedAttribKey.KeyValue then currPressedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ReleasedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ReleasedAttribKey.KeyValue then currReleasedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ImageButtonCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ImageButtonCommandAttribKey.KeyValue then prevImageButtonCommandOpt <- ValueSome (kvp.Value :?> unit -> unit) - if kvp.Key = View._ImageSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ImageSourceAttribKey.KeyValue then prevImageSourceOpt <- ValueSome (kvp.Value :?> obj) - if kvp.Key = View._AspectAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AspectAttribKey.KeyValue then prevAspectOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Aspect) - if kvp.Key = View._BorderColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BorderColorAttribKey.KeyValue then prevBorderColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._BorderWidthAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BorderWidthAttribKey.KeyValue then prevBorderWidthOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._ImageButtonCornerRadiusAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ImageButtonCornerRadiusAttribKey.KeyValue then prevImageButtonCornerRadiusOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._IsOpaqueAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsOpaqueAttribKey.KeyValue then prevIsOpaqueOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._PaddingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PaddingAttribKey.KeyValue then prevPaddingOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Thickness) - if kvp.Key = View._ClickedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ClickedAttribKey.KeyValue then prevClickedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._PressedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PressedAttribKey.KeyValue then prevPressedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ReleasedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ReleasedAttribKey.KeyValue then prevReleasedOpt <- ValueSome (kvp.Value :?> System.EventHandler) (fun _ _ _ -> ()) prevImageButtonCommandOpt currImageButtonCommandOpt target match prevImageSourceOpt, currImageSourceOpt with @@ -6731,57 +6282,56 @@ type View() = | ValueSome prevValue, ValueNone -> target.Released.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a ImageButton in the view - static member inline ImageButton(?command: unit -> unit, - ?source: obj, - ?aspect: Xamarin.Forms.Aspect, - ?borderColor: Xamarin.Forms.Color, - ?borderWidth: double, - ?cornerRadius: int, - ?isOpaque: bool, - ?padding: Xamarin.Forms.Thickness, - ?clicked: System.EventArgs -> unit, - ?pressed: System.EventArgs -> unit, - ?released: System.EventArgs -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ImageButton -> unit), - ?ref: ViewRef) = - - let attribBuilder = View.BuildImageButton(0, - ?command=command, - ?source=source, + static member ConstructImageButton(?command: unit -> unit, + ?source: obj, + ?aspect: Xamarin.Forms.Aspect, + ?borderColor: Xamarin.Forms.Color, + ?borderWidth: double, + ?cornerRadius: int, + ?isOpaque: bool, + ?padding: Xamarin.Forms.Thickness, + ?clicked: System.EventArgs -> unit, + ?pressed: System.EventArgs -> unit, + ?released: System.EventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ImageButton -> unit), + ?ref: ViewRef) = + + let attribBuilder = ViewBuilders.BuildImageButton(0, + ?command=command, + ?source=source, ?aspect=aspect, ?borderColor=borderColor, ?borderWidth=borderWidth, @@ -6827,13 +6377,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncImageButton, View.UpdateFuncImageButton, attribBuilder) - - [] - static member val ProtoImageButton : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncImageButton, ViewBuilders.UpdateFuncImageButton, attribBuilder) /// Builds the attributes for a InputView in the view - [] static member inline BuildInputView(attribCount: int, ?keyboard: Xamarin.Forms.Keyboard, ?horizontalOptions: Xamarin.Forms.LayoutOptions, @@ -6874,35 +6420,32 @@ type View() = let attribCount = match keyboard with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match keyboard with None -> () | Some v -> attribBuilder.Add(View._KeyboardAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match keyboard with None -> () | Some v -> attribBuilder.Add(ViewAttributes.KeyboardAttribKey, (v)) attribBuilder - [] - static member val CreateFuncInputView : (unit -> Xamarin.Forms.InputView) = (fun () -> View.CreateInputView()) + static member val CreateFuncInputView : (unit -> Xamarin.Forms.InputView) = (fun () -> ViewBuilders.CreateInputView()) - [] - static member CreateInputView () : Xamarin.Forms.InputView = + static member CreateInputView () : Xamarin.Forms.InputView = failwith "can't create Xamarin.Forms.InputView" - [] - static member val UpdateFuncInputView = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.InputView) -> View.UpdateInputView (prevOpt, curr, target)) + static member val UpdateFuncInputView = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.InputView) -> ViewBuilders.UpdateInputView (prevOpt, curr, target)) - [] static member UpdateInputView (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.InputView) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevKeyboardOpt = ValueNone let mutable currKeyboardOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._KeyboardAttribKey.KeyValue then + if kvp.Key = ViewAttributes.KeyboardAttribKey.KeyValue then currKeyboardOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Keyboard) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._KeyboardAttribKey.KeyValue then + if kvp.Key = ViewAttributes.KeyboardAttribKey.KeyValue then prevKeyboardOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Keyboard) match prevKeyboardOpt, currKeyboardOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -6910,45 +6453,44 @@ type View() = | ValueSome _, ValueNone -> target.Keyboard <- Xamarin.Forms.Keyboard.Default | ValueNone, ValueNone -> () - /// Describes a InputView in the view - static member inline InputView(?keyboard: Xamarin.Forms.Keyboard, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.InputView -> unit), - ?ref: ViewRef) = + static member ConstructInputView(?keyboard: Xamarin.Forms.Keyboard, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.InputView -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildInputView(0, + let attribBuilder = ViewBuilders.BuildInputView(0, ?keyboard=keyboard, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, @@ -6986,13 +6528,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncInputView, View.UpdateFuncInputView, attribBuilder) - - [] - static member val ProtoInputView : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncInputView, ViewBuilders.UpdateFuncInputView, attribBuilder) /// Builds the attributes for a Editor in the view - [] static member inline BuildEditor(attribCount: int, ?text: string, ?fontSize: obj, @@ -7052,33 +6590,30 @@ type View() = let attribCount = match placeholder with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match placeholderColor with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildInputView(attribCount, ?keyboard=keyboard, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match text with None -> () | Some v -> attribBuilder.Add(View._TextAttribKey, (v)) - match fontSize with None -> () | Some v -> attribBuilder.Add(View._FontSizeAttribKey, makeFontSize(v)) - match fontFamily with None -> () | Some v -> attribBuilder.Add(View._FontFamilyAttribKey, (v)) - match fontAttributes with None -> () | Some v -> attribBuilder.Add(View._FontAttributesAttribKey, (v)) - match textColor with None -> () | Some v -> attribBuilder.Add(View._TextColorAttribKey, (v)) - match completed with None -> () | Some v -> attribBuilder.Add(View._EditorCompletedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.Editor).Text))(v)) - match textChanged with None -> () | Some v -> attribBuilder.Add(View._TextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) - match autoSize with None -> () | Some v -> attribBuilder.Add(View._AutoSizeAttribKey, (v)) - match placeholder with None -> () | Some v -> attribBuilder.Add(View._PlaceholderAttribKey, (v)) - match placeholderColor with None -> () | Some v -> attribBuilder.Add(View._PlaceholderColorAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildInputView(attribCount, ?keyboard=keyboard, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match text with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextAttribKey, (v)) + match fontSize with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontSizeAttribKey, makeFontSize(v)) + match fontFamily with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontFamilyAttribKey, (v)) + match fontAttributes with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontAttributesAttribKey, (v)) + match textColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextColorAttribKey, (v)) + match completed with None -> () | Some v -> attribBuilder.Add(ViewAttributes.EditorCompletedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.Editor).Text))(v)) + match textChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + match autoSize with None -> () | Some v -> attribBuilder.Add(ViewAttributes.AutoSizeAttribKey, (v)) + match placeholder with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PlaceholderAttribKey, (v)) + match placeholderColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PlaceholderColorAttribKey, (v)) attribBuilder - [] - static member val CreateFuncEditor : (unit -> Xamarin.Forms.Editor) = (fun () -> View.CreateEditor()) + static member val CreateFuncEditor : (unit -> Xamarin.Forms.Editor) = (fun () -> ViewBuilders.CreateEditor()) - [] - static member CreateEditor () : Xamarin.Forms.Editor = + static member CreateEditor () : Xamarin.Forms.Editor = upcast (new Xamarin.Forms.Editor()) - [] - static member val UpdateFuncEditor = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Editor) -> View.UpdateEditor (prevOpt, curr, target)) + static member val UpdateFuncEditor = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Editor) -> ViewBuilders.UpdateEditor (prevOpt, curr, target)) - [] static member UpdateEditor (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Editor) = // update the inherited InputView element - let baseElement = (if View.ProtoInputView.IsNone then View.ProtoInputView <- Some (View.InputView())); View.ProtoInputView.Value + let baseElement = (if ViewProto.ProtoInputView.IsNone then ViewProto.ProtoInputView <- Some (ViewBuilders.ConstructInputView())); ViewProto.ProtoInputView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevTextOpt = ValueNone let mutable currTextOpt = ValueNone @@ -7101,49 +6636,49 @@ type View() = let mutable prevPlaceholderColorOpt = ValueNone let mutable currPlaceholderColorOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then currTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontSizeAttribKey.KeyValue then currFontSizeOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._FontFamilyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontFamilyAttribKey.KeyValue then currFontFamilyOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontAttributesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontAttributesAttribKey.KeyValue then currFontAttributesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FontAttributes) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then currTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._EditorCompletedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.EditorCompletedAttribKey.KeyValue then currEditorCompletedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._TextChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextChangedAttribKey.KeyValue then currTextChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._AutoSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AutoSizeAttribKey.KeyValue then currAutoSizeOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.EditorAutoSizeOption) - if kvp.Key = View._PlaceholderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderAttribKey.KeyValue then currPlaceholderOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._PlaceholderColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderColorAttribKey.KeyValue then currPlaceholderColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then prevTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontSizeAttribKey.KeyValue then prevFontSizeOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._FontFamilyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontFamilyAttribKey.KeyValue then prevFontFamilyOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontAttributesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontAttributesAttribKey.KeyValue then prevFontAttributesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FontAttributes) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then prevTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._EditorCompletedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.EditorCompletedAttribKey.KeyValue then prevEditorCompletedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._TextChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextChangedAttribKey.KeyValue then prevTextChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._AutoSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AutoSizeAttribKey.KeyValue then prevAutoSizeOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.EditorAutoSizeOption) - if kvp.Key = View._PlaceholderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderAttribKey.KeyValue then prevPlaceholderOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._PlaceholderColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderColorAttribKey.KeyValue then prevPlaceholderColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) match prevTextOpt, currTextOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -7198,55 +6733,54 @@ type View() = | ValueSome _, ValueNone -> target.PlaceholderColor <- Xamarin.Forms.Color.Default | ValueNone, ValueNone -> () - /// Describes a Editor in the view - static member inline Editor(?text: string, - ?fontSize: obj, - ?fontFamily: string, - ?fontAttributes: Xamarin.Forms.FontAttributes, - ?textColor: Xamarin.Forms.Color, - ?completed: string -> unit, - ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, - ?autoSize: Xamarin.Forms.EditorAutoSizeOption, - ?placeholder: string, - ?placeholderColor: Xamarin.Forms.Color, - ?keyboard: Xamarin.Forms.Keyboard, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Editor -> unit), - ?ref: ViewRef) = + static member ConstructEditor(?text: string, + ?fontSize: obj, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?textColor: Xamarin.Forms.Color, + ?completed: string -> unit, + ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, + ?autoSize: Xamarin.Forms.EditorAutoSizeOption, + ?placeholder: string, + ?placeholderColor: Xamarin.Forms.Color, + ?keyboard: Xamarin.Forms.Keyboard, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Editor -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildEditor(0, + let attribBuilder = ViewBuilders.BuildEditor(0, ?text=text, ?fontSize=fontSize, ?fontFamily=fontFamily, @@ -7294,13 +6828,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncEditor, View.UpdateFuncEditor, attribBuilder) - - [] - static member val ProtoEditor : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncEditor, ViewBuilders.UpdateFuncEditor, attribBuilder) /// Builds the attributes for a Entry in the view - [] static member inline BuildEntry(attribCount: int, ?text: string, ?placeholder: string, @@ -7372,39 +6902,36 @@ type View() = let attribCount = match cursorPosition with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match selectionLength with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildInputView(attribCount, ?keyboard=keyboard, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match text with None -> () | Some v -> attribBuilder.Add(View._TextAttribKey, (v)) - match placeholder with None -> () | Some v -> attribBuilder.Add(View._PlaceholderAttribKey, (v)) - match horizontalTextAlignment with None -> () | Some v -> attribBuilder.Add(View._HorizontalTextAlignmentAttribKey, (v)) - match fontSize with None -> () | Some v -> attribBuilder.Add(View._FontSizeAttribKey, makeFontSize(v)) - match fontFamily with None -> () | Some v -> attribBuilder.Add(View._FontFamilyAttribKey, (v)) - match fontAttributes with None -> () | Some v -> attribBuilder.Add(View._FontAttributesAttribKey, (v)) - match textColor with None -> () | Some v -> attribBuilder.Add(View._TextColorAttribKey, (v)) - match placeholderColor with None -> () | Some v -> attribBuilder.Add(View._PlaceholderColorAttribKey, (v)) - match isPassword with None -> () | Some v -> attribBuilder.Add(View._IsPasswordAttribKey, (v)) - match completed with None -> () | Some v -> attribBuilder.Add(View._EntryCompletedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.Entry).Text))(v)) - match textChanged with None -> () | Some v -> attribBuilder.Add(View._TextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) - match isTextPredictionEnabled with None -> () | Some v -> attribBuilder.Add(View._IsTextPredictionEnabledAttribKey, (v)) - match returnType with None -> () | Some v -> attribBuilder.Add(View._ReturnTypeAttribKey, (v)) - match returnCommand with None -> () | Some v -> attribBuilder.Add(View._ReturnCommandAttribKey, makeCommand(v)) - match cursorPosition with None -> () | Some v -> attribBuilder.Add(View._CursorPositionAttribKey, (v)) - match selectionLength with None -> () | Some v -> attribBuilder.Add(View._SelectionLengthAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildInputView(attribCount, ?keyboard=keyboard, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match text with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextAttribKey, (v)) + match placeholder with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PlaceholderAttribKey, (v)) + match horizontalTextAlignment with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HorizontalTextAlignmentAttribKey, (v)) + match fontSize with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontSizeAttribKey, makeFontSize(v)) + match fontFamily with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontFamilyAttribKey, (v)) + match fontAttributes with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontAttributesAttribKey, (v)) + match textColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextColorAttribKey, (v)) + match placeholderColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PlaceholderColorAttribKey, (v)) + match isPassword with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsPasswordAttribKey, (v)) + match completed with None -> () | Some v -> attribBuilder.Add(ViewAttributes.EntryCompletedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.Entry).Text))(v)) + match textChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + match isTextPredictionEnabled with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsTextPredictionEnabledAttribKey, (v)) + match returnType with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ReturnTypeAttribKey, (v)) + match returnCommand with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ReturnCommandAttribKey, makeCommand(v)) + match cursorPosition with None -> () | Some v -> attribBuilder.Add(ViewAttributes.CursorPositionAttribKey, (v)) + match selectionLength with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SelectionLengthAttribKey, (v)) attribBuilder - [] - static member val CreateFuncEntry : (unit -> Xamarin.Forms.Entry) = (fun () -> View.CreateEntry()) + static member val CreateFuncEntry : (unit -> Xamarin.Forms.Entry) = (fun () -> ViewBuilders.CreateEntry()) - [] - static member CreateEntry () : Xamarin.Forms.Entry = + static member CreateEntry () : Xamarin.Forms.Entry = upcast (new Xamarin.Forms.Entry()) - [] - static member val UpdateFuncEntry = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Entry) -> View.UpdateEntry (prevOpt, curr, target)) + static member val UpdateFuncEntry = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Entry) -> ViewBuilders.UpdateEntry (prevOpt, curr, target)) - [] static member UpdateEntry (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Entry) = // update the inherited InputView element - let baseElement = (if View.ProtoInputView.IsNone then View.ProtoInputView <- Some (View.InputView())); View.ProtoInputView.Value + let baseElement = (if ViewProto.ProtoInputView.IsNone then ViewProto.ProtoInputView <- Some (ViewBuilders.ConstructInputView())); ViewProto.ProtoInputView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevTextOpt = ValueNone let mutable currTextOpt = ValueNone @@ -7439,73 +6966,73 @@ type View() = let mutable prevSelectionLengthOpt = ValueNone let mutable currSelectionLengthOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then currTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._PlaceholderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderAttribKey.KeyValue then currPlaceholderOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._HorizontalTextAlignmentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HorizontalTextAlignmentAttribKey.KeyValue then currHorizontalTextAlignmentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextAlignment) - if kvp.Key = View._FontSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontSizeAttribKey.KeyValue then currFontSizeOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._FontFamilyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontFamilyAttribKey.KeyValue then currFontFamilyOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontAttributesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontAttributesAttribKey.KeyValue then currFontAttributesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FontAttributes) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then currTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._PlaceholderColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderColorAttribKey.KeyValue then currPlaceholderColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._IsPasswordAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsPasswordAttribKey.KeyValue then currIsPasswordOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._EntryCompletedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.EntryCompletedAttribKey.KeyValue then currEntryCompletedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._TextChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextChangedAttribKey.KeyValue then currTextChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._IsTextPredictionEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsTextPredictionEnabledAttribKey.KeyValue then currIsTextPredictionEnabledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._ReturnTypeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ReturnTypeAttribKey.KeyValue then currReturnTypeOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ReturnType) - if kvp.Key = View._ReturnCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ReturnCommandAttribKey.KeyValue then currReturnCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._CursorPositionAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CursorPositionAttribKey.KeyValue then currCursorPositionOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._SelectionLengthAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SelectionLengthAttribKey.KeyValue then currSelectionLengthOpt <- ValueSome (kvp.Value :?> int) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then prevTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._PlaceholderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderAttribKey.KeyValue then prevPlaceholderOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._HorizontalTextAlignmentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HorizontalTextAlignmentAttribKey.KeyValue then prevHorizontalTextAlignmentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextAlignment) - if kvp.Key = View._FontSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontSizeAttribKey.KeyValue then prevFontSizeOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._FontFamilyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontFamilyAttribKey.KeyValue then prevFontFamilyOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontAttributesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontAttributesAttribKey.KeyValue then prevFontAttributesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FontAttributes) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then prevTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._PlaceholderColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderColorAttribKey.KeyValue then prevPlaceholderColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._IsPasswordAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsPasswordAttribKey.KeyValue then prevIsPasswordOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._EntryCompletedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.EntryCompletedAttribKey.KeyValue then prevEntryCompletedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._TextChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextChangedAttribKey.KeyValue then prevTextChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._IsTextPredictionEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsTextPredictionEnabledAttribKey.KeyValue then prevIsTextPredictionEnabledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._ReturnTypeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ReturnTypeAttribKey.KeyValue then prevReturnTypeOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ReturnType) - if kvp.Key = View._ReturnCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ReturnCommandAttribKey.KeyValue then prevReturnCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._CursorPositionAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CursorPositionAttribKey.KeyValue then prevCursorPositionOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._SelectionLengthAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SelectionLengthAttribKey.KeyValue then prevSelectionLengthOpt <- ValueSome (kvp.Value :?> int) match prevTextOpt, currTextOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -7582,73 +7109,72 @@ type View() = (fun _ curr (target: Xamarin.Forms.Entry) -> match curr with ValueSome value -> target.CursorPosition <- value | ValueNone -> ()) prevCursorPositionOpt currCursorPositionOpt target (fun _ curr (target: Xamarin.Forms.Entry) -> match curr with ValueSome value -> target.SelectionLength <- value | ValueNone -> ()) prevSelectionLengthOpt currSelectionLengthOpt target - /// Describes a Entry in the view - static member inline Entry(?text: string, - ?placeholder: string, - ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, - ?fontSize: obj, - ?fontFamily: string, - ?fontAttributes: Xamarin.Forms.FontAttributes, - ?textColor: Xamarin.Forms.Color, - ?placeholderColor: Xamarin.Forms.Color, - ?isPassword: bool, - ?completed: string -> unit, - ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, - ?isTextPredictionEnabled: bool, - ?returnType: Xamarin.Forms.ReturnType, - ?returnCommand: unit -> unit, - ?cursorPosition: int, - ?selectionLength: int, - ?keyboard: Xamarin.Forms.Keyboard, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Entry -> unit), - ?ref: ViewRef) = - - let attribBuilder = View.BuildEntry(0, - ?text=text, - ?placeholder=placeholder, - ?horizontalTextAlignment=horizontalTextAlignment, - ?fontSize=fontSize, - ?fontFamily=fontFamily, - ?fontAttributes=fontAttributes, - ?textColor=textColor, - ?placeholderColor=placeholderColor, - ?isPassword=isPassword, - ?completed=completed, - ?textChanged=textChanged, - ?isTextPredictionEnabled=isTextPredictionEnabled, + static member ConstructEntry(?text: string, + ?placeholder: string, + ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, + ?fontSize: obj, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?textColor: Xamarin.Forms.Color, + ?placeholderColor: Xamarin.Forms.Color, + ?isPassword: bool, + ?completed: string -> unit, + ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, + ?isTextPredictionEnabled: bool, + ?returnType: Xamarin.Forms.ReturnType, + ?returnCommand: unit -> unit, + ?cursorPosition: int, + ?selectionLength: int, + ?keyboard: Xamarin.Forms.Keyboard, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Entry -> unit), + ?ref: ViewRef) = + + let attribBuilder = ViewBuilders.BuildEntry(0, + ?text=text, + ?placeholder=placeholder, + ?horizontalTextAlignment=horizontalTextAlignment, + ?fontSize=fontSize, + ?fontFamily=fontFamily, + ?fontAttributes=fontAttributes, + ?textColor=textColor, + ?placeholderColor=placeholderColor, + ?isPassword=isPassword, + ?completed=completed, + ?textChanged=textChanged, + ?isTextPredictionEnabled=isTextPredictionEnabled, ?returnType=returnType, ?returnCommand=returnCommand, ?cursorPosition=cursorPosition, @@ -7690,13 +7216,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncEntry, View.UpdateFuncEntry, attribBuilder) - - [] - static member val ProtoEntry : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncEntry, ViewBuilders.UpdateFuncEntry, attribBuilder) /// Builds the attributes for a EntryCell in the view - [] static member inline BuildEntryCell(attribCount: int, ?label: string, ?text: string, @@ -7721,30 +7243,27 @@ type View() = let attribCount = match completed with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match textChanged with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildCell(attribCount, ?height=height, ?isEnabled=isEnabled, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match label with None -> () | Some v -> attribBuilder.Add(View._LabelAttribKey, (v)) - match text with None -> () | Some v -> attribBuilder.Add(View._TextAttribKey, (v)) - match keyboard with None -> () | Some v -> attribBuilder.Add(View._KeyboardAttribKey, (v)) - match placeholder with None -> () | Some v -> attribBuilder.Add(View._PlaceholderAttribKey, (v)) - match horizontalTextAlignment with None -> () | Some v -> attribBuilder.Add(View._HorizontalTextAlignmentAttribKey, (v)) - match completed with None -> () | Some v -> attribBuilder.Add(View._EntryCompletedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.EntryCell).Text))(v)) - match textChanged with None -> () | Some v -> attribBuilder.Add(View._EntryCellTextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildCell(attribCount, ?height=height, ?isEnabled=isEnabled, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match label with None -> () | Some v -> attribBuilder.Add(ViewAttributes.LabelAttribKey, (v)) + match text with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextAttribKey, (v)) + match keyboard with None -> () | Some v -> attribBuilder.Add(ViewAttributes.KeyboardAttribKey, (v)) + match placeholder with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PlaceholderAttribKey, (v)) + match horizontalTextAlignment with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HorizontalTextAlignmentAttribKey, (v)) + match completed with None -> () | Some v -> attribBuilder.Add(ViewAttributes.EntryCompletedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.EntryCell).Text))(v)) + match textChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.EntryCellTextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) attribBuilder - [] - static member val CreateFuncEntryCell : (unit -> Fabulous.CustomControls.CustomEntryCell) = (fun () -> View.CreateEntryCell()) + static member val CreateFuncEntryCell : (unit -> Fabulous.CustomControls.CustomEntryCell) = (fun () -> ViewBuilders.CreateEntryCell()) - [] - static member CreateEntryCell () : Fabulous.CustomControls.CustomEntryCell = + static member CreateEntryCell () : Fabulous.CustomControls.CustomEntryCell = upcast (new Fabulous.CustomControls.CustomEntryCell()) - [] - static member val UpdateFuncEntryCell = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Fabulous.CustomControls.CustomEntryCell) -> View.UpdateEntryCell (prevOpt, curr, target)) + static member val UpdateFuncEntryCell = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Fabulous.CustomControls.CustomEntryCell) -> ViewBuilders.UpdateEntryCell (prevOpt, curr, target)) - [] static member UpdateEntryCell (prevOpt: ViewElement voption, curr: ViewElement, target: Fabulous.CustomControls.CustomEntryCell) = // update the inherited Cell element - let baseElement = (if View.ProtoCell.IsNone then View.ProtoCell <- Some (View.Cell())); View.ProtoCell.Value + let baseElement = (if ViewProto.ProtoCell.IsNone then ViewProto.ProtoCell <- Some (ViewBuilders.ConstructCell())); ViewProto.ProtoCell.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevLabelOpt = ValueNone let mutable currLabelOpt = ValueNone @@ -7761,37 +7280,37 @@ type View() = let mutable prevEntryCellTextChangedOpt = ValueNone let mutable currEntryCellTextChangedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._LabelAttribKey.KeyValue then + if kvp.Key = ViewAttributes.LabelAttribKey.KeyValue then currLabelOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then currTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._KeyboardAttribKey.KeyValue then + if kvp.Key = ViewAttributes.KeyboardAttribKey.KeyValue then currKeyboardOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Keyboard) - if kvp.Key = View._PlaceholderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderAttribKey.KeyValue then currPlaceholderOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._HorizontalTextAlignmentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HorizontalTextAlignmentAttribKey.KeyValue then currHorizontalTextAlignmentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextAlignment) - if kvp.Key = View._EntryCompletedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.EntryCompletedAttribKey.KeyValue then currEntryCompletedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._EntryCellTextChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.EntryCellTextChangedAttribKey.KeyValue then currEntryCellTextChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._LabelAttribKey.KeyValue then + if kvp.Key = ViewAttributes.LabelAttribKey.KeyValue then prevLabelOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then prevTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._KeyboardAttribKey.KeyValue then + if kvp.Key = ViewAttributes.KeyboardAttribKey.KeyValue then prevKeyboardOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Keyboard) - if kvp.Key = View._PlaceholderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PlaceholderAttribKey.KeyValue then prevPlaceholderOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._HorizontalTextAlignmentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HorizontalTextAlignmentAttribKey.KeyValue then prevHorizontalTextAlignmentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextAlignment) - if kvp.Key = View._EntryCompletedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.EntryCompletedAttribKey.KeyValue then prevEntryCompletedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._EntryCellTextChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.EntryCellTextChangedAttribKey.KeyValue then prevEntryCellTextChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevLabelOpt, currLabelOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -7831,23 +7350,22 @@ type View() = | ValueSome prevValue, ValueNone -> target.TextChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a EntryCell in the view - static member inline EntryCell(?label: string, - ?text: string, - ?keyboard: Xamarin.Forms.Keyboard, - ?placeholder: string, - ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, - ?completed: string -> unit, - ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, - ?height: double, - ?isEnabled: bool, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Fabulous.CustomControls.CustomEntryCell -> unit), - ?ref: ViewRef) = + static member ConstructEntryCell(?label: string, + ?text: string, + ?keyboard: Xamarin.Forms.Keyboard, + ?placeholder: string, + ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, + ?completed: string -> unit, + ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Fabulous.CustomControls.CustomEntryCell -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildEntryCell(0, + let attribBuilder = ViewBuilders.BuildEntryCell(0, ?label=label, ?text=text, ?keyboard=keyboard, @@ -7863,13 +7381,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncEntryCell, View.UpdateFuncEntryCell, attribBuilder) - - [] - static member val ProtoEntryCell : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncEntryCell, ViewBuilders.UpdateFuncEntryCell, attribBuilder) /// Builds the attributes for a Label in the view - [] static member inline BuildLabel(attribCount: int, ?text: string, ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, @@ -7932,35 +7446,32 @@ type View() = let attribCount = match maxLines with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match textDecorations with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match text with None -> () | Some v -> attribBuilder.Add(View._TextAttribKey, (v)) - match horizontalTextAlignment with None -> () | Some v -> attribBuilder.Add(View._HorizontalTextAlignmentAttribKey, (v)) - match verticalTextAlignment with None -> () | Some v -> attribBuilder.Add(View._VerticalTextAlignmentAttribKey, (v)) - match fontSize with None -> () | Some v -> attribBuilder.Add(View._FontSizeAttribKey, makeFontSize(v)) - match fontFamily with None -> () | Some v -> attribBuilder.Add(View._FontFamilyAttribKey, (v)) - match fontAttributes with None -> () | Some v -> attribBuilder.Add(View._FontAttributesAttribKey, (v)) - match textColor with None -> () | Some v -> attribBuilder.Add(View._TextColorAttribKey, (v)) - match formattedText with None -> () | Some v -> attribBuilder.Add(View._FormattedTextAttribKey, (v)) - match lineBreakMode with None -> () | Some v -> attribBuilder.Add(View._LineBreakModeAttribKey, (v)) - match lineHeight with None -> () | Some v -> attribBuilder.Add(View._LineHeightAttribKey, (v)) - match maxLines with None -> () | Some v -> attribBuilder.Add(View._MaxLinesAttribKey, (v)) - match textDecorations with None -> () | Some v -> attribBuilder.Add(View._TextDecorationsAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match text with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextAttribKey, (v)) + match horizontalTextAlignment with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HorizontalTextAlignmentAttribKey, (v)) + match verticalTextAlignment with None -> () | Some v -> attribBuilder.Add(ViewAttributes.VerticalTextAlignmentAttribKey, (v)) + match fontSize with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontSizeAttribKey, makeFontSize(v)) + match fontFamily with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontFamilyAttribKey, (v)) + match fontAttributes with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontAttributesAttribKey, (v)) + match textColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextColorAttribKey, (v)) + match formattedText with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FormattedTextAttribKey, (v)) + match lineBreakMode with None -> () | Some v -> attribBuilder.Add(ViewAttributes.LineBreakModeAttribKey, (v)) + match lineHeight with None -> () | Some v -> attribBuilder.Add(ViewAttributes.LineHeightAttribKey, (v)) + match maxLines with None -> () | Some v -> attribBuilder.Add(ViewAttributes.MaxLinesAttribKey, (v)) + match textDecorations with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextDecorationsAttribKey, (v)) attribBuilder - [] - static member val CreateFuncLabel : (unit -> Xamarin.Forms.Label) = (fun () -> View.CreateLabel()) + static member val CreateFuncLabel : (unit -> Xamarin.Forms.Label) = (fun () -> ViewBuilders.CreateLabel()) - [] - static member CreateLabel () : Xamarin.Forms.Label = + static member CreateLabel () : Xamarin.Forms.Label = upcast (new Xamarin.Forms.Label()) - [] - static member val UpdateFuncLabel = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Label) -> View.UpdateLabel (prevOpt, curr, target)) + static member val UpdateFuncLabel = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Label) -> ViewBuilders.UpdateLabel (prevOpt, curr, target)) - [] static member UpdateLabel (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Label) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevTextOpt = ValueNone let mutable currTextOpt = ValueNone @@ -7987,57 +7498,57 @@ type View() = let mutable prevTextDecorationsOpt = ValueNone let mutable currTextDecorationsOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then currTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._HorizontalTextAlignmentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HorizontalTextAlignmentAttribKey.KeyValue then currHorizontalTextAlignmentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextAlignment) - if kvp.Key = View._VerticalTextAlignmentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.VerticalTextAlignmentAttribKey.KeyValue then currVerticalTextAlignmentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextAlignment) - if kvp.Key = View._FontSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontSizeAttribKey.KeyValue then currFontSizeOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._FontFamilyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontFamilyAttribKey.KeyValue then currFontFamilyOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontAttributesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontAttributesAttribKey.KeyValue then currFontAttributesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FontAttributes) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then currTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._FormattedTextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FormattedTextAttribKey.KeyValue then currFormattedTextOpt <- ValueSome (kvp.Value :?> ViewElement) - if kvp.Key = View._LineBreakModeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.LineBreakModeAttribKey.KeyValue then currLineBreakModeOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.LineBreakMode) - if kvp.Key = View._LineHeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.LineHeightAttribKey.KeyValue then currLineHeightOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._MaxLinesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MaxLinesAttribKey.KeyValue then currMaxLinesOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._TextDecorationsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextDecorationsAttribKey.KeyValue then currTextDecorationsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextDecorations) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then prevTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._HorizontalTextAlignmentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HorizontalTextAlignmentAttribKey.KeyValue then prevHorizontalTextAlignmentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextAlignment) - if kvp.Key = View._VerticalTextAlignmentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.VerticalTextAlignmentAttribKey.KeyValue then prevVerticalTextAlignmentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextAlignment) - if kvp.Key = View._FontSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontSizeAttribKey.KeyValue then prevFontSizeOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._FontFamilyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontFamilyAttribKey.KeyValue then prevFontFamilyOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontAttributesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontAttributesAttribKey.KeyValue then prevFontAttributesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FontAttributes) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then prevTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._FormattedTextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FormattedTextAttribKey.KeyValue then prevFormattedTextOpt <- ValueSome (kvp.Value :?> ViewElement) - if kvp.Key = View._LineBreakModeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.LineBreakModeAttribKey.KeyValue then prevLineBreakModeOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.LineBreakMode) - if kvp.Key = View._LineHeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.LineHeightAttribKey.KeyValue then prevLineHeightOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._MaxLinesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MaxLinesAttribKey.KeyValue then prevMaxLinesOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._TextDecorationsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextDecorationsAttribKey.KeyValue then prevTextDecorationsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextDecorations) match prevTextOpt, currTextOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -8105,56 +7616,55 @@ type View() = | ValueSome _, ValueNone -> target.TextDecorations <- Xamarin.Forms.TextDecorations.None | ValueNone, ValueNone -> () - /// Describes a Label in the view - static member inline Label(?text: string, - ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, - ?verticalTextAlignment: Xamarin.Forms.TextAlignment, - ?fontSize: obj, - ?fontFamily: string, - ?fontAttributes: Xamarin.Forms.FontAttributes, - ?textColor: Xamarin.Forms.Color, - ?formattedText: ViewElement, - ?lineBreakMode: Xamarin.Forms.LineBreakMode, - ?lineHeight: double, - ?maxLines: int, - ?textDecorations: Xamarin.Forms.TextDecorations, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Label -> unit), - ?ref: ViewRef) = + static member ConstructLabel(?text: string, + ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, + ?verticalTextAlignment: Xamarin.Forms.TextAlignment, + ?fontSize: obj, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?textColor: Xamarin.Forms.Color, + ?formattedText: ViewElement, + ?lineBreakMode: Xamarin.Forms.LineBreakMode, + ?lineHeight: double, + ?maxLines: int, + ?textDecorations: Xamarin.Forms.TextDecorations, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Label -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildLabel(0, + let attribBuilder = ViewBuilders.BuildLabel(0, ?text=text, ?horizontalTextAlignment=horizontalTextAlignment, ?verticalTextAlignment=verticalTextAlignment, @@ -8203,13 +7713,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncLabel, View.UpdateFuncLabel, attribBuilder) - - [] - static member val ProtoLabel : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncLabel, ViewBuilders.UpdateFuncLabel, attribBuilder) /// Builds the attributes for a StackLayout in the view - [] static member inline BuildStackLayout(attribCount: int, ?children: ViewElement list, ?orientation: Xamarin.Forms.StackOrientation, @@ -8256,26 +7762,23 @@ type View() = let attribCount = match orientation with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match spacing with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match children with None -> () | Some v -> attribBuilder.Add(View._ChildrenAttribKey, Array.ofList(v)) - match orientation with None -> () | Some v -> attribBuilder.Add(View._StackOrientationAttribKey, (v)) - match spacing with None -> () | Some v -> attribBuilder.Add(View._SpacingAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildLayout(attribCount, ?isClippedToBounds=isClippedToBounds, ?padding=padding, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match children with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ChildrenAttribKey, Array.ofList(v)) + match orientation with None -> () | Some v -> attribBuilder.Add(ViewAttributes.StackOrientationAttribKey, (v)) + match spacing with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SpacingAttribKey, (v)) attribBuilder - [] - static member val CreateFuncStackLayout : (unit -> Xamarin.Forms.StackLayout) = (fun () -> View.CreateStackLayout()) + static member val CreateFuncStackLayout : (unit -> Xamarin.Forms.StackLayout) = (fun () -> ViewBuilders.CreateStackLayout()) - [] - static member CreateStackLayout () : Xamarin.Forms.StackLayout = + static member CreateStackLayout () : Xamarin.Forms.StackLayout = upcast (new Xamarin.Forms.StackLayout()) - [] - static member val UpdateFuncStackLayout = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.StackLayout) -> View.UpdateStackLayout (prevOpt, curr, target)) + static member val UpdateFuncStackLayout = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.StackLayout) -> ViewBuilders.UpdateStackLayout (prevOpt, curr, target)) - [] static member UpdateStackLayout (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.StackLayout) = // update the inherited Layout element - let baseElement = (if View.ProtoLayout.IsNone then View.ProtoLayout <- Some (View.Layout())); View.ProtoLayout.Value + let baseElement = (if ViewProto.ProtoLayout.IsNone then ViewProto.ProtoLayout <- Some (ViewBuilders.ConstructLayout())); ViewProto.ProtoLayout.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevChildrenOpt = ValueNone let mutable currChildrenOpt = ValueNone @@ -8284,21 +7787,21 @@ type View() = let mutable prevSpacingOpt = ValueNone let mutable currSpacingOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then currChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._StackOrientationAttribKey.KeyValue then + if kvp.Key = ViewAttributes.StackOrientationAttribKey.KeyValue then currStackOrientationOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.StackOrientation) - if kvp.Key = View._SpacingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SpacingAttribKey.KeyValue then currSpacingOpt <- ValueSome (kvp.Value :?> double) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then prevChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._StackOrientationAttribKey.KeyValue then + if kvp.Key = ViewAttributes.StackOrientationAttribKey.KeyValue then prevStackOrientationOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.StackOrientation) - if kvp.Key = View._SpacingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SpacingAttribKey.KeyValue then prevSpacingOpt <- ValueSome (kvp.Value :?> double) updateCollectionGeneric prevChildrenOpt currChildrenOpt target.Children (fun (x:ViewElement) -> x.Create() :?> Xamarin.Forms.View) @@ -8316,49 +7819,48 @@ type View() = | ValueSome _, ValueNone -> target.Spacing <- 6.0 | ValueNone, ValueNone -> () - /// Describes a StackLayout in the view - static member inline StackLayout(?children: ViewElement list, - ?orientation: Xamarin.Forms.StackOrientation, - ?spacing: double, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.StackLayout -> unit), - ?ref: ViewRef) = + static member ConstructStackLayout(?children: ViewElement list, + ?orientation: Xamarin.Forms.StackOrientation, + ?spacing: double, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.StackLayout -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildStackLayout(0, + let attribBuilder = ViewBuilders.BuildStackLayout(0, ?children=children, ?orientation=orientation, ?spacing=spacing, @@ -8400,13 +7902,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncStackLayout, View.UpdateFuncStackLayout, attribBuilder) - - [] - static member val ProtoStackLayout : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncStackLayout, ViewBuilders.UpdateFuncStackLayout, attribBuilder) /// Builds the attributes for a Span in the view - [] static member inline BuildSpan(attribCount: int, ?fontFamily: string, ?fontAttributes: Xamarin.Forms.FontAttributes, @@ -8433,32 +7931,29 @@ type View() = let attribCount = match lineHeight with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match textDecorations with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match fontFamily with None -> () | Some v -> attribBuilder.Add(View._FontFamilyAttribKey, (v)) - match fontAttributes with None -> () | Some v -> attribBuilder.Add(View._FontAttributesAttribKey, (v)) - match fontSize with None -> () | Some v -> attribBuilder.Add(View._FontSizeAttribKey, makeFontSize(v)) - match backgroundColor with None -> () | Some v -> attribBuilder.Add(View._BackgroundColorAttribKey, (v)) - match foregroundColor with None -> () | Some v -> attribBuilder.Add(View._ForegroundColorAttribKey, (v)) - match text with None -> () | Some v -> attribBuilder.Add(View._TextAttribKey, (v)) - match propertyChanged with None -> () | Some v -> attribBuilder.Add(View._PropertyChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) - match lineHeight with None -> () | Some v -> attribBuilder.Add(View._LineHeightAttribKey, (v)) - match textDecorations with None -> () | Some v -> attribBuilder.Add(View._TextDecorationsAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match fontFamily with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontFamilyAttribKey, (v)) + match fontAttributes with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontAttributesAttribKey, (v)) + match fontSize with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FontSizeAttribKey, makeFontSize(v)) + match backgroundColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.BackgroundColorAttribKey, (v)) + match foregroundColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ForegroundColorAttribKey, (v)) + match text with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextAttribKey, (v)) + match propertyChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PropertyChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + match lineHeight with None -> () | Some v -> attribBuilder.Add(ViewAttributes.LineHeightAttribKey, (v)) + match textDecorations with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextDecorationsAttribKey, (v)) attribBuilder - [] - static member val CreateFuncSpan : (unit -> Xamarin.Forms.Span) = (fun () -> View.CreateSpan()) + static member val CreateFuncSpan : (unit -> Xamarin.Forms.Span) = (fun () -> ViewBuilders.CreateSpan()) - [] - static member CreateSpan () : Xamarin.Forms.Span = + static member CreateSpan () : Xamarin.Forms.Span = upcast (new Xamarin.Forms.Span()) - [] - static member val UpdateFuncSpan = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Span) -> View.UpdateSpan (prevOpt, curr, target)) + static member val UpdateFuncSpan = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Span) -> ViewBuilders.UpdateSpan (prevOpt, curr, target)) - [] static member UpdateSpan (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Span) = // update the inherited Element element - let baseElement = (if View.ProtoElement.IsNone then View.ProtoElement <- Some (View.Element())); View.ProtoElement.Value + let baseElement = (if ViewProto.ProtoElement.IsNone then ViewProto.ProtoElement <- Some (ViewBuilders.ConstructElement())); ViewProto.ProtoElement.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevFontFamilyOpt = ValueNone let mutable currFontFamilyOpt = ValueNone @@ -8479,45 +7974,45 @@ type View() = let mutable prevTextDecorationsOpt = ValueNone let mutable currTextDecorationsOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._FontFamilyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontFamilyAttribKey.KeyValue then currFontFamilyOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontAttributesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontAttributesAttribKey.KeyValue then currFontAttributesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FontAttributes) - if kvp.Key = View._FontSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontSizeAttribKey.KeyValue then currFontSizeOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._BackgroundColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BackgroundColorAttribKey.KeyValue then currBackgroundColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._ForegroundColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ForegroundColorAttribKey.KeyValue then currForegroundColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then currTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._PropertyChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PropertyChangedAttribKey.KeyValue then currPropertyChangedOpt <- ValueSome (kvp.Value :?> System.ComponentModel.PropertyChangedEventHandler) - if kvp.Key = View._LineHeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.LineHeightAttribKey.KeyValue then currLineHeightOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._TextDecorationsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextDecorationsAttribKey.KeyValue then currTextDecorationsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextDecorations) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._FontFamilyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontFamilyAttribKey.KeyValue then prevFontFamilyOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._FontAttributesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontAttributesAttribKey.KeyValue then prevFontAttributesOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.FontAttributes) - if kvp.Key = View._FontSizeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FontSizeAttribKey.KeyValue then prevFontSizeOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._BackgroundColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BackgroundColorAttribKey.KeyValue then prevBackgroundColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._ForegroundColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ForegroundColorAttribKey.KeyValue then prevForegroundColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then prevTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._PropertyChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PropertyChangedAttribKey.KeyValue then prevPropertyChangedOpt <- ValueSome (kvp.Value :?> System.ComponentModel.PropertyChangedEventHandler) - if kvp.Key = View._LineHeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.LineHeightAttribKey.KeyValue then prevLineHeightOpt <- ValueSome (kvp.Value :?> double) - if kvp.Key = View._TextDecorationsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextDecorationsAttribKey.KeyValue then prevTextDecorationsOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.TextDecorations) match prevFontFamilyOpt, currFontFamilyOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -8566,23 +8061,22 @@ type View() = | ValueSome _, ValueNone -> target.TextDecorations <- Xamarin.Forms.TextDecorations.None | ValueNone, ValueNone -> () - /// Describes a Span in the view - static member inline Span(?fontFamily: string, - ?fontAttributes: Xamarin.Forms.FontAttributes, - ?fontSize: obj, - ?backgroundColor: Xamarin.Forms.Color, - ?foregroundColor: Xamarin.Forms.Color, - ?text: string, - ?propertyChanged: System.ComponentModel.PropertyChangedEventArgs -> unit, - ?lineHeight: double, - ?textDecorations: Xamarin.Forms.TextDecorations, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Span -> unit), - ?ref: ViewRef) = + static member ConstructSpan(?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?fontSize: obj, + ?backgroundColor: Xamarin.Forms.Color, + ?foregroundColor: Xamarin.Forms.Color, + ?text: string, + ?propertyChanged: System.ComponentModel.PropertyChangedEventArgs -> unit, + ?lineHeight: double, + ?textDecorations: Xamarin.Forms.TextDecorations, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Span -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildSpan(0, + let attribBuilder = ViewBuilders.BuildSpan(0, ?fontFamily=fontFamily, ?fontAttributes=fontAttributes, ?fontSize=fontSize, @@ -8598,13 +8092,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncSpan, View.UpdateFuncSpan, attribBuilder) - - [] - static member val ProtoSpan : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncSpan, ViewBuilders.UpdateFuncSpan, attribBuilder) /// Builds the attributes for a FormattedString in the view - [] static member inline BuildFormattedString(attribCount: int, ?spans: ViewElement[], ?classId: string, @@ -8615,35 +8105,32 @@ type View() = let attribCount = match spans with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match spans with None -> () | Some v -> attribBuilder.Add(View._SpansAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match spans with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SpansAttribKey, (v)) attribBuilder - [] - static member val CreateFuncFormattedString : (unit -> Xamarin.Forms.FormattedString) = (fun () -> View.CreateFormattedString()) + static member val CreateFuncFormattedString : (unit -> Xamarin.Forms.FormattedString) = (fun () -> ViewBuilders.CreateFormattedString()) - [] - static member CreateFormattedString () : Xamarin.Forms.FormattedString = + static member CreateFormattedString () : Xamarin.Forms.FormattedString = upcast (new Xamarin.Forms.FormattedString()) - [] - static member val UpdateFuncFormattedString = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.FormattedString) -> View.UpdateFormattedString (prevOpt, curr, target)) + static member val UpdateFuncFormattedString = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.FormattedString) -> ViewBuilders.UpdateFormattedString (prevOpt, curr, target)) - [] static member UpdateFormattedString (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.FormattedString) = // update the inherited Element element - let baseElement = (if View.ProtoElement.IsNone then View.ProtoElement <- Some (View.Element())); View.ProtoElement.Value + let baseElement = (if ViewProto.ProtoElement.IsNone then ViewProto.ProtoElement <- Some (ViewBuilders.ConstructElement())); ViewProto.ProtoElement.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevSpansOpt = ValueNone let mutable currSpansOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._SpansAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SpansAttribKey.KeyValue then currSpansOpt <- ValueSome (kvp.Value :?> ViewElement[]) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._SpansAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SpansAttribKey.KeyValue then prevSpansOpt <- ValueSome (kvp.Value :?> ViewElement[]) updateCollectionGeneric prevSpansOpt currSpansOpt target.Spans (fun (x:ViewElement) -> x.Create() :?> Xamarin.Forms.Span) @@ -8651,15 +8138,14 @@ type View() = canReuseChild updateChild - /// Describes a FormattedString in the view - static member inline FormattedString(?spans: ViewElement[], - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.FormattedString -> unit), - ?ref: ViewRef) = + static member ConstructFormattedString(?spans: ViewElement[], + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.FormattedString -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildFormattedString(0, + let attribBuilder = ViewBuilders.BuildFormattedString(0, ?spans=spans, ?classId=classId, ?styleId=styleId, @@ -8667,13 +8153,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncFormattedString, View.UpdateFuncFormattedString, attribBuilder) - - [] - static member val ProtoFormattedString : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncFormattedString, ViewBuilders.UpdateFuncFormattedString, attribBuilder) /// Builds the attributes for a TimePicker in the view - [] static member inline BuildTimePicker(attribCount: int, ?time: System.TimeSpan, ?format: string, @@ -8718,26 +8200,23 @@ type View() = let attribCount = match format with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match textColor with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match time with None -> () | Some v -> attribBuilder.Add(View._TimeAttribKey, (v)) - match format with None -> () | Some v -> attribBuilder.Add(View._FormatAttribKey, (v)) - match textColor with None -> () | Some v -> attribBuilder.Add(View._TextColorAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match time with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TimeAttribKey, (v)) + match format with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FormatAttribKey, (v)) + match textColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextColorAttribKey, (v)) attribBuilder - [] - static member val CreateFuncTimePicker : (unit -> Xamarin.Forms.TimePicker) = (fun () -> View.CreateTimePicker()) + static member val CreateFuncTimePicker : (unit -> Xamarin.Forms.TimePicker) = (fun () -> ViewBuilders.CreateTimePicker()) - [] - static member CreateTimePicker () : Xamarin.Forms.TimePicker = + static member CreateTimePicker () : Xamarin.Forms.TimePicker = upcast (new Xamarin.Forms.TimePicker()) - [] - static member val UpdateFuncTimePicker = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TimePicker) -> View.UpdateTimePicker (prevOpt, curr, target)) + static member val UpdateFuncTimePicker = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TimePicker) -> ViewBuilders.UpdateTimePicker (prevOpt, curr, target)) - [] static member UpdateTimePicker (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.TimePicker) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevTimeOpt = ValueNone let mutable currTimeOpt = ValueNone @@ -8746,21 +8225,21 @@ type View() = let mutable prevTextColorOpt = ValueNone let mutable currTextColorOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._TimeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TimeAttribKey.KeyValue then currTimeOpt <- ValueSome (kvp.Value :?> System.TimeSpan) - if kvp.Key = View._FormatAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FormatAttribKey.KeyValue then currFormatOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then currTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._TimeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TimeAttribKey.KeyValue then prevTimeOpt <- ValueSome (kvp.Value :?> System.TimeSpan) - if kvp.Key = View._FormatAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FormatAttribKey.KeyValue then prevFormatOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then prevTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) match prevTimeOpt, currTimeOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -8778,47 +8257,46 @@ type View() = | ValueSome _, ValueNone -> target.TextColor <- Xamarin.Forms.Color.Default | ValueNone, ValueNone -> () - /// Describes a TimePicker in the view - static member inline TimePicker(?time: System.TimeSpan, - ?format: string, - ?textColor: Xamarin.Forms.Color, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.TimePicker -> unit), - ?ref: ViewRef) = + static member ConstructTimePicker(?time: System.TimeSpan, + ?format: string, + ?textColor: Xamarin.Forms.Color, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TimePicker -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildTimePicker(0, + let attribBuilder = ViewBuilders.BuildTimePicker(0, ?time=time, ?format=format, ?textColor=textColor, @@ -8858,13 +8336,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncTimePicker, View.UpdateFuncTimePicker, attribBuilder) - - [] - static member val ProtoTimePicker : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncTimePicker, ViewBuilders.UpdateFuncTimePicker, attribBuilder) /// Builds the attributes for a WebView in the view - [] static member inline BuildWebView(attribCount: int, ?source: Xamarin.Forms.WebViewSource, ?reload: bool, @@ -8913,28 +8387,25 @@ type View() = let attribCount = match navigating with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match reloadRequested with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match source with None -> () | Some v -> attribBuilder.Add(View._WebSourceAttribKey, (v)) - match reload with None -> () | Some v -> attribBuilder.Add(View._ReloadAttribKey, (v)) - match navigated with None -> () | Some v -> attribBuilder.Add(View._NavigatedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) - match navigating with None -> () | Some v -> attribBuilder.Add(View._NavigatingAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) - match reloadRequested with None -> () | Some v -> attribBuilder.Add(View._ReloadRequestedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match source with None -> () | Some v -> attribBuilder.Add(ViewAttributes.WebSourceAttribKey, (v)) + match reload with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ReloadAttribKey, (v)) + match navigated with None -> () | Some v -> attribBuilder.Add(ViewAttributes.NavigatedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + match navigating with None -> () | Some v -> attribBuilder.Add(ViewAttributes.NavigatingAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + match reloadRequested with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ReloadRequestedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) attribBuilder - [] - static member val CreateFuncWebView : (unit -> Xamarin.Forms.WebView) = (fun () -> View.CreateWebView()) + static member val CreateFuncWebView : (unit -> Xamarin.Forms.WebView) = (fun () -> ViewBuilders.CreateWebView()) - [] - static member CreateWebView () : Xamarin.Forms.WebView = + static member CreateWebView () : Xamarin.Forms.WebView = upcast (new Xamarin.Forms.WebView()) - [] - static member val UpdateFuncWebView = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.WebView) -> View.UpdateWebView (prevOpt, curr, target)) + static member val UpdateFuncWebView = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.WebView) -> ViewBuilders.UpdateWebView (prevOpt, curr, target)) - [] static member UpdateWebView (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.WebView) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevWebSourceOpt = ValueNone let mutable currWebSourceOpt = ValueNone @@ -8947,29 +8418,29 @@ type View() = let mutable prevReloadRequestedOpt = ValueNone let mutable currReloadRequestedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._WebSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.WebSourceAttribKey.KeyValue then currWebSourceOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.WebViewSource) - if kvp.Key = View._ReloadAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ReloadAttribKey.KeyValue then currReloadOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._NavigatedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.NavigatedAttribKey.KeyValue then currNavigatedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._NavigatingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.NavigatingAttribKey.KeyValue then currNavigatingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ReloadRequestedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ReloadRequestedAttribKey.KeyValue then currReloadRequestedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._WebSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.WebSourceAttribKey.KeyValue then prevWebSourceOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.WebViewSource) - if kvp.Key = View._ReloadAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ReloadAttribKey.KeyValue then prevReloadOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._NavigatedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.NavigatedAttribKey.KeyValue then prevNavigatedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._NavigatingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.NavigatingAttribKey.KeyValue then prevNavigatingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ReloadRequestedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ReloadRequestedAttribKey.KeyValue then prevReloadRequestedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevWebSourceOpt, currWebSourceOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -8996,49 +8467,48 @@ type View() = | ValueSome prevValue, ValueNone -> target.ReloadRequested.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a WebView in the view - static member inline WebView(?source: Xamarin.Forms.WebViewSource, - ?reload: bool, - ?navigated: Xamarin.Forms.WebNavigatedEventArgs -> unit, - ?navigating: Xamarin.Forms.WebNavigatingEventArgs -> unit, - ?reloadRequested: System.EventArgs -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.WebView -> unit), - ?ref: ViewRef) = + static member ConstructWebView(?source: Xamarin.Forms.WebViewSource, + ?reload: bool, + ?navigated: Xamarin.Forms.WebNavigatedEventArgs -> unit, + ?navigating: Xamarin.Forms.WebNavigatingEventArgs -> unit, + ?reloadRequested: System.EventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.WebView -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildWebView(0, + let attribBuilder = ViewBuilders.BuildWebView(0, ?source=source, ?reload=reload, ?navigated=navigated, @@ -9080,13 +8550,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncWebView, View.UpdateFuncWebView, attribBuilder) - - [] - static member val ProtoWebView : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncWebView, ViewBuilders.UpdateFuncWebView, attribBuilder) /// Builds the attributes for a Page in the view - [] static member inline BuildPage(attribCount: int, ?title: string, ?backgroundImage: string, @@ -9141,33 +8607,30 @@ type View() = let attribCount = match disappearing with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match layoutChanged with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildVisualElement(attribCount, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match title with None -> () | Some v -> attribBuilder.Add(View._TitleAttribKey, (v)) - match backgroundImage with None -> () | Some v -> attribBuilder.Add(View._BackgroundImageAttribKey, (v)) - match icon with None -> () | Some v -> attribBuilder.Add(View._IconAttribKey, (v)) - match isBusy with None -> () | Some v -> attribBuilder.Add(View._IsBusyAttribKey, (v)) - match padding with None -> () | Some v -> attribBuilder.Add(View._PaddingAttribKey, makeThickness(v)) - match toolbarItems with None -> () | Some v -> attribBuilder.Add(View._ToolbarItemsAttribKey, Array.ofList(v)) - match useSafeArea with None -> () | Some v -> attribBuilder.Add(View._UseSafeAreaAttribKey, (v)) - match appearing with None -> () | Some v -> attribBuilder.Add(View._Page_AppearingAttribKey, (fun f -> System.EventHandler(fun _sender _args -> f ()))(v)) - match disappearing with None -> () | Some v -> attribBuilder.Add(View._Page_DisappearingAttribKey, (fun f -> System.EventHandler(fun _sender _args -> f ()))(v)) - match layoutChanged with None -> () | Some v -> attribBuilder.Add(View._Page_LayoutChangedAttribKey, (fun f -> System.EventHandler(fun _sender _args -> f ()))(v)) + let attribBuilder = ViewBuilders.BuildVisualElement(attribCount, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match title with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TitleAttribKey, (v)) + match backgroundImage with None -> () | Some v -> attribBuilder.Add(ViewAttributes.BackgroundImageAttribKey, (v)) + match icon with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IconAttribKey, (v)) + match isBusy with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsBusyAttribKey, (v)) + match padding with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PaddingAttribKey, makeThickness(v)) + match toolbarItems with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ToolbarItemsAttribKey, Array.ofList(v)) + match useSafeArea with None -> () | Some v -> attribBuilder.Add(ViewAttributes.UseSafeAreaAttribKey, (v)) + match appearing with None -> () | Some v -> attribBuilder.Add(ViewAttributes.Page_AppearingAttribKey, (fun f -> System.EventHandler(fun _sender _args -> f ()))(v)) + match disappearing with None -> () | Some v -> attribBuilder.Add(ViewAttributes.Page_DisappearingAttribKey, (fun f -> System.EventHandler(fun _sender _args -> f ()))(v)) + match layoutChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.Page_LayoutChangedAttribKey, (fun f -> System.EventHandler(fun _sender _args -> f ()))(v)) attribBuilder - [] - static member val CreateFuncPage : (unit -> Xamarin.Forms.Page) = (fun () -> View.CreatePage()) + static member val CreateFuncPage : (unit -> Xamarin.Forms.Page) = (fun () -> ViewBuilders.CreatePage()) - [] - static member CreatePage () : Xamarin.Forms.Page = + static member CreatePage () : Xamarin.Forms.Page = upcast (new Xamarin.Forms.Page()) - [] - static member val UpdateFuncPage = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Page) -> View.UpdatePage (prevOpt, curr, target)) + static member val UpdateFuncPage = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Page) -> ViewBuilders.UpdatePage (prevOpt, curr, target)) - [] static member UpdatePage (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Page) = // update the inherited VisualElement element - let baseElement = (if View.ProtoVisualElement.IsNone then View.ProtoVisualElement <- Some (View.VisualElement())); View.ProtoVisualElement.Value + let baseElement = (if ViewProto.ProtoVisualElement.IsNone then ViewProto.ProtoVisualElement <- Some (ViewBuilders.ConstructVisualElement())); ViewProto.ProtoVisualElement.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevTitleOpt = ValueNone let mutable currTitleOpt = ValueNone @@ -9190,49 +8653,49 @@ type View() = let mutable prevPage_LayoutChangedOpt = ValueNone let mutable currPage_LayoutChangedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._TitleAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TitleAttribKey.KeyValue then currTitleOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._BackgroundImageAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BackgroundImageAttribKey.KeyValue then currBackgroundImageOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._IconAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IconAttribKey.KeyValue then currIconOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._IsBusyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsBusyAttribKey.KeyValue then currIsBusyOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._PaddingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PaddingAttribKey.KeyValue then currPaddingOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Thickness) - if kvp.Key = View._ToolbarItemsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ToolbarItemsAttribKey.KeyValue then currToolbarItemsOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._UseSafeAreaAttribKey.KeyValue then + if kvp.Key = ViewAttributes.UseSafeAreaAttribKey.KeyValue then currUseSafeAreaOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._Page_AppearingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.Page_AppearingAttribKey.KeyValue then currPage_AppearingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._Page_DisappearingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.Page_DisappearingAttribKey.KeyValue then currPage_DisappearingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._Page_LayoutChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.Page_LayoutChangedAttribKey.KeyValue then currPage_LayoutChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._TitleAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TitleAttribKey.KeyValue then prevTitleOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._BackgroundImageAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BackgroundImageAttribKey.KeyValue then prevBackgroundImageOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._IconAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IconAttribKey.KeyValue then prevIconOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._IsBusyAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsBusyAttribKey.KeyValue then prevIsBusyOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._PaddingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PaddingAttribKey.KeyValue then prevPaddingOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Thickness) - if kvp.Key = View._ToolbarItemsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ToolbarItemsAttribKey.KeyValue then prevToolbarItemsOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._UseSafeAreaAttribKey.KeyValue then + if kvp.Key = ViewAttributes.UseSafeAreaAttribKey.KeyValue then prevUseSafeAreaOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._Page_AppearingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.Page_AppearingAttribKey.KeyValue then prevPage_AppearingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._Page_DisappearingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.Page_DisappearingAttribKey.KeyValue then prevPage_DisappearingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._Page_LayoutChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.Page_LayoutChangedAttribKey.KeyValue then prevPage_LayoutChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevTitleOpt, currTitleOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -9284,50 +8747,49 @@ type View() = | ValueSome prevValue, ValueNone -> target.LayoutChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a Page in the view - static member inline Page(?title: string, - ?backgroundImage: string, - ?icon: string, - ?isBusy: bool, - ?padding: obj, - ?toolbarItems: ViewElement list, - ?useSafeArea: bool, - ?appearing: unit -> unit, - ?disappearing: unit -> unit, - ?layoutChanged: unit -> unit, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Page -> unit), - ?ref: ViewRef) = + static member ConstructPage(?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Page -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildPage(0, + let attribBuilder = ViewBuilders.BuildPage(0, ?title=title, ?backgroundImage=backgroundImage, ?icon=icon, @@ -9370,13 +8832,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncPage, View.UpdateFuncPage, attribBuilder) - - [] - static member val ProtoPage : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncPage, ViewBuilders.UpdateFuncPage, attribBuilder) /// Builds the attributes for a CarouselPage in the view - [] static member inline BuildCarouselPage(attribCount: int, ?children: ViewElement list, ?currentPage: int, @@ -9427,26 +8885,23 @@ type View() = let attribCount = match currentPage with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match currentPageChanged with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildPage(attribCount, ?title=title, ?backgroundImage=backgroundImage, ?icon=icon, ?isBusy=isBusy, ?padding=padding, ?toolbarItems=toolbarItems, ?useSafeArea=useSafeArea, ?appearing=appearing, ?disappearing=disappearing, ?layoutChanged=layoutChanged, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match children with None -> () | Some v -> attribBuilder.Add(View._ChildrenAttribKey, Array.ofList(v)) - match currentPage with None -> () | Some v -> attribBuilder.Add(View._CarouselPage_CurrentPageAttribKey, (v)) - match currentPageChanged with None -> () | Some v -> attribBuilder.Add(View._CarouselPage_CurrentPageChangedAttribKey, makeCurrentPageChanged(v)) + let attribBuilder = ViewBuilders.BuildPage(attribCount, ?title=title, ?backgroundImage=backgroundImage, ?icon=icon, ?isBusy=isBusy, ?padding=padding, ?toolbarItems=toolbarItems, ?useSafeArea=useSafeArea, ?appearing=appearing, ?disappearing=disappearing, ?layoutChanged=layoutChanged, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match children with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ChildrenAttribKey, Array.ofList(v)) + match currentPage with None -> () | Some v -> attribBuilder.Add(ViewAttributes.CarouselPage_CurrentPageAttribKey, (v)) + match currentPageChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.CarouselPage_CurrentPageChangedAttribKey, makeCurrentPageChanged(v)) attribBuilder - [] - static member val CreateFuncCarouselPage : (unit -> Xamarin.Forms.CarouselPage) = (fun () -> View.CreateCarouselPage()) + static member val CreateFuncCarouselPage : (unit -> Xamarin.Forms.CarouselPage) = (fun () -> ViewBuilders.CreateCarouselPage()) - [] - static member CreateCarouselPage () : Xamarin.Forms.CarouselPage = + static member CreateCarouselPage () : Xamarin.Forms.CarouselPage = upcast (new Xamarin.Forms.CarouselPage()) - [] - static member val UpdateFuncCarouselPage = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.CarouselPage) -> View.UpdateCarouselPage (prevOpt, curr, target)) + static member val UpdateFuncCarouselPage = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.CarouselPage) -> ViewBuilders.UpdateCarouselPage (prevOpt, curr, target)) - [] static member UpdateCarouselPage (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.CarouselPage) = // update the inherited Page element - let baseElement = (if View.ProtoPage.IsNone then View.ProtoPage <- Some (View.Page())); View.ProtoPage.Value + let baseElement = (if ViewProto.ProtoPage.IsNone then ViewProto.ProtoPage <- Some (ViewBuilders.ConstructPage())); ViewProto.ProtoPage.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevChildrenOpt = ValueNone let mutable currChildrenOpt = ValueNone @@ -9455,21 +8910,21 @@ type View() = let mutable prevCarouselPage_CurrentPageChangedOpt = ValueNone let mutable currCarouselPage_CurrentPageChangedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then currChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._CarouselPage_CurrentPageAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CarouselPage_CurrentPageAttribKey.KeyValue then currCarouselPage_CurrentPageOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._CarouselPage_CurrentPageChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CarouselPage_CurrentPageChangedAttribKey.KeyValue then currCarouselPage_CurrentPageChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then prevChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._CarouselPage_CurrentPageAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CarouselPage_CurrentPageAttribKey.KeyValue then prevCarouselPage_CurrentPageOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._CarouselPage_CurrentPageChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CarouselPage_CurrentPageChangedAttribKey.KeyValue then prevCarouselPage_CurrentPageChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) updateCollectionGeneric prevChildrenOpt currChildrenOpt target.Children (fun (x:ViewElement) -> x.Create() :?> Xamarin.Forms.ContentPage) @@ -9484,53 +8939,52 @@ type View() = | ValueSome prevValue, ValueNone -> target.CurrentPageChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a CarouselPage in the view - static member inline CarouselPage(?children: ViewElement list, - ?currentPage: int, - ?currentPageChanged: int option -> unit, - ?title: string, - ?backgroundImage: string, - ?icon: string, - ?isBusy: bool, - ?padding: obj, - ?toolbarItems: ViewElement list, - ?useSafeArea: bool, - ?appearing: unit -> unit, - ?disappearing: unit -> unit, - ?layoutChanged: unit -> unit, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.CarouselPage -> unit), - ?ref: ViewRef) = + static member ConstructCarouselPage(?children: ViewElement list, + ?currentPage: int, + ?currentPageChanged: int option -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.CarouselPage -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildCarouselPage(0, + let attribBuilder = ViewBuilders.BuildCarouselPage(0, ?children=children, ?currentPage=currentPage, ?currentPageChanged=currentPageChanged, @@ -9576,13 +9030,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncCarouselPage, View.UpdateFuncCarouselPage, attribBuilder) - - [] - static member val ProtoCarouselPage : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncCarouselPage, ViewBuilders.UpdateFuncCarouselPage, attribBuilder) /// Builds the attributes for a NavigationPage in the view - [] static member inline BuildNavigationPage(attribCount: int, ?pages: ViewElement list, ?barBackgroundColor: Xamarin.Forms.Color, @@ -9639,29 +9089,26 @@ type View() = let attribCount = match poppedToRoot with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match pushed with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildPage(attribCount, ?title=title, ?backgroundImage=backgroundImage, ?icon=icon, ?isBusy=isBusy, ?padding=padding, ?toolbarItems=toolbarItems, ?useSafeArea=useSafeArea, ?appearing=appearing, ?disappearing=disappearing, ?layoutChanged=layoutChanged, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match pages with None -> () | Some v -> attribBuilder.Add(View._PagesAttribKey, Array.ofList(v)) - match barBackgroundColor with None -> () | Some v -> attribBuilder.Add(View._BarBackgroundColorAttribKey, (v)) - match barTextColor with None -> () | Some v -> attribBuilder.Add(View._BarTextColorAttribKey, (v)) - match popped with None -> () | Some v -> attribBuilder.Add(View._PoppedAttribKey, (fun f -> System.EventHandler(fun sender args -> f args))(v)) - match poppedToRoot with None -> () | Some v -> attribBuilder.Add(View._PoppedToRootAttribKey, (fun f -> System.EventHandler(fun sender args -> f args))(v)) - match pushed with None -> () | Some v -> attribBuilder.Add(View._PushedAttribKey, (fun f -> System.EventHandler(fun sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildPage(attribCount, ?title=title, ?backgroundImage=backgroundImage, ?icon=icon, ?isBusy=isBusy, ?padding=padding, ?toolbarItems=toolbarItems, ?useSafeArea=useSafeArea, ?appearing=appearing, ?disappearing=disappearing, ?layoutChanged=layoutChanged, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match pages with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PagesAttribKey, Array.ofList(v)) + match barBackgroundColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.BarBackgroundColorAttribKey, (v)) + match barTextColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.BarTextColorAttribKey, (v)) + match popped with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PoppedAttribKey, (fun f -> System.EventHandler(fun sender args -> f args))(v)) + match poppedToRoot with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PoppedToRootAttribKey, (fun f -> System.EventHandler(fun sender args -> f args))(v)) + match pushed with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PushedAttribKey, (fun f -> System.EventHandler(fun sender args -> f args))(v)) attribBuilder - [] - static member val CreateFuncNavigationPage : (unit -> Xamarin.Forms.NavigationPage) = (fun () -> View.CreateNavigationPage()) + static member val CreateFuncNavigationPage : (unit -> Xamarin.Forms.NavigationPage) = (fun () -> ViewBuilders.CreateNavigationPage()) - [] - static member CreateNavigationPage () : Xamarin.Forms.NavigationPage = + static member CreateNavigationPage () : Xamarin.Forms.NavigationPage = upcast (new Xamarin.Forms.NavigationPage()) - [] - static member val UpdateFuncNavigationPage = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.NavigationPage) -> View.UpdateNavigationPage (prevOpt, curr, target)) + static member val UpdateFuncNavigationPage = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.NavigationPage) -> ViewBuilders.UpdateNavigationPage (prevOpt, curr, target)) - [] static member UpdateNavigationPage (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.NavigationPage) = // update the inherited Page element - let baseElement = (if View.ProtoPage.IsNone then View.ProtoPage <- Some (View.Page())); View.ProtoPage.Value + let baseElement = (if ViewProto.ProtoPage.IsNone then ViewProto.ProtoPage <- Some (ViewBuilders.ConstructPage())); ViewProto.ProtoPage.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevPagesOpt = ValueNone let mutable currPagesOpt = ValueNone @@ -9676,71 +9123,71 @@ type View() = let mutable prevPushedOpt = ValueNone let mutable currPushedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._PagesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PagesAttribKey.KeyValue then currPagesOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._BarBackgroundColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BarBackgroundColorAttribKey.KeyValue then currBarBackgroundColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._BarTextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BarTextColorAttribKey.KeyValue then currBarTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._PoppedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PoppedAttribKey.KeyValue then currPoppedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._PoppedToRootAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PoppedToRootAttribKey.KeyValue then currPoppedToRootOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._PushedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PushedAttribKey.KeyValue then currPushedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._PagesAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PagesAttribKey.KeyValue then prevPagesOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._BarBackgroundColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BarBackgroundColorAttribKey.KeyValue then prevBarBackgroundColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._BarTextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BarTextColorAttribKey.KeyValue then prevBarTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._PoppedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PoppedAttribKey.KeyValue then prevPoppedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._PoppedToRootAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PoppedToRootAttribKey.KeyValue then prevPoppedToRootOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._PushedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PushedAttribKey.KeyValue then prevPushedOpt <- ValueSome (kvp.Value :?> System.EventHandler) updateNavigationPages prevPagesOpt currPagesOpt target (fun prevChildOpt newChild targetChild -> // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._BackButtonTitleAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._BackButtonTitleAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.BackButtonTitleAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.BackButtonTitleAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currValue when prevChildValue = currValue -> () | _, ValueSome currValue -> Xamarin.Forms.NavigationPage.SetBackButtonTitle(targetChild, currValue) | ValueSome _, ValueNone -> Xamarin.Forms.NavigationPage.SetBackButtonTitle(targetChild, null) // TODO: not always perfect, should set back to original default? | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._HasBackButtonAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._HasBackButtonAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.HasBackButtonAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.HasBackButtonAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currValue when prevChildValue = currValue -> () | _, ValueSome currValue -> Xamarin.Forms.NavigationPage.SetHasBackButton(targetChild, currValue) | ValueSome _, ValueNone -> Xamarin.Forms.NavigationPage.SetHasBackButton(targetChild, true) // TODO: not always perfect, should set back to original default? | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._HasNavigationBarAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._HasNavigationBarAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.HasNavigationBarAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.HasNavigationBarAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currValue when prevChildValue = currValue -> () | _, ValueSome currValue -> Xamarin.Forms.NavigationPage.SetHasNavigationBar(targetChild, currValue) | ValueSome _, ValueNone -> Xamarin.Forms.NavigationPage.SetHasNavigationBar(targetChild, true) // TODO: not always perfect, should set back to original default? | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._TitleIconAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._TitleIconAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.TitleIconAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.TitleIconAttribKey) match prevChildValueOpt, childValueOpt with | ValueSome prevChildValue, ValueSome currValue when prevChildValue = currValue -> () | _, ValueSome currValue -> Xamarin.Forms.NavigationPage.SetTitleIcon(targetChild, makeFileImageSource currValue) | ValueSome _, ValueNone -> Xamarin.Forms.NavigationPage.SetTitleIcon(targetChild, null) // TODO: not always perfect, should set back to original default? | _ -> () // Adjust the attached properties - let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(View._TitleViewAttribKey) - let childValueOpt = newChild.TryGetAttributeKeyed(View._TitleViewAttribKey) + let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed(ViewAttributes.TitleViewAttribKey) + let childValueOpt = newChild.TryGetAttributeKeyed(ViewAttributes.TitleViewAttribKey) updatePageTitleView prevChildValueOpt childValueOpt targetChild ()) match prevBarBackgroundColorOpt, currBarBackgroundColorOpt with @@ -9772,56 +9219,55 @@ type View() = | ValueSome prevValue, ValueNone -> target.Pushed.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a NavigationPage in the view - static member inline NavigationPage(?pages: ViewElement list, - ?barBackgroundColor: Xamarin.Forms.Color, - ?barTextColor: Xamarin.Forms.Color, - ?popped: Xamarin.Forms.NavigationEventArgs -> unit, - ?poppedToRoot: Xamarin.Forms.NavigationEventArgs -> unit, - ?pushed: Xamarin.Forms.NavigationEventArgs -> unit, - ?title: string, - ?backgroundImage: string, - ?icon: string, - ?isBusy: bool, - ?padding: obj, - ?toolbarItems: ViewElement list, - ?useSafeArea: bool, - ?appearing: unit -> unit, - ?disappearing: unit -> unit, - ?layoutChanged: unit -> unit, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.NavigationPage -> unit), - ?ref: ViewRef) = + static member ConstructNavigationPage(?pages: ViewElement list, + ?barBackgroundColor: Xamarin.Forms.Color, + ?barTextColor: Xamarin.Forms.Color, + ?popped: Xamarin.Forms.NavigationEventArgs -> unit, + ?poppedToRoot: Xamarin.Forms.NavigationEventArgs -> unit, + ?pushed: Xamarin.Forms.NavigationEventArgs -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.NavigationPage -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildNavigationPage(0, + let attribBuilder = ViewBuilders.BuildNavigationPage(0, ?pages=pages, ?barBackgroundColor=barBackgroundColor, ?barTextColor=barTextColor, @@ -9870,13 +9316,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncNavigationPage, View.UpdateFuncNavigationPage, attribBuilder) - - [] - static member val ProtoNavigationPage : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncNavigationPage, ViewBuilders.UpdateFuncNavigationPage, attribBuilder) /// Builds the attributes for a TabbedPage in the view - [] static member inline BuildTabbedPage(attribCount: int, ?children: ViewElement list, ?barBackgroundColor: Xamarin.Forms.Color, @@ -9931,28 +9373,25 @@ type View() = let attribCount = match currentPage with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match currentPageChanged with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildPage(attribCount, ?title=title, ?backgroundImage=backgroundImage, ?icon=icon, ?isBusy=isBusy, ?padding=padding, ?toolbarItems=toolbarItems, ?useSafeArea=useSafeArea, ?appearing=appearing, ?disappearing=disappearing, ?layoutChanged=layoutChanged, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match children with None -> () | Some v -> attribBuilder.Add(View._ChildrenAttribKey, Array.ofList(v)) - match barBackgroundColor with None -> () | Some v -> attribBuilder.Add(View._BarBackgroundColorAttribKey, (v)) - match barTextColor with None -> () | Some v -> attribBuilder.Add(View._BarTextColorAttribKey, (v)) - match currentPage with None -> () | Some v -> attribBuilder.Add(View._TabbedPage_CurrentPageAttribKey, (v)) - match currentPageChanged with None -> () | Some v -> attribBuilder.Add(View._TabbedPage_CurrentPageChangedAttribKey, makeCurrentPageChanged(v)) + let attribBuilder = ViewBuilders.BuildPage(attribCount, ?title=title, ?backgroundImage=backgroundImage, ?icon=icon, ?isBusy=isBusy, ?padding=padding, ?toolbarItems=toolbarItems, ?useSafeArea=useSafeArea, ?appearing=appearing, ?disappearing=disappearing, ?layoutChanged=layoutChanged, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match children with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ChildrenAttribKey, Array.ofList(v)) + match barBackgroundColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.BarBackgroundColorAttribKey, (v)) + match barTextColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.BarTextColorAttribKey, (v)) + match currentPage with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TabbedPage_CurrentPageAttribKey, (v)) + match currentPageChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TabbedPage_CurrentPageChangedAttribKey, makeCurrentPageChanged(v)) attribBuilder - [] - static member val CreateFuncTabbedPage : (unit -> Xamarin.Forms.TabbedPage) = (fun () -> View.CreateTabbedPage()) + static member val CreateFuncTabbedPage : (unit -> Xamarin.Forms.TabbedPage) = (fun () -> ViewBuilders.CreateTabbedPage()) - [] - static member CreateTabbedPage () : Xamarin.Forms.TabbedPage = + static member CreateTabbedPage () : Xamarin.Forms.TabbedPage = upcast (new Xamarin.Forms.TabbedPage()) - [] - static member val UpdateFuncTabbedPage = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TabbedPage) -> View.UpdateTabbedPage (prevOpt, curr, target)) + static member val UpdateFuncTabbedPage = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TabbedPage) -> ViewBuilders.UpdateTabbedPage (prevOpt, curr, target)) - [] static member UpdateTabbedPage (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.TabbedPage) = // update the inherited Page element - let baseElement = (if View.ProtoPage.IsNone then View.ProtoPage <- Some (View.Page())); View.ProtoPage.Value + let baseElement = (if ViewProto.ProtoPage.IsNone then ViewProto.ProtoPage <- Some (ViewBuilders.ConstructPage())); ViewProto.ProtoPage.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevChildrenOpt = ValueNone let mutable currChildrenOpt = ValueNone @@ -9965,29 +9404,29 @@ type View() = let mutable prevTabbedPage_CurrentPageChangedOpt = ValueNone let mutable currTabbedPage_CurrentPageChangedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then currChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._BarBackgroundColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BarBackgroundColorAttribKey.KeyValue then currBarBackgroundColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._BarTextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BarTextColorAttribKey.KeyValue then currBarTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._TabbedPage_CurrentPageAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TabbedPage_CurrentPageAttribKey.KeyValue then currTabbedPage_CurrentPageOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._TabbedPage_CurrentPageChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TabbedPage_CurrentPageChangedAttribKey.KeyValue then currTabbedPage_CurrentPageChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ChildrenAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ChildrenAttribKey.KeyValue then prevChildrenOpt <- ValueSome (kvp.Value :?> ViewElement[]) - if kvp.Key = View._BarBackgroundColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BarBackgroundColorAttribKey.KeyValue then prevBarBackgroundColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._BarTextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.BarTextColorAttribKey.KeyValue then prevBarTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._TabbedPage_CurrentPageAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TabbedPage_CurrentPageAttribKey.KeyValue then prevTabbedPage_CurrentPageOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._TabbedPage_CurrentPageChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TabbedPage_CurrentPageChangedAttribKey.KeyValue then prevTabbedPage_CurrentPageChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) updateCollectionGeneric prevChildrenOpt currChildrenOpt target.Children (fun (x:ViewElement) -> x.Create() :?> Xamarin.Forms.Page) @@ -10012,55 +9451,54 @@ type View() = | ValueSome prevValue, ValueNone -> target.CurrentPageChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a TabbedPage in the view - static member inline TabbedPage(?children: ViewElement list, - ?barBackgroundColor: Xamarin.Forms.Color, - ?barTextColor: Xamarin.Forms.Color, - ?currentPage: int, - ?currentPageChanged: int option -> unit, - ?title: string, - ?backgroundImage: string, - ?icon: string, - ?isBusy: bool, - ?padding: obj, - ?toolbarItems: ViewElement list, - ?useSafeArea: bool, - ?appearing: unit -> unit, - ?disappearing: unit -> unit, - ?layoutChanged: unit -> unit, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.TabbedPage -> unit), - ?ref: ViewRef) = + static member ConstructTabbedPage(?children: ViewElement list, + ?barBackgroundColor: Xamarin.Forms.Color, + ?barTextColor: Xamarin.Forms.Color, + ?currentPage: int, + ?currentPageChanged: int option -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TabbedPage -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildTabbedPage(0, + let attribBuilder = ViewBuilders.BuildTabbedPage(0, ?children=children, ?barBackgroundColor=barBackgroundColor, ?barTextColor=barTextColor, @@ -10108,13 +9546,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncTabbedPage, View.UpdateFuncTabbedPage, attribBuilder) - - [] - static member val ProtoTabbedPage : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncTabbedPage, ViewBuilders.UpdateFuncTabbedPage, attribBuilder) /// Builds the attributes for a ContentPage in the view - [] static member inline BuildContentPage(attribCount: int, ?content: ViewElement, ?onSizeAllocated: (double * double) -> unit, @@ -10163,42 +9597,39 @@ type View() = let attribCount = match content with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match onSizeAllocated with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildPage(attribCount, ?title=title, ?backgroundImage=backgroundImage, ?icon=icon, ?isBusy=isBusy, ?padding=padding, ?toolbarItems=toolbarItems, ?useSafeArea=useSafeArea, ?appearing=appearing, ?disappearing=disappearing, ?layoutChanged=layoutChanged, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match content with None -> () | Some v -> attribBuilder.Add(View._ContentAttribKey, (v)) - match onSizeAllocated with None -> () | Some v -> attribBuilder.Add(View._OnSizeAllocatedCallbackAttribKey, (fun f -> FSharp.Control.Handler<_>(fun _sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildPage(attribCount, ?title=title, ?backgroundImage=backgroundImage, ?icon=icon, ?isBusy=isBusy, ?padding=padding, ?toolbarItems=toolbarItems, ?useSafeArea=useSafeArea, ?appearing=appearing, ?disappearing=disappearing, ?layoutChanged=layoutChanged, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match content with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ContentAttribKey, (v)) + match onSizeAllocated with None -> () | Some v -> attribBuilder.Add(ViewAttributes.OnSizeAllocatedCallbackAttribKey, (fun f -> FSharp.Control.Handler<_>(fun _sender args -> f args))(v)) attribBuilder - [] - static member val CreateFuncContentPage : (unit -> Xamarin.Forms.ContentPage) = (fun () -> View.CreateContentPage()) + static member val CreateFuncContentPage : (unit -> Xamarin.Forms.ContentPage) = (fun () -> ViewBuilders.CreateContentPage()) - [] - static member CreateContentPage () : Xamarin.Forms.ContentPage = + static member CreateContentPage () : Xamarin.Forms.ContentPage = upcast (new Fabulous.DynamicViews.CustomContentPage()) - [] - static member val UpdateFuncContentPage = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ContentPage) -> View.UpdateContentPage (prevOpt, curr, target)) + static member val UpdateFuncContentPage = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ContentPage) -> ViewBuilders.UpdateContentPage (prevOpt, curr, target)) - [] static member UpdateContentPage (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ContentPage) = // update the inherited Page element - let baseElement = (if View.ProtoPage.IsNone then View.ProtoPage <- Some (View.Page())); View.ProtoPage.Value + let baseElement = (if ViewProto.ProtoPage.IsNone then ViewProto.ProtoPage <- Some (ViewBuilders.ConstructPage())); ViewProto.ProtoPage.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevContentOpt = ValueNone let mutable currContentOpt = ValueNone let mutable prevOnSizeAllocatedCallbackOpt = ValueNone let mutable currOnSizeAllocatedCallbackOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ContentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ContentAttribKey.KeyValue then currContentOpt <- ValueSome (kvp.Value :?> ViewElement) - if kvp.Key = View._OnSizeAllocatedCallbackAttribKey.KeyValue then + if kvp.Key = ViewAttributes.OnSizeAllocatedCallbackAttribKey.KeyValue then currOnSizeAllocatedCallbackOpt <- ValueSome (kvp.Value :?> FSharp.Control.Handler<(double * double)>) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ContentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ContentAttribKey.KeyValue then prevContentOpt <- ValueSome (kvp.Value :?> ViewElement) - if kvp.Key = View._OnSizeAllocatedCallbackAttribKey.KeyValue then + if kvp.Key = ViewAttributes.OnSizeAllocatedCallbackAttribKey.KeyValue then prevOnSizeAllocatedCallbackOpt <- ValueSome (kvp.Value :?> FSharp.Control.Handler<(double * double)>) match prevContentOpt, currContentOpt with // For structured objects, dependsOn on reference equality @@ -10212,52 +9643,51 @@ type View() = | ValueNone, ValueNone -> () updateOnSizeAllocated prevOnSizeAllocatedCallbackOpt currOnSizeAllocatedCallbackOpt target - /// Describes a ContentPage in the view - static member inline ContentPage(?content: ViewElement, - ?onSizeAllocated: (double * double) -> unit, - ?title: string, - ?backgroundImage: string, - ?icon: string, - ?isBusy: bool, - ?padding: obj, - ?toolbarItems: ViewElement list, - ?useSafeArea: bool, - ?appearing: unit -> unit, - ?disappearing: unit -> unit, - ?layoutChanged: unit -> unit, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ContentPage -> unit), - ?ref: ViewRef) = + static member ConstructContentPage(?content: ViewElement, + ?onSizeAllocated: (double * double) -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ContentPage -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildContentPage(0, + let attribBuilder = ViewBuilders.BuildContentPage(0, ?content=content, ?onSizeAllocated=onSizeAllocated, ?title=title, @@ -10302,13 +9732,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncContentPage, View.UpdateFuncContentPage, attribBuilder) - - [] - static member val ProtoContentPage : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncContentPage, ViewBuilders.UpdateFuncContentPage, attribBuilder) /// Builds the attributes for a MasterDetailPage in the view - [] static member inline BuildMasterDetailPage(attribCount: int, ?master: ViewElement, ?detail: ViewElement, @@ -10365,29 +9791,26 @@ type View() = let attribCount = match masterBehavior with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match isPresentedChanged with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildPage(attribCount, ?title=title, ?backgroundImage=backgroundImage, ?icon=icon, ?isBusy=isBusy, ?padding=padding, ?toolbarItems=toolbarItems, ?useSafeArea=useSafeArea, ?appearing=appearing, ?disappearing=disappearing, ?layoutChanged=layoutChanged, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match master with None -> () | Some v -> attribBuilder.Add(View._MasterAttribKey, (v)) - match detail with None -> () | Some v -> attribBuilder.Add(View._DetailAttribKey, (v)) - match isGestureEnabled with None -> () | Some v -> attribBuilder.Add(View._IsGestureEnabledAttribKey, (v)) - match isPresented with None -> () | Some v -> attribBuilder.Add(View._IsPresentedAttribKey, (v)) - match masterBehavior with None -> () | Some v -> attribBuilder.Add(View._MasterBehaviorAttribKey, (v)) - match isPresentedChanged with None -> () | Some v -> attribBuilder.Add(View._IsPresentedChangedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.MasterDetailPage).IsPresented))(v)) + let attribBuilder = ViewBuilders.BuildPage(attribCount, ?title=title, ?backgroundImage=backgroundImage, ?icon=icon, ?isBusy=isBusy, ?padding=padding, ?toolbarItems=toolbarItems, ?useSafeArea=useSafeArea, ?appearing=appearing, ?disappearing=disappearing, ?layoutChanged=layoutChanged, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match master with None -> () | Some v -> attribBuilder.Add(ViewAttributes.MasterAttribKey, (v)) + match detail with None -> () | Some v -> attribBuilder.Add(ViewAttributes.DetailAttribKey, (v)) + match isGestureEnabled with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsGestureEnabledAttribKey, (v)) + match isPresented with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsPresentedAttribKey, (v)) + match masterBehavior with None -> () | Some v -> attribBuilder.Add(ViewAttributes.MasterBehaviorAttribKey, (v)) + match isPresentedChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsPresentedChangedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.MasterDetailPage).IsPresented))(v)) attribBuilder - [] - static member val CreateFuncMasterDetailPage : (unit -> Xamarin.Forms.MasterDetailPage) = (fun () -> View.CreateMasterDetailPage()) + static member val CreateFuncMasterDetailPage : (unit -> Xamarin.Forms.MasterDetailPage) = (fun () -> ViewBuilders.CreateMasterDetailPage()) - [] - static member CreateMasterDetailPage () : Xamarin.Forms.MasterDetailPage = + static member CreateMasterDetailPage () : Xamarin.Forms.MasterDetailPage = upcast (new Xamarin.Forms.MasterDetailPage()) - [] - static member val UpdateFuncMasterDetailPage = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.MasterDetailPage) -> View.UpdateMasterDetailPage (prevOpt, curr, target)) + static member val UpdateFuncMasterDetailPage = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.MasterDetailPage) -> ViewBuilders.UpdateMasterDetailPage (prevOpt, curr, target)) - [] static member UpdateMasterDetailPage (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.MasterDetailPage) = // update the inherited Page element - let baseElement = (if View.ProtoPage.IsNone then View.ProtoPage <- Some (View.Page())); View.ProtoPage.Value + let baseElement = (if ViewProto.ProtoPage.IsNone then ViewProto.ProtoPage <- Some (ViewBuilders.ConstructPage())); ViewProto.ProtoPage.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevMasterOpt = ValueNone let mutable currMasterOpt = ValueNone @@ -10402,33 +9825,33 @@ type View() = let mutable prevIsPresentedChangedOpt = ValueNone let mutable currIsPresentedChangedOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._MasterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MasterAttribKey.KeyValue then currMasterOpt <- ValueSome (kvp.Value :?> ViewElement) - if kvp.Key = View._DetailAttribKey.KeyValue then + if kvp.Key = ViewAttributes.DetailAttribKey.KeyValue then currDetailOpt <- ValueSome (kvp.Value :?> ViewElement) - if kvp.Key = View._IsGestureEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsGestureEnabledAttribKey.KeyValue then currIsGestureEnabledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._IsPresentedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsPresentedAttribKey.KeyValue then currIsPresentedOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._MasterBehaviorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MasterBehaviorAttribKey.KeyValue then currMasterBehaviorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.MasterBehavior) - if kvp.Key = View._IsPresentedChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsPresentedChangedAttribKey.KeyValue then currIsPresentedChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._MasterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MasterAttribKey.KeyValue then prevMasterOpt <- ValueSome (kvp.Value :?> ViewElement) - if kvp.Key = View._DetailAttribKey.KeyValue then + if kvp.Key = ViewAttributes.DetailAttribKey.KeyValue then prevDetailOpt <- ValueSome (kvp.Value :?> ViewElement) - if kvp.Key = View._IsGestureEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsGestureEnabledAttribKey.KeyValue then prevIsGestureEnabledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._IsPresentedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsPresentedAttribKey.KeyValue then prevIsPresentedOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._MasterBehaviorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.MasterBehaviorAttribKey.KeyValue then prevMasterBehaviorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.MasterBehavior) - if kvp.Key = View._IsPresentedChangedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsPresentedChangedAttribKey.KeyValue then prevIsPresentedChangedOpt <- ValueSome (kvp.Value :?> System.EventHandler) match prevMasterOpt, currMasterOpt with // For structured objects, dependsOn on reference equality @@ -10472,56 +9895,55 @@ type View() = | ValueSome prevValue, ValueNone -> target.IsPresentedChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - /// Describes a MasterDetailPage in the view - static member inline MasterDetailPage(?master: ViewElement, - ?detail: ViewElement, - ?isGestureEnabled: bool, - ?isPresented: bool, - ?masterBehavior: Xamarin.Forms.MasterBehavior, - ?isPresentedChanged: bool -> unit, - ?title: string, - ?backgroundImage: string, - ?icon: string, - ?isBusy: bool, - ?padding: obj, - ?toolbarItems: ViewElement list, - ?useSafeArea: bool, - ?appearing: unit -> unit, - ?disappearing: unit -> unit, - ?layoutChanged: unit -> unit, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.MasterDetailPage -> unit), - ?ref: ViewRef) = + static member ConstructMasterDetailPage(?master: ViewElement, + ?detail: ViewElement, + ?isGestureEnabled: bool, + ?isPresented: bool, + ?masterBehavior: Xamarin.Forms.MasterBehavior, + ?isPresentedChanged: bool -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.MasterDetailPage -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildMasterDetailPage(0, + let attribBuilder = ViewBuilders.BuildMasterDetailPage(0, ?master=master, ?detail=detail, ?isGestureEnabled=isGestureEnabled, @@ -10570,13 +9992,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncMasterDetailPage, View.UpdateFuncMasterDetailPage, attribBuilder) - - [] - static member val ProtoMasterDetailPage : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncMasterDetailPage, ViewBuilders.UpdateFuncMasterDetailPage, attribBuilder) /// Builds the attributes for a MenuItem in the view - [] static member inline BuildMenuItem(attribCount: int, ?text: string, ?command: unit -> unit, @@ -10595,28 +10013,25 @@ type View() = let attribCount = match icon with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match accelerator with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match text with None -> () | Some v -> attribBuilder.Add(View._TextAttribKey, (v)) - match command with None -> () | Some v -> attribBuilder.Add(View._CommandAttribKey, makeCommand(v)) - match commandParameter with None -> () | Some v -> attribBuilder.Add(View._CommandParameterAttribKey, (v)) - match icon with None -> () | Some v -> attribBuilder.Add(View._IconAttribKey, (v)) - match accelerator with None -> () | Some v -> attribBuilder.Add(View._AcceleratorAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildElement(attribCount, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match text with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextAttribKey, (v)) + match command with None -> () | Some v -> attribBuilder.Add(ViewAttributes.CommandAttribKey, makeCommand(v)) + match commandParameter with None -> () | Some v -> attribBuilder.Add(ViewAttributes.CommandParameterAttribKey, (v)) + match icon with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IconAttribKey, (v)) + match accelerator with None -> () | Some v -> attribBuilder.Add(ViewAttributes.AcceleratorAttribKey, (v)) attribBuilder - [] - static member val CreateFuncMenuItem : (unit -> Xamarin.Forms.MenuItem) = (fun () -> View.CreateMenuItem()) + static member val CreateFuncMenuItem : (unit -> Xamarin.Forms.MenuItem) = (fun () -> ViewBuilders.CreateMenuItem()) - [] - static member CreateMenuItem () : Xamarin.Forms.MenuItem = + static member CreateMenuItem () : Xamarin.Forms.MenuItem = upcast (new Xamarin.Forms.MenuItem()) - [] - static member val UpdateFuncMenuItem = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.MenuItem) -> View.UpdateMenuItem (prevOpt, curr, target)) + static member val UpdateFuncMenuItem = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.MenuItem) -> ViewBuilders.UpdateMenuItem (prevOpt, curr, target)) - [] static member UpdateMenuItem (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.MenuItem) = // update the inherited Element element - let baseElement = (if View.ProtoElement.IsNone then View.ProtoElement <- Some (View.Element())); View.ProtoElement.Value + let baseElement = (if ViewProto.ProtoElement.IsNone then ViewProto.ProtoElement <- Some (ViewBuilders.ConstructElement())); ViewProto.ProtoElement.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevTextOpt = ValueNone let mutable currTextOpt = ValueNone @@ -10629,29 +10044,29 @@ type View() = let mutable prevAcceleratorOpt = ValueNone let mutable currAcceleratorOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then currTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._CommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandAttribKey.KeyValue then currCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._CommandParameterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandParameterAttribKey.KeyValue then currCommandParameterOpt <- ValueSome (kvp.Value :?> System.Object) - if kvp.Key = View._IconAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IconAttribKey.KeyValue then currIconOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._AcceleratorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AcceleratorAttribKey.KeyValue then currAcceleratorOpt <- ValueSome (kvp.Value :?> string) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then prevTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._CommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandAttribKey.KeyValue then prevCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._CommandParameterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandParameterAttribKey.KeyValue then prevCommandParameterOpt <- ValueSome (kvp.Value :?> System.Object) - if kvp.Key = View._IconAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IconAttribKey.KeyValue then prevIconOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._AcceleratorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.AcceleratorAttribKey.KeyValue then prevAcceleratorOpt <- ValueSome (kvp.Value :?> string) match prevTextOpt, currTextOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -10675,19 +10090,18 @@ type View() = | ValueNone, ValueNone -> () updateAccelerator prevAcceleratorOpt currAcceleratorOpt target - /// Describes a MenuItem in the view - static member inline MenuItem(?text: string, - ?command: unit -> unit, - ?commandParameter: System.Object, - ?icon: string, - ?accelerator: string, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.MenuItem -> unit), - ?ref: ViewRef) = + static member ConstructMenuItem(?text: string, + ?command: unit -> unit, + ?commandParameter: System.Object, + ?icon: string, + ?accelerator: string, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.MenuItem -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildMenuItem(0, + let attribBuilder = ViewBuilders.BuildMenuItem(0, ?text=text, ?command=command, ?commandParameter=commandParameter, @@ -10699,13 +10113,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncMenuItem, View.UpdateFuncMenuItem, attribBuilder) - - [] - static member val ProtoMenuItem : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncMenuItem, ViewBuilders.UpdateFuncMenuItem, attribBuilder) /// Builds the attributes for a TextCell in the view - [] static member inline BuildTextCell(attribCount: int, ?text: string, ?detail: string, @@ -10730,30 +10140,27 @@ type View() = let attribCount = match canExecute with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match commandParameter with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildCell(attribCount, ?height=height, ?isEnabled=isEnabled, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match text with None -> () | Some v -> attribBuilder.Add(View._TextAttribKey, (v)) - match detail with None -> () | Some v -> attribBuilder.Add(View._TextDetailAttribKey, (v)) - match textColor with None -> () | Some v -> attribBuilder.Add(View._TextColorAttribKey, (v)) - match detailColor with None -> () | Some v -> attribBuilder.Add(View._TextDetailColorAttribKey, (v)) - match command with None -> () | Some v -> attribBuilder.Add(View._TextCellCommandAttribKey, (v)) - match canExecute with None -> () | Some v -> attribBuilder.Add(View._TextCellCanExecuteAttribKey, (v)) - match commandParameter with None -> () | Some v -> attribBuilder.Add(View._CommandParameterAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildCell(attribCount, ?height=height, ?isEnabled=isEnabled, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match text with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextAttribKey, (v)) + match detail with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextDetailAttribKey, (v)) + match textColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextColorAttribKey, (v)) + match detailColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextDetailColorAttribKey, (v)) + match command with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextCellCommandAttribKey, (v)) + match canExecute with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextCellCanExecuteAttribKey, (v)) + match commandParameter with None -> () | Some v -> attribBuilder.Add(ViewAttributes.CommandParameterAttribKey, (v)) attribBuilder - [] - static member val CreateFuncTextCell : (unit -> Xamarin.Forms.TextCell) = (fun () -> View.CreateTextCell()) + static member val CreateFuncTextCell : (unit -> Xamarin.Forms.TextCell) = (fun () -> ViewBuilders.CreateTextCell()) - [] - static member CreateTextCell () : Xamarin.Forms.TextCell = + static member CreateTextCell () : Xamarin.Forms.TextCell = upcast (new Xamarin.Forms.TextCell()) - [] - static member val UpdateFuncTextCell = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TextCell) -> View.UpdateTextCell (prevOpt, curr, target)) + static member val UpdateFuncTextCell = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TextCell) -> ViewBuilders.UpdateTextCell (prevOpt, curr, target)) - [] static member UpdateTextCell (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.TextCell) = // update the inherited Cell element - let baseElement = (if View.ProtoCell.IsNone then View.ProtoCell <- Some (View.Cell())); View.ProtoCell.Value + let baseElement = (if ViewProto.ProtoCell.IsNone then ViewProto.ProtoCell <- Some (ViewBuilders.ConstructCell())); ViewProto.ProtoCell.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevTextOpt = ValueNone let mutable currTextOpt = ValueNone @@ -10770,37 +10177,37 @@ type View() = let mutable prevCommandParameterOpt = ValueNone let mutable currCommandParameterOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then currTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextDetailAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextDetailAttribKey.KeyValue then currTextDetailOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then currTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._TextDetailColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextDetailColorAttribKey.KeyValue then currTextDetailColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._TextCellCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextCellCommandAttribKey.KeyValue then currTextCellCommandOpt <- ValueSome (kvp.Value :?> unit -> unit) - if kvp.Key = View._TextCellCanExecuteAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextCellCanExecuteAttribKey.KeyValue then currTextCellCanExecuteOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._CommandParameterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandParameterAttribKey.KeyValue then currCommandParameterOpt <- ValueSome (kvp.Value :?> System.Object) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._TextAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then prevTextOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextDetailAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextDetailAttribKey.KeyValue then prevTextDetailOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._TextColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextColorAttribKey.KeyValue then prevTextColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._TextDetailColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextDetailColorAttribKey.KeyValue then prevTextDetailColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._TextCellCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextCellCommandAttribKey.KeyValue then prevTextCellCommandOpt <- ValueSome (kvp.Value :?> unit -> unit) - if kvp.Key = View._TextCellCanExecuteAttribKey.KeyValue then + if kvp.Key = ViewAttributes.TextCellCanExecuteAttribKey.KeyValue then prevTextCellCanExecuteOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._CommandParameterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.CommandParameterAttribKey.KeyValue then prevCommandParameterOpt <- ValueSome (kvp.Value :?> System.Object) match prevTextOpt, currTextOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -10830,23 +10237,22 @@ type View() = | ValueSome _, ValueNone -> target.CommandParameter <- null | ValueNone, ValueNone -> () - /// Describes a TextCell in the view - static member inline TextCell(?text: string, - ?detail: string, - ?textColor: Xamarin.Forms.Color, - ?detailColor: Xamarin.Forms.Color, - ?command: unit -> unit, - ?canExecute: bool, - ?commandParameter: System.Object, - ?height: double, - ?isEnabled: bool, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.TextCell -> unit), - ?ref: ViewRef) = + static member ConstructTextCell(?text: string, + ?detail: string, + ?textColor: Xamarin.Forms.Color, + ?detailColor: Xamarin.Forms.Color, + ?command: unit -> unit, + ?canExecute: bool, + ?commandParameter: System.Object, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TextCell -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildTextCell(0, + let attribBuilder = ViewBuilders.BuildTextCell(0, ?text=text, ?detail=detail, ?textColor=textColor, @@ -10862,13 +10268,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncTextCell, View.UpdateFuncTextCell, attribBuilder) - - [] - static member val ProtoTextCell : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncTextCell, ViewBuilders.UpdateFuncTextCell, attribBuilder) /// Builds the attributes for a ToolbarItem in the view - [] static member inline BuildToolbarItem(attribCount: int, ?order: Xamarin.Forms.ToolbarItemOrder, ?priority: int, @@ -10886,42 +10288,39 @@ type View() = let attribCount = match order with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match priority with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildMenuItem(attribCount, ?text=text, ?command=command, ?commandParameter=commandParameter, ?icon=icon, ?accelerator=accelerator, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match order with None -> () | Some v -> attribBuilder.Add(View._OrderAttribKey, (v)) - match priority with None -> () | Some v -> attribBuilder.Add(View._PriorityAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildMenuItem(attribCount, ?text=text, ?command=command, ?commandParameter=commandParameter, ?icon=icon, ?accelerator=accelerator, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match order with None -> () | Some v -> attribBuilder.Add(ViewAttributes.OrderAttribKey, (v)) + match priority with None -> () | Some v -> attribBuilder.Add(ViewAttributes.PriorityAttribKey, (v)) attribBuilder - [] - static member val CreateFuncToolbarItem : (unit -> Xamarin.Forms.ToolbarItem) = (fun () -> View.CreateToolbarItem()) + static member val CreateFuncToolbarItem : (unit -> Xamarin.Forms.ToolbarItem) = (fun () -> ViewBuilders.CreateToolbarItem()) - [] - static member CreateToolbarItem () : Xamarin.Forms.ToolbarItem = + static member CreateToolbarItem () : Xamarin.Forms.ToolbarItem = upcast (new Xamarin.Forms.ToolbarItem()) - [] - static member val UpdateFuncToolbarItem = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ToolbarItem) -> View.UpdateToolbarItem (prevOpt, curr, target)) + static member val UpdateFuncToolbarItem = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ToolbarItem) -> ViewBuilders.UpdateToolbarItem (prevOpt, curr, target)) - [] static member UpdateToolbarItem (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ToolbarItem) = // update the inherited MenuItem element - let baseElement = (if View.ProtoMenuItem.IsNone then View.ProtoMenuItem <- Some (View.MenuItem())); View.ProtoMenuItem.Value + let baseElement = (if ViewProto.ProtoMenuItem.IsNone then ViewProto.ProtoMenuItem <- Some (ViewBuilders.ConstructMenuItem())); ViewProto.ProtoMenuItem.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevOrderOpt = ValueNone let mutable currOrderOpt = ValueNone let mutable prevPriorityOpt = ValueNone let mutable currPriorityOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._OrderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.OrderAttribKey.KeyValue then currOrderOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ToolbarItemOrder) - if kvp.Key = View._PriorityAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PriorityAttribKey.KeyValue then currPriorityOpt <- ValueSome (kvp.Value :?> int) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._OrderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.OrderAttribKey.KeyValue then prevOrderOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ToolbarItemOrder) - if kvp.Key = View._PriorityAttribKey.KeyValue then + if kvp.Key = ViewAttributes.PriorityAttribKey.KeyValue then prevPriorityOpt <- ValueSome (kvp.Value :?> int) match prevOrderOpt, currOrderOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -10934,21 +10333,20 @@ type View() = | ValueSome _, ValueNone -> target.Priority <- 0 | ValueNone, ValueNone -> () - /// Describes a ToolbarItem in the view - static member inline ToolbarItem(?order: Xamarin.Forms.ToolbarItemOrder, - ?priority: int, - ?text: string, - ?command: unit -> unit, - ?commandParameter: System.Object, - ?icon: string, - ?accelerator: string, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ToolbarItem -> unit), - ?ref: ViewRef) = + static member ConstructToolbarItem(?order: Xamarin.Forms.ToolbarItemOrder, + ?priority: int, + ?text: string, + ?command: unit -> unit, + ?commandParameter: System.Object, + ?icon: string, + ?accelerator: string, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ToolbarItem -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildToolbarItem(0, + let attribBuilder = ViewBuilders.BuildToolbarItem(0, ?order=order, ?priority=priority, ?text=text, @@ -10962,13 +10360,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncToolbarItem, View.UpdateFuncToolbarItem, attribBuilder) - - [] - static member val ProtoToolbarItem : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncToolbarItem, ViewBuilders.UpdateFuncToolbarItem, attribBuilder) /// Builds the attributes for a ImageCell in the view - [] static member inline BuildImageCell(attribCount: int, ?imageSource: obj, ?text: string, @@ -10988,35 +10382,32 @@ type View() = let attribCount = match imageSource with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildTextCell(attribCount, ?text=text, ?detail=detail, ?textColor=textColor, ?detailColor=detailColor, ?command=command, ?canExecute=canExecute, ?commandParameter=commandParameter, ?height=height, ?isEnabled=isEnabled, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match imageSource with None -> () | Some v -> attribBuilder.Add(View._ImageSourceAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildTextCell(attribCount, ?text=text, ?detail=detail, ?textColor=textColor, ?detailColor=detailColor, ?command=command, ?canExecute=canExecute, ?commandParameter=commandParameter, ?height=height, ?isEnabled=isEnabled, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match imageSource with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ImageSourceAttribKey, (v)) attribBuilder - [] - static member val CreateFuncImageCell : (unit -> Xamarin.Forms.ImageCell) = (fun () -> View.CreateImageCell()) + static member val CreateFuncImageCell : (unit -> Xamarin.Forms.ImageCell) = (fun () -> ViewBuilders.CreateImageCell()) - [] - static member CreateImageCell () : Xamarin.Forms.ImageCell = + static member CreateImageCell () : Xamarin.Forms.ImageCell = upcast (new Xamarin.Forms.ImageCell()) - [] - static member val UpdateFuncImageCell = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ImageCell) -> View.UpdateImageCell (prevOpt, curr, target)) + static member val UpdateFuncImageCell = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ImageCell) -> ViewBuilders.UpdateImageCell (prevOpt, curr, target)) - [] static member UpdateImageCell (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ImageCell) = // update the inherited TextCell element - let baseElement = (if View.ProtoTextCell.IsNone then View.ProtoTextCell <- Some (View.TextCell())); View.ProtoTextCell.Value + let baseElement = (if ViewProto.ProtoTextCell.IsNone then ViewProto.ProtoTextCell <- Some (ViewBuilders.ConstructTextCell())); ViewProto.ProtoTextCell.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevImageSourceOpt = ValueNone let mutable currImageSourceOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ImageSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ImageSourceAttribKey.KeyValue then currImageSourceOpt <- ValueSome (kvp.Value :?> obj) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ImageSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ImageSourceAttribKey.KeyValue then prevImageSourceOpt <- ValueSome (kvp.Value :?> obj) match prevImageSourceOpt, currImageSourceOpt with | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () @@ -11024,24 +10415,23 @@ type View() = | ValueSome _, ValueNone -> target.ImageSource <- null | ValueNone, ValueNone -> () - /// Describes a ImageCell in the view - static member inline ImageCell(?imageSource: obj, - ?text: string, - ?detail: string, - ?textColor: Xamarin.Forms.Color, - ?detailColor: Xamarin.Forms.Color, - ?command: unit -> unit, - ?canExecute: bool, - ?commandParameter: System.Object, - ?height: double, - ?isEnabled: bool, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ImageCell -> unit), - ?ref: ViewRef) = + static member ConstructImageCell(?imageSource: obj, + ?text: string, + ?detail: string, + ?textColor: Xamarin.Forms.Color, + ?detailColor: Xamarin.Forms.Color, + ?command: unit -> unit, + ?canExecute: bool, + ?commandParameter: System.Object, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ImageCell -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildImageCell(0, + let attribBuilder = ViewBuilders.BuildImageCell(0, ?imageSource=imageSource, ?text=text, ?detail=detail, @@ -11058,13 +10448,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncImageCell, View.UpdateFuncImageCell, attribBuilder) - - [] - static member val ProtoImageCell : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncImageCell, ViewBuilders.UpdateFuncImageCell, attribBuilder) /// Builds the attributes for a ViewCell in the view - [] static member inline BuildViewCell(attribCount: int, ?view: ViewElement, ?height: double, @@ -11077,35 +10463,32 @@ type View() = let attribCount = match view with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildCell(attribCount, ?height=height, ?isEnabled=isEnabled, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match view with None -> () | Some v -> attribBuilder.Add(View._ViewAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildCell(attribCount, ?height=height, ?isEnabled=isEnabled, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match view with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ViewAttribKey, (v)) attribBuilder - [] - static member val CreateFuncViewCell : (unit -> Xamarin.Forms.ViewCell) = (fun () -> View.CreateViewCell()) + static member val CreateFuncViewCell : (unit -> Xamarin.Forms.ViewCell) = (fun () -> ViewBuilders.CreateViewCell()) - [] - static member CreateViewCell () : Xamarin.Forms.ViewCell = + static member CreateViewCell () : Xamarin.Forms.ViewCell = upcast (new Xamarin.Forms.ViewCell()) - [] - static member val UpdateFuncViewCell = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ViewCell) -> View.UpdateViewCell (prevOpt, curr, target)) + static member val UpdateFuncViewCell = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ViewCell) -> ViewBuilders.UpdateViewCell (prevOpt, curr, target)) - [] static member UpdateViewCell (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ViewCell) = // update the inherited Cell element - let baseElement = (if View.ProtoCell.IsNone then View.ProtoCell <- Some (View.Cell())); View.ProtoCell.Value + let baseElement = (if ViewProto.ProtoCell.IsNone then ViewProto.ProtoCell <- Some (ViewBuilders.ConstructCell())); ViewProto.ProtoCell.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevViewOpt = ValueNone let mutable currViewOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ViewAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ViewAttribKey.KeyValue then currViewOpt <- ValueSome (kvp.Value :?> ViewElement) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ViewAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ViewAttribKey.KeyValue then prevViewOpt <- ValueSome (kvp.Value :?> ViewElement) match prevViewOpt, currViewOpt with // For structured objects, dependsOn on reference equality @@ -11118,17 +10501,16 @@ type View() = target.View <- null | ValueNone, ValueNone -> () - /// Describes a ViewCell in the view - static member inline ViewCell(?view: ViewElement, - ?height: double, - ?isEnabled: bool, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ViewCell -> unit), - ?ref: ViewRef) = + static member ConstructViewCell(?view: ViewElement, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ViewCell -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildViewCell(0, + let attribBuilder = ViewBuilders.BuildViewCell(0, ?view=view, ?height=height, ?isEnabled=isEnabled, @@ -11138,13 +10520,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncViewCell, View.UpdateFuncViewCell, attribBuilder) - - [] - static member val ProtoViewCell : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncViewCell, ViewBuilders.UpdateFuncViewCell, attribBuilder) /// Builds the attributes for a ListView in the view - [] static member inline BuildListView(attribCount: int, ?items: seq, ?footer: System.Object, @@ -11221,42 +10599,39 @@ type View() = let attribCount = match refreshing with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match selectionMode with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match items with None -> () | Some v -> attribBuilder.Add(View._ListViewItemsAttribKey, (v)) - match footer with None -> () | Some v -> attribBuilder.Add(View._FooterAttribKey, (v)) - match hasUnevenRows with None -> () | Some v -> attribBuilder.Add(View._HasUnevenRowsAttribKey, (v)) - match header with None -> () | Some v -> attribBuilder.Add(View._HeaderAttribKey, (v)) - match headerTemplate with None -> () | Some v -> attribBuilder.Add(View._HeaderTemplateAttribKey, (v)) - match isGroupingEnabled with None -> () | Some v -> attribBuilder.Add(View._IsGroupingEnabledAttribKey, (v)) - match isPullToRefreshEnabled with None -> () | Some v -> attribBuilder.Add(View._IsPullToRefreshEnabledAttribKey, (v)) - match isRefreshing with None -> () | Some v -> attribBuilder.Add(View._IsRefreshingAttribKey, (v)) - match refreshCommand with None -> () | Some v -> attribBuilder.Add(View._RefreshCommandAttribKey, makeCommand(v)) - match rowHeight with None -> () | Some v -> attribBuilder.Add(View._RowHeightAttribKey, (v)) - match selectedItem with None -> () | Some v -> attribBuilder.Add(View._ListView_SelectedItemAttribKey, (v)) - match separatorVisibility with None -> () | Some v -> attribBuilder.Add(View._ListView_SeparatorVisibilityAttribKey, (v)) - match separatorColor with None -> () | Some v -> attribBuilder.Add(View._ListView_SeparatorColorAttribKey, (v)) - match itemAppearing with None -> () | Some v -> attribBuilder.Add(View._ListView_ItemAppearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.Item).Value))(v)) - match itemDisappearing with None -> () | Some v -> attribBuilder.Add(View._ListView_ItemDisappearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.Item).Value))(v)) - match itemSelected with None -> () | Some v -> attribBuilder.Add(View._ListView_ItemSelectedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.SelectedItem)))(v)) - match itemTapped with None -> () | Some v -> attribBuilder.Add(View._ListView_ItemTappedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.Item).Value))(v)) - match refreshing with None -> () | Some v -> attribBuilder.Add(View._ListView_RefreshingAttribKey, (fun f -> System.EventHandler(fun sender args -> f ()))(v)) - match selectionMode with None -> () | Some v -> attribBuilder.Add(View._SelectionModeAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match items with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListViewItemsAttribKey, (v)) + match footer with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FooterAttribKey, (v)) + match hasUnevenRows with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HasUnevenRowsAttribKey, (v)) + match header with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HeaderAttribKey, (v)) + match headerTemplate with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HeaderTemplateAttribKey, (v)) + match isGroupingEnabled with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsGroupingEnabledAttribKey, (v)) + match isPullToRefreshEnabled with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsPullToRefreshEnabledAttribKey, (v)) + match isRefreshing with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsRefreshingAttribKey, (v)) + match refreshCommand with None -> () | Some v -> attribBuilder.Add(ViewAttributes.RefreshCommandAttribKey, makeCommand(v)) + match rowHeight with None -> () | Some v -> attribBuilder.Add(ViewAttributes.RowHeightAttribKey, (v)) + match selectedItem with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListView_SelectedItemAttribKey, (v)) + match separatorVisibility with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListView_SeparatorVisibilityAttribKey, (v)) + match separatorColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListView_SeparatorColorAttribKey, (v)) + match itemAppearing with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListView_ItemAppearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.Item).Value))(v)) + match itemDisappearing with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListView_ItemDisappearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.Item).Value))(v)) + match itemSelected with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListView_ItemSelectedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.SelectedItem)))(v)) + match itemTapped with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListView_ItemTappedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.Item).Value))(v)) + match refreshing with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListView_RefreshingAttribKey, (fun f -> System.EventHandler(fun sender args -> f ()))(v)) + match selectionMode with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SelectionModeAttribKey, (v)) attribBuilder - [] - static member val CreateFuncListView : (unit -> Xamarin.Forms.ListView) = (fun () -> View.CreateListView()) + static member val CreateFuncListView : (unit -> Xamarin.Forms.ListView) = (fun () -> ViewBuilders.CreateListView()) - [] - static member CreateListView () : Xamarin.Forms.ListView = + static member CreateListView () : Xamarin.Forms.ListView = upcast (new Fabulous.DynamicViews.CustomListView()) - [] - static member val UpdateFuncListView = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ListView) -> View.UpdateListView (prevOpt, curr, target)) + static member val UpdateFuncListView = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ListView) -> ViewBuilders.UpdateListView (prevOpt, curr, target)) - [] static member UpdateListView (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ListView) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevListViewItemsOpt = ValueNone let mutable currListViewItemsOpt = ValueNone @@ -11297,85 +10672,85 @@ type View() = let mutable prevSelectionModeOpt = ValueNone let mutable currSelectionModeOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ListViewItemsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewItemsAttribKey.KeyValue then currListViewItemsOpt <- ValueSome (kvp.Value :?> seq) - if kvp.Key = View._FooterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FooterAttribKey.KeyValue then currFooterOpt <- ValueSome (kvp.Value :?> System.Object) - if kvp.Key = View._HasUnevenRowsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HasUnevenRowsAttribKey.KeyValue then currHasUnevenRowsOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._HeaderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HeaderAttribKey.KeyValue then currHeaderOpt <- ValueSome (kvp.Value :?> System.Object) - if kvp.Key = View._HeaderTemplateAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HeaderTemplateAttribKey.KeyValue then currHeaderTemplateOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.DataTemplate) - if kvp.Key = View._IsGroupingEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsGroupingEnabledAttribKey.KeyValue then currIsGroupingEnabledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._IsPullToRefreshEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsPullToRefreshEnabledAttribKey.KeyValue then currIsPullToRefreshEnabledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._IsRefreshingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsRefreshingAttribKey.KeyValue then currIsRefreshingOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._RefreshCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RefreshCommandAttribKey.KeyValue then currRefreshCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._RowHeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RowHeightAttribKey.KeyValue then currRowHeightOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._ListView_SelectedItemAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_SelectedItemAttribKey.KeyValue then currListView_SelectedItemOpt <- ValueSome (kvp.Value :?> int option) - if kvp.Key = View._ListView_SeparatorVisibilityAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_SeparatorVisibilityAttribKey.KeyValue then currListView_SeparatorVisibilityOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.SeparatorVisibility) - if kvp.Key = View._ListView_SeparatorColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_SeparatorColorAttribKey.KeyValue then currListView_SeparatorColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._ListView_ItemAppearingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_ItemAppearingAttribKey.KeyValue then currListView_ItemAppearingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListView_ItemDisappearingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_ItemDisappearingAttribKey.KeyValue then currListView_ItemDisappearingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListView_ItemSelectedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_ItemSelectedAttribKey.KeyValue then currListView_ItemSelectedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListView_ItemTappedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_ItemTappedAttribKey.KeyValue then currListView_ItemTappedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListView_RefreshingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_RefreshingAttribKey.KeyValue then currListView_RefreshingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._SelectionModeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SelectionModeAttribKey.KeyValue then currSelectionModeOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ListViewSelectionMode) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ListViewItemsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewItemsAttribKey.KeyValue then prevListViewItemsOpt <- ValueSome (kvp.Value :?> seq) - if kvp.Key = View._FooterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FooterAttribKey.KeyValue then prevFooterOpt <- ValueSome (kvp.Value :?> System.Object) - if kvp.Key = View._HasUnevenRowsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HasUnevenRowsAttribKey.KeyValue then prevHasUnevenRowsOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._HeaderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HeaderAttribKey.KeyValue then prevHeaderOpt <- ValueSome (kvp.Value :?> System.Object) - if kvp.Key = View._HeaderTemplateAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HeaderTemplateAttribKey.KeyValue then prevHeaderTemplateOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.DataTemplate) - if kvp.Key = View._IsGroupingEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsGroupingEnabledAttribKey.KeyValue then prevIsGroupingEnabledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._IsPullToRefreshEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsPullToRefreshEnabledAttribKey.KeyValue then prevIsPullToRefreshEnabledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._IsRefreshingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsRefreshingAttribKey.KeyValue then prevIsRefreshingOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._RefreshCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RefreshCommandAttribKey.KeyValue then prevRefreshCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._RowHeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RowHeightAttribKey.KeyValue then prevRowHeightOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._ListView_SelectedItemAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_SelectedItemAttribKey.KeyValue then prevListView_SelectedItemOpt <- ValueSome (kvp.Value :?> int option) - if kvp.Key = View._ListView_SeparatorVisibilityAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_SeparatorVisibilityAttribKey.KeyValue then prevListView_SeparatorVisibilityOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.SeparatorVisibility) - if kvp.Key = View._ListView_SeparatorColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_SeparatorColorAttribKey.KeyValue then prevListView_SeparatorColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._ListView_ItemAppearingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_ItemAppearingAttribKey.KeyValue then prevListView_ItemAppearingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListView_ItemDisappearingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_ItemDisappearingAttribKey.KeyValue then prevListView_ItemDisappearingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListView_ItemSelectedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_ItemSelectedAttribKey.KeyValue then prevListView_ItemSelectedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListView_ItemTappedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_ItemTappedAttribKey.KeyValue then prevListView_ItemTappedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListView_RefreshingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListView_RefreshingAttribKey.KeyValue then prevListView_RefreshingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._SelectionModeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SelectionModeAttribKey.KeyValue then prevSelectionModeOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ListViewSelectionMode) updateListViewItems prevListViewItemsOpt currListViewItemsOpt target match prevFooterOpt, currFooterOpt with @@ -11474,63 +10849,62 @@ type View() = | ValueSome _, ValueNone -> target.SelectionMode <- Xamarin.Forms.ListViewSelectionMode.Single | ValueNone, ValueNone -> () - /// Describes a ListView in the view - static member inline ListView(?items: seq, - ?footer: System.Object, - ?hasUnevenRows: bool, - ?header: System.Object, - ?headerTemplate: Xamarin.Forms.DataTemplate, - ?isGroupingEnabled: bool, - ?isPullToRefreshEnabled: bool, - ?isRefreshing: bool, - ?refreshCommand: unit -> unit, - ?rowHeight: int, - ?selectedItem: int option, - ?separatorVisibility: Xamarin.Forms.SeparatorVisibility, - ?separatorColor: Xamarin.Forms.Color, - ?itemAppearing: int -> unit, - ?itemDisappearing: int -> unit, - ?itemSelected: int option -> unit, - ?itemTapped: int -> unit, - ?refreshing: unit -> unit, - ?selectionMode: Xamarin.Forms.ListViewSelectionMode, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ListView -> unit), - ?ref: ViewRef) = + static member ConstructListView(?items: seq, + ?footer: System.Object, + ?hasUnevenRows: bool, + ?header: System.Object, + ?headerTemplate: Xamarin.Forms.DataTemplate, + ?isGroupingEnabled: bool, + ?isPullToRefreshEnabled: bool, + ?isRefreshing: bool, + ?refreshCommand: unit -> unit, + ?rowHeight: int, + ?selectedItem: int option, + ?separatorVisibility: Xamarin.Forms.SeparatorVisibility, + ?separatorColor: Xamarin.Forms.Color, + ?itemAppearing: int -> unit, + ?itemDisappearing: int -> unit, + ?itemSelected: int option -> unit, + ?itemTapped: int -> unit, + ?refreshing: unit -> unit, + ?selectionMode: Xamarin.Forms.ListViewSelectionMode, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ListView -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildListView(0, + let attribBuilder = ViewBuilders.BuildListView(0, ?items=items, ?footer=footer, ?hasUnevenRows=hasUnevenRows, @@ -11586,13 +10960,9 @@ type View() = ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncListView, View.UpdateFuncListView, attribBuilder) - - [] - static member val ProtoListView : ViewElement option = None with get, set + ViewElement.Create(ViewBuilders.CreateFuncListView, ViewBuilders.UpdateFuncListView, attribBuilder) /// Builds the attributes for a ListViewGrouped in the view - [] static member inline BuildListViewGrouped(attribCount: int, ?items: (string * ViewElement * ViewElement list) list, ?showJumpList: bool, @@ -11667,41 +11037,38 @@ type View() = let attribCount = match refreshing with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match selectionMode with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) - match items with None -> () | Some v -> attribBuilder.Add(View._ListViewGrouped_ItemsSourceAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun (g, e, l) -> (g, e, Array.ofList l)))(v)) - match showJumpList with None -> () | Some v -> attribBuilder.Add(View._ListViewGrouped_ShowJumpListAttribKey, (v)) - match footer with None -> () | Some v -> attribBuilder.Add(View._FooterAttribKey, (v)) - match hasUnevenRows with None -> () | Some v -> attribBuilder.Add(View._HasUnevenRowsAttribKey, (v)) - match header with None -> () | Some v -> attribBuilder.Add(View._HeaderAttribKey, (v)) - match isPullToRefreshEnabled with None -> () | Some v -> attribBuilder.Add(View._IsPullToRefreshEnabledAttribKey, (v)) - match isRefreshing with None -> () | Some v -> attribBuilder.Add(View._IsRefreshingAttribKey, (v)) - match refreshCommand with None -> () | Some v -> attribBuilder.Add(View._RefreshCommandAttribKey, makeCommand(v)) - match rowHeight with None -> () | Some v -> attribBuilder.Add(View._RowHeightAttribKey, (v)) - match selectedItem with None -> () | Some v -> attribBuilder.Add(View._ListViewGrouped_SelectedItemAttribKey, (v)) - match separatorVisibility with None -> () | Some v -> attribBuilder.Add(View._SeparatorVisibilityAttribKey, (v)) - match separatorColor with None -> () | Some v -> attribBuilder.Add(View._SeparatorColorAttribKey, (v)) - match itemAppearing with None -> () | Some v -> attribBuilder.Add(View._ListViewGrouped_ItemAppearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItemOrGroupItem sender args.Item).Value))(v)) - match itemDisappearing with None -> () | Some v -> attribBuilder.Add(View._ListViewGrouped_ItemDisappearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItemOrGroupItem sender args.Item).Value))(v)) - match itemSelected with None -> () | Some v -> attribBuilder.Add(View._ListViewGrouped_ItemSelectedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItem sender args.SelectedItem)))(v)) - match itemTapped with None -> () | Some v -> attribBuilder.Add(View._ListViewGrouped_ItemTappedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItem sender args.Item).Value))(v)) - match refreshing with None -> () | Some v -> attribBuilder.Add(View._RefreshingAttribKey, (fun f -> System.EventHandler(fun sender args -> f ()))(v)) - match selectionMode with None -> () | Some v -> attribBuilder.Add(View._SelectionModeAttribKey, (v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin, ?gestureRecognizers=gestureRecognizers, ?anchorX=anchorX, ?anchorY=anchorY, ?backgroundColor=backgroundColor, ?heightRequest=heightRequest, ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, ?minimumWidthRequest=minimumWidthRequest, ?opacity=opacity, ?rotation=rotation, ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, ?translationX=translationX, ?translationY=translationY, ?widthRequest=widthRequest, ?resources=resources, ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, ?scaleY=scaleY, ?tabIndex=tabIndex, ?classId=classId, ?styleId=styleId, ?automationId=automationId, ?created=created, ?ref=ref) + match items with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListViewGrouped_ItemsSourceAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun (g, e, l) -> (g, e, Array.ofList l)))(v)) + match showJumpList with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListViewGrouped_ShowJumpListAttribKey, (v)) + match footer with None -> () | Some v -> attribBuilder.Add(ViewAttributes.FooterAttribKey, (v)) + match hasUnevenRows with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HasUnevenRowsAttribKey, (v)) + match header with None -> () | Some v -> attribBuilder.Add(ViewAttributes.HeaderAttribKey, (v)) + match isPullToRefreshEnabled with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsPullToRefreshEnabledAttribKey, (v)) + match isRefreshing with None -> () | Some v -> attribBuilder.Add(ViewAttributes.IsRefreshingAttribKey, (v)) + match refreshCommand with None -> () | Some v -> attribBuilder.Add(ViewAttributes.RefreshCommandAttribKey, makeCommand(v)) + match rowHeight with None -> () | Some v -> attribBuilder.Add(ViewAttributes.RowHeightAttribKey, (v)) + match selectedItem with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListViewGrouped_SelectedItemAttribKey, (v)) + match separatorVisibility with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SeparatorVisibilityAttribKey, (v)) + match separatorColor with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SeparatorColorAttribKey, (v)) + match itemAppearing with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListViewGrouped_ItemAppearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItemOrGroupItem sender args.Item).Value))(v)) + match itemDisappearing with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListViewGrouped_ItemDisappearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItemOrGroupItem sender args.Item).Value))(v)) + match itemSelected with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListViewGrouped_ItemSelectedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItem sender args.SelectedItem)))(v)) + match itemTapped with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ListViewGrouped_ItemTappedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItem sender args.Item).Value))(v)) + match refreshing with None -> () | Some v -> attribBuilder.Add(ViewAttributes.RefreshingAttribKey, (fun f -> System.EventHandler(fun sender args -> f ()))(v)) + match selectionMode with None -> () | Some v -> attribBuilder.Add(ViewAttributes.SelectionModeAttribKey, (v)) attribBuilder - [] - static member val CreateFuncListViewGrouped : (unit -> Xamarin.Forms.ListView) = (fun () -> View.CreateListViewGrouped()) + static member val CreateFuncListViewGrouped : (unit -> Xamarin.Forms.ListView) = (fun () -> ViewBuilders.CreateListViewGrouped()) - [] - static member CreateListViewGrouped () : Xamarin.Forms.ListView = + static member CreateListViewGrouped () : Xamarin.Forms.ListView = upcast (new Fabulous.DynamicViews.CustomGroupListView()) - [] - static member val UpdateFuncListViewGrouped = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ListView) -> View.UpdateListViewGrouped (prevOpt, curr, target)) + static member val UpdateFuncListViewGrouped = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ListView) -> ViewBuilders.UpdateListViewGrouped (prevOpt, curr, target)) - [] static member UpdateListViewGrouped (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ListView) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevListViewGrouped_ItemsSourceOpt = ValueNone let mutable currListViewGrouped_ItemsSourceOpt = ValueNone @@ -11740,81 +11107,81 @@ type View() = let mutable prevSelectionModeOpt = ValueNone let mutable currSelectionModeOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ListViewGrouped_ItemsSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_ItemsSourceAttribKey.KeyValue then currListViewGrouped_ItemsSourceOpt <- ValueSome (kvp.Value :?> (string * ViewElement * ViewElement[])[]) - if kvp.Key = View._ListViewGrouped_ShowJumpListAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_ShowJumpListAttribKey.KeyValue then currListViewGrouped_ShowJumpListOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._FooterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FooterAttribKey.KeyValue then currFooterOpt <- ValueSome (kvp.Value :?> System.Object) - if kvp.Key = View._HasUnevenRowsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HasUnevenRowsAttribKey.KeyValue then currHasUnevenRowsOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._HeaderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HeaderAttribKey.KeyValue then currHeaderOpt <- ValueSome (kvp.Value :?> System.Object) - if kvp.Key = View._IsPullToRefreshEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsPullToRefreshEnabledAttribKey.KeyValue then currIsPullToRefreshEnabledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._IsRefreshingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsRefreshingAttribKey.KeyValue then currIsRefreshingOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._RefreshCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RefreshCommandAttribKey.KeyValue then currRefreshCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._RowHeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RowHeightAttribKey.KeyValue then currRowHeightOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._ListViewGrouped_SelectedItemAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_SelectedItemAttribKey.KeyValue then currListViewGrouped_SelectedItemOpt <- ValueSome (kvp.Value :?> (int * int) option) - if kvp.Key = View._SeparatorVisibilityAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SeparatorVisibilityAttribKey.KeyValue then currSeparatorVisibilityOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.SeparatorVisibility) - if kvp.Key = View._SeparatorColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SeparatorColorAttribKey.KeyValue then currSeparatorColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._ListViewGrouped_ItemAppearingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_ItemAppearingAttribKey.KeyValue then currListViewGrouped_ItemAppearingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListViewGrouped_ItemDisappearingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_ItemDisappearingAttribKey.KeyValue then currListViewGrouped_ItemDisappearingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListViewGrouped_ItemSelectedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_ItemSelectedAttribKey.KeyValue then currListViewGrouped_ItemSelectedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListViewGrouped_ItemTappedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_ItemTappedAttribKey.KeyValue then currListViewGrouped_ItemTappedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._RefreshingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RefreshingAttribKey.KeyValue then currRefreshingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._SelectionModeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SelectionModeAttribKey.KeyValue then currSelectionModeOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ListViewSelectionMode) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ListViewGrouped_ItemsSourceAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_ItemsSourceAttribKey.KeyValue then prevListViewGrouped_ItemsSourceOpt <- ValueSome (kvp.Value :?> (string * ViewElement * ViewElement[])[]) - if kvp.Key = View._ListViewGrouped_ShowJumpListAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_ShowJumpListAttribKey.KeyValue then prevListViewGrouped_ShowJumpListOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._FooterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.FooterAttribKey.KeyValue then prevFooterOpt <- ValueSome (kvp.Value :?> System.Object) - if kvp.Key = View._HasUnevenRowsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HasUnevenRowsAttribKey.KeyValue then prevHasUnevenRowsOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._HeaderAttribKey.KeyValue then + if kvp.Key = ViewAttributes.HeaderAttribKey.KeyValue then prevHeaderOpt <- ValueSome (kvp.Value :?> System.Object) - if kvp.Key = View._IsPullToRefreshEnabledAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsPullToRefreshEnabledAttribKey.KeyValue then prevIsPullToRefreshEnabledOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._IsRefreshingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.IsRefreshingAttribKey.KeyValue then prevIsRefreshingOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._RefreshCommandAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RefreshCommandAttribKey.KeyValue then prevRefreshCommandOpt <- ValueSome (kvp.Value :?> System.Windows.Input.ICommand) - if kvp.Key = View._RowHeightAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RowHeightAttribKey.KeyValue then prevRowHeightOpt <- ValueSome (kvp.Value :?> int) - if kvp.Key = View._ListViewGrouped_SelectedItemAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_SelectedItemAttribKey.KeyValue then prevListViewGrouped_SelectedItemOpt <- ValueSome (kvp.Value :?> (int * int) option) - if kvp.Key = View._SeparatorVisibilityAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SeparatorVisibilityAttribKey.KeyValue then prevSeparatorVisibilityOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.SeparatorVisibility) - if kvp.Key = View._SeparatorColorAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SeparatorColorAttribKey.KeyValue then prevSeparatorColorOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.Color) - if kvp.Key = View._ListViewGrouped_ItemAppearingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_ItemAppearingAttribKey.KeyValue then prevListViewGrouped_ItemAppearingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListViewGrouped_ItemDisappearingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_ItemDisappearingAttribKey.KeyValue then prevListViewGrouped_ItemDisappearingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListViewGrouped_ItemSelectedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_ItemSelectedAttribKey.KeyValue then prevListViewGrouped_ItemSelectedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListViewGrouped_ItemTappedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewGrouped_ItemTappedAttribKey.KeyValue then prevListViewGrouped_ItemTappedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._RefreshingAttribKey.KeyValue then + if kvp.Key = ViewAttributes.RefreshingAttribKey.KeyValue then prevRefreshingOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._SelectionModeAttribKey.KeyValue then + if kvp.Key = ViewAttributes.SelectionModeAttribKey.KeyValue then prevSelectionModeOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.ListViewSelectionMode) updateListViewGroupedItems prevListViewGrouped_ItemsSourceOpt currListViewGrouped_ItemsSourceOpt target updateListViewGroupedShowJumpList prevListViewGrouped_ShowJumpListOpt currListViewGrouped_ShowJumpListOpt target @@ -11904,6 +11271,4617 @@ type View() = | ValueSome _, ValueNone -> target.SelectionMode <- Xamarin.Forms.ListViewSelectionMode.Single | ValueNone, ValueNone -> () + static member ConstructListViewGrouped(?items: (string * ViewElement * ViewElement list) list, + ?showJumpList: bool, + ?footer: System.Object, + ?hasUnevenRows: bool, + ?header: System.Object, + ?isPullToRefreshEnabled: bool, + ?isRefreshing: bool, + ?refreshCommand: unit -> unit, + ?rowHeight: int, + ?selectedItem: (int * int) option, + ?separatorVisibility: Xamarin.Forms.SeparatorVisibility, + ?separatorColor: Xamarin.Forms.Color, + ?itemAppearing: int * int option -> unit, + ?itemDisappearing: int * int option -> unit, + ?itemSelected: (int * int) option -> unit, + ?itemTapped: int * int -> unit, + ?refreshing: unit -> unit, + ?selectionMode: Xamarin.Forms.ListViewSelectionMode, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ListView -> unit), + ?ref: ViewRef) = + + let attribBuilder = ViewBuilders.BuildListViewGrouped(0, + ?items=items, + ?showJumpList=showJumpList, + ?footer=footer, + ?hasUnevenRows=hasUnevenRows, + ?header=header, + ?isPullToRefreshEnabled=isPullToRefreshEnabled, + ?isRefreshing=isRefreshing, + ?refreshCommand=refreshCommand, + ?rowHeight=rowHeight, + ?selectedItem=selectedItem, + ?separatorVisibility=separatorVisibility, + ?separatorColor=separatorColor, + ?itemAppearing=itemAppearing, + ?itemDisappearing=itemDisappearing, + ?itemSelected=itemSelected, + ?itemTapped=itemTapped, + ?refreshing=refreshing, + ?selectionMode=selectionMode, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), + ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) + + ViewElement.Create(ViewBuilders.CreateFuncListViewGrouped, ViewBuilders.UpdateFuncListViewGrouped, attribBuilder) + +/// Viewer that allows to read the properties of a ViewElement representing a Element +type ElementViewer(element: ViewElement) = + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Element' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the ClassId property + member this.ClassId = element.GetAttributeKeyed(ViewAttributes.ClassIdAttribKey) + /// Get the value of the StyleId property + member this.StyleId = element.GetAttributeKeyed(ViewAttributes.StyleIdAttribKey) + /// Get the value of the AutomationId property + member this.AutomationId = element.GetAttributeKeyed(ViewAttributes.AutomationIdAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a VisualElement +type VisualElementViewer(element: ViewElement) = + inherit ElementViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.VisualElement' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the AnchorX property + member this.AnchorX = element.GetAttributeKeyed(ViewAttributes.AnchorXAttribKey) + /// Get the value of the AnchorY property + member this.AnchorY = element.GetAttributeKeyed(ViewAttributes.AnchorYAttribKey) + /// Get the value of the BackgroundColor property + member this.BackgroundColor = element.GetAttributeKeyed(ViewAttributes.BackgroundColorAttribKey) + /// Get the value of the HeightRequest property + member this.HeightRequest = element.GetAttributeKeyed(ViewAttributes.HeightRequestAttribKey) + /// Get the value of the InputTransparent property + member this.InputTransparent = element.GetAttributeKeyed(ViewAttributes.InputTransparentAttribKey) + /// Get the value of the IsEnabled property + member this.IsEnabled = element.GetAttributeKeyed(ViewAttributes.IsEnabledAttribKey) + /// Get the value of the IsVisible property + member this.IsVisible = element.GetAttributeKeyed(ViewAttributes.IsVisibleAttribKey) + /// Get the value of the MinimumHeightRequest property + member this.MinimumHeightRequest = element.GetAttributeKeyed(ViewAttributes.MinimumHeightRequestAttribKey) + /// Get the value of the MinimumWidthRequest property + member this.MinimumWidthRequest = element.GetAttributeKeyed(ViewAttributes.MinimumWidthRequestAttribKey) + /// Get the value of the Opacity property + member this.Opacity = element.GetAttributeKeyed(ViewAttributes.OpacityAttribKey) + /// Get the value of the Rotation property + member this.Rotation = element.GetAttributeKeyed(ViewAttributes.RotationAttribKey) + /// Get the value of the RotationX property + member this.RotationX = element.GetAttributeKeyed(ViewAttributes.RotationXAttribKey) + /// Get the value of the RotationY property + member this.RotationY = element.GetAttributeKeyed(ViewAttributes.RotationYAttribKey) + /// Get the value of the Scale property + member this.Scale = element.GetAttributeKeyed(ViewAttributes.ScaleAttribKey) + /// Get the value of the Style property + member this.Style = element.GetAttributeKeyed(ViewAttributes.StyleAttribKey) + /// Get the value of the StyleClass property + member this.StyleClass = element.GetAttributeKeyed(ViewAttributes.StyleClassAttribKey) + /// Get the value of the TranslationX property + member this.TranslationX = element.GetAttributeKeyed(ViewAttributes.TranslationXAttribKey) + /// Get the value of the TranslationY property + member this.TranslationY = element.GetAttributeKeyed(ViewAttributes.TranslationYAttribKey) + /// Get the value of the WidthRequest property + member this.WidthRequest = element.GetAttributeKeyed(ViewAttributes.WidthRequestAttribKey) + /// Get the value of the Resources property + member this.Resources = element.GetAttributeKeyed(ViewAttributes.ResourcesAttribKey) + /// Get the value of the Styles property + member this.Styles = element.GetAttributeKeyed(ViewAttributes.StylesAttribKey) + /// Get the value of the StyleSheets property + member this.StyleSheets = element.GetAttributeKeyed(ViewAttributes.StyleSheetsAttribKey) + /// Get the value of the IsTabStop property + member this.IsTabStop = element.GetAttributeKeyed(ViewAttributes.IsTabStopAttribKey) + /// Get the value of the ScaleX property + member this.ScaleX = element.GetAttributeKeyed(ViewAttributes.ScaleXAttribKey) + /// Get the value of the ScaleY property + member this.ScaleY = element.GetAttributeKeyed(ViewAttributes.ScaleYAttribKey) + /// Get the value of the TabIndex property + member this.TabIndex = element.GetAttributeKeyed(ViewAttributes.TabIndexAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a View +type ViewViewer(element: ViewElement) = + inherit VisualElementViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.View' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the HorizontalOptions property + member this.HorizontalOptions = element.GetAttributeKeyed(ViewAttributes.HorizontalOptionsAttribKey) + /// Get the value of the VerticalOptions property + member this.VerticalOptions = element.GetAttributeKeyed(ViewAttributes.VerticalOptionsAttribKey) + /// Get the value of the Margin property + member this.Margin = element.GetAttributeKeyed(ViewAttributes.MarginAttribKey) + /// Get the value of the GestureRecognizers property + member this.GestureRecognizers = element.GetAttributeKeyed(ViewAttributes.GestureRecognizersAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a IGestureRecognizer +type IGestureRecognizerViewer(element: ViewElement) = + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.IGestureRecognizer' is expected, but '%s' was provided." element.TargetType.FullName + +/// Viewer that allows to read the properties of a ViewElement representing a PanGestureRecognizer +type PanGestureRecognizerViewer(element: ViewElement) = + inherit ElementViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.PanGestureRecognizer' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the TouchPoints property + member this.TouchPoints = element.GetAttributeKeyed(ViewAttributes.TouchPointsAttribKey) + /// Get the value of the PanUpdated property + member this.PanUpdated = element.GetAttributeKeyed(ViewAttributes.PanUpdatedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a TapGestureRecognizer +type TapGestureRecognizerViewer(element: ViewElement) = + inherit ElementViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.TapGestureRecognizer' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Command property + member this.Command = element.GetAttributeKeyed(ViewAttributes.CommandAttribKey) + /// Get the value of the NumberOfTapsRequired property + member this.NumberOfTapsRequired = element.GetAttributeKeyed(ViewAttributes.NumberOfTapsRequiredAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a ClickGestureRecognizer +type ClickGestureRecognizerViewer(element: ViewElement) = + inherit ElementViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.ClickGestureRecognizer' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Command property + member this.Command = element.GetAttributeKeyed(ViewAttributes.CommandAttribKey) + /// Get the value of the NumberOfClicksRequired property + member this.NumberOfClicksRequired = element.GetAttributeKeyed(ViewAttributes.NumberOfClicksRequiredAttribKey) + /// Get the value of the Buttons property + member this.Buttons = element.GetAttributeKeyed(ViewAttributes.ButtonsAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a PinchGestureRecognizer +type PinchGestureRecognizerViewer(element: ViewElement) = + inherit ElementViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.PinchGestureRecognizer' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the IsPinching property + member this.IsPinching = element.GetAttributeKeyed(ViewAttributes.IsPinchingAttribKey) + /// Get the value of the PinchUpdated property + member this.PinchUpdated = element.GetAttributeKeyed(ViewAttributes.PinchUpdatedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a SwipeGestureRecognizer +type SwipeGestureRecognizerViewer(element: ViewElement) = + inherit ElementViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.SwipeGestureRecognizer' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Command property + member this.Command = element.GetAttributeKeyed(ViewAttributes.CommandAttribKey) + /// Get the value of the Direction property + member this.Direction = element.GetAttributeKeyed(ViewAttributes.SwipeGestureRecognizerDirectionAttribKey) + /// Get the value of the Threshold property + member this.Threshold = element.GetAttributeKeyed(ViewAttributes.ThresholdAttribKey) + /// Get the value of the Swiped property + member this.Swiped = element.GetAttributeKeyed(ViewAttributes.SwipedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a ActivityIndicator +type ActivityIndicatorViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.ActivityIndicator' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Color property + member this.Color = element.GetAttributeKeyed(ViewAttributes.ColorAttribKey) + /// Get the value of the IsRunning property + member this.IsRunning = element.GetAttributeKeyed(ViewAttributes.IsRunningAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a BoxView +type BoxViewViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.BoxView' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Color property + member this.Color = element.GetAttributeKeyed(ViewAttributes.ColorAttribKey) + /// Get the value of the CornerRadius property + member this.CornerRadius = element.GetAttributeKeyed(ViewAttributes.BoxViewCornerRadiusAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a ProgressBar +type ProgressBarViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.ProgressBar' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Progress property + member this.Progress = element.GetAttributeKeyed(ViewAttributes.ProgressAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Layout +type LayoutViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Layout' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the IsClippedToBounds property + member this.IsClippedToBounds = element.GetAttributeKeyed(ViewAttributes.IsClippedToBoundsAttribKey) + /// Get the value of the Padding property + member this.Padding = element.GetAttributeKeyed(ViewAttributes.PaddingAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a ScrollView +type ScrollViewViewer(element: ViewElement) = + inherit LayoutViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.ScrollView' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Content property + member this.Content = element.GetAttributeKeyed(ViewAttributes.ContentAttribKey) + /// Get the value of the Orientation property + member this.Orientation = element.GetAttributeKeyed(ViewAttributes.ScrollOrientationAttribKey) + /// Get the value of the HorizontalScrollBarVisibility property + member this.HorizontalScrollBarVisibility = element.GetAttributeKeyed(ViewAttributes.HorizontalScrollBarVisibilityAttribKey) + /// Get the value of the VerticalScrollBarVisibility property + member this.VerticalScrollBarVisibility = element.GetAttributeKeyed(ViewAttributes.VerticalScrollBarVisibilityAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a SearchBar +type SearchBarViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.SearchBar' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the CancelButtonColor property + member this.CancelButtonColor = element.GetAttributeKeyed(ViewAttributes.CancelButtonColorAttribKey) + /// Get the value of the FontFamily property + member this.FontFamily = element.GetAttributeKeyed(ViewAttributes.FontFamilyAttribKey) + /// Get the value of the FontAttributes property + member this.FontAttributes = element.GetAttributeKeyed(ViewAttributes.FontAttributesAttribKey) + /// Get the value of the FontSize property + member this.FontSize = element.GetAttributeKeyed(ViewAttributes.FontSizeAttribKey) + /// Get the value of the HorizontalTextAlignment property + member this.HorizontalTextAlignment = element.GetAttributeKeyed(ViewAttributes.HorizontalTextAlignmentAttribKey) + /// Get the value of the Placeholder property + member this.Placeholder = element.GetAttributeKeyed(ViewAttributes.PlaceholderAttribKey) + /// Get the value of the PlaceholderColor property + member this.PlaceholderColor = element.GetAttributeKeyed(ViewAttributes.PlaceholderColorAttribKey) + /// Get the value of the SearchCommand property + member this.SearchCommand = element.GetAttributeKeyed(ViewAttributes.SearchBarCommandAttribKey) + /// Get the value of the CanExecute property + member this.CanExecute = element.GetAttributeKeyed(ViewAttributes.SearchBarCanExecuteAttribKey) + /// Get the value of the Text property + member this.Text = element.GetAttributeKeyed(ViewAttributes.TextAttribKey) + /// Get the value of the TextColor property + member this.TextColor = element.GetAttributeKeyed(ViewAttributes.TextColorAttribKey) + /// Get the value of the TextChanged property + member this.TextChanged = element.GetAttributeKeyed(ViewAttributes.SearchBarTextChangedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Button +type ButtonViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Button' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Text property + member this.Text = element.GetAttributeKeyed(ViewAttributes.TextAttribKey) + /// Get the value of the Command property + member this.Command = element.GetAttributeKeyed(ViewAttributes.ButtonCommandAttribKey) + /// Get the value of the CanExecute property + member this.CanExecute = element.GetAttributeKeyed(ViewAttributes.ButtonCanExecuteAttribKey) + /// Get the value of the BorderColor property + member this.BorderColor = element.GetAttributeKeyed(ViewAttributes.BorderColorAttribKey) + /// Get the value of the BorderWidth property + member this.BorderWidth = element.GetAttributeKeyed(ViewAttributes.BorderWidthAttribKey) + /// Get the value of the CommandParameter property + member this.CommandParameter = element.GetAttributeKeyed(ViewAttributes.CommandParameterAttribKey) + /// Get the value of the ContentLayout property + member this.ContentLayout = element.GetAttributeKeyed(ViewAttributes.ContentLayoutAttribKey) + /// Get the value of the CornerRadius property + member this.CornerRadius = element.GetAttributeKeyed(ViewAttributes.ButtonCornerRadiusAttribKey) + /// Get the value of the FontFamily property + member this.FontFamily = element.GetAttributeKeyed(ViewAttributes.FontFamilyAttribKey) + /// Get the value of the FontAttributes property + member this.FontAttributes = element.GetAttributeKeyed(ViewAttributes.FontAttributesAttribKey) + /// Get the value of the FontSize property + member this.FontSize = element.GetAttributeKeyed(ViewAttributes.FontSizeAttribKey) + /// Get the value of the Image property + member this.Image = element.GetAttributeKeyed(ViewAttributes.ButtonImageSourceAttribKey) + /// Get the value of the TextColor property + member this.TextColor = element.GetAttributeKeyed(ViewAttributes.TextColorAttribKey) + /// Get the value of the Padding property + member this.Padding = element.GetAttributeKeyed(ViewAttributes.PaddingAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Slider +type SliderViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Slider' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the MinimumMaximum property + member this.MinimumMaximum = element.GetAttributeKeyed(ViewAttributes.MinimumMaximumAttribKey) + /// Get the value of the Value property + member this.Value = element.GetAttributeKeyed(ViewAttributes.ValueAttribKey) + /// Get the value of the ValueChanged property + member this.ValueChanged = element.GetAttributeKeyed(ViewAttributes.ValueChangedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Stepper +type StepperViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Stepper' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the MinimumMaximum property + member this.MinimumMaximum = element.GetAttributeKeyed(ViewAttributes.MinimumMaximumAttribKey) + /// Get the value of the Value property + member this.Value = element.GetAttributeKeyed(ViewAttributes.ValueAttribKey) + /// Get the value of the Increment property + member this.Increment = element.GetAttributeKeyed(ViewAttributes.IncrementAttribKey) + /// Get the value of the ValueChanged property + member this.ValueChanged = element.GetAttributeKeyed(ViewAttributes.ValueChangedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Switch +type SwitchViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Switch' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the IsToggled property + member this.IsToggled = element.GetAttributeKeyed(ViewAttributes.IsToggledAttribKey) + /// Get the value of the Toggled property + member this.Toggled = element.GetAttributeKeyed(ViewAttributes.ToggledAttribKey) + /// Get the value of the OnColor property + member this.OnColor = element.GetAttributeKeyed(ViewAttributes.OnColorAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Cell +type CellViewer(element: ViewElement) = + inherit ElementViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Cell' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Height property + member this.Height = element.GetAttributeKeyed(ViewAttributes.HeightAttribKey) + /// Get the value of the IsEnabled property + member this.IsEnabled = element.GetAttributeKeyed(ViewAttributes.IsEnabledAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a SwitchCell +type SwitchCellViewer(element: ViewElement) = + inherit CellViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.SwitchCell' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the On property + member this.On = element.GetAttributeKeyed(ViewAttributes.OnAttribKey) + /// Get the value of the Text property + member this.Text = element.GetAttributeKeyed(ViewAttributes.TextAttribKey) + /// Get the value of the OnChanged property + member this.OnChanged = element.GetAttributeKeyed(ViewAttributes.OnChangedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a TableView +type TableViewViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.TableView' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Intent property + member this.Intent = element.GetAttributeKeyed(ViewAttributes.IntentAttribKey) + /// Get the value of the HasUnevenRows property + member this.HasUnevenRows = element.GetAttributeKeyed(ViewAttributes.HasUnevenRowsAttribKey) + /// Get the value of the RowHeight property + member this.RowHeight = element.GetAttributeKeyed(ViewAttributes.RowHeightAttribKey) + /// Get the value of the Root property + member this.Root = element.GetAttributeKeyed(ViewAttributes.TableRootAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a RowDefinition +type RowDefinitionViewer(element: ViewElement) = + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.RowDefinition' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Height property + member this.Height = element.GetAttributeKeyed(ViewAttributes.RowDefinitionHeightAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a ColumnDefinition +type ColumnDefinitionViewer(element: ViewElement) = + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.ColumnDefinition' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Width property + member this.Width = element.GetAttributeKeyed(ViewAttributes.ColumnDefinitionWidthAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Grid +type GridViewer(element: ViewElement) = + inherit LayoutViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Grid' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the RowDefinitions property + member this.RowDefinitions = element.GetAttributeKeyed(ViewAttributes.GridRowDefinitionsAttribKey) + /// Get the value of the ColumnDefinitions property + member this.ColumnDefinitions = element.GetAttributeKeyed(ViewAttributes.GridColumnDefinitionsAttribKey) + /// Get the value of the RowSpacing property + member this.RowSpacing = element.GetAttributeKeyed(ViewAttributes.RowSpacingAttribKey) + /// Get the value of the ColumnSpacing property + member this.ColumnSpacing = element.GetAttributeKeyed(ViewAttributes.ColumnSpacingAttribKey) + /// Get the value of the Children property + member this.Children = element.GetAttributeKeyed(ViewAttributes.ChildrenAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a AbsoluteLayout +type AbsoluteLayoutViewer(element: ViewElement) = + inherit LayoutViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.AbsoluteLayout' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Children property + member this.Children = element.GetAttributeKeyed(ViewAttributes.ChildrenAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a RelativeLayout +type RelativeLayoutViewer(element: ViewElement) = + inherit LayoutViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.RelativeLayout' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Children property + member this.Children = element.GetAttributeKeyed(ViewAttributes.ChildrenAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a FlexLayout +type FlexLayoutViewer(element: ViewElement) = + inherit LayoutViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.FlexLayout' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the AlignContent property + member this.AlignContent = element.GetAttributeKeyed(ViewAttributes.AlignContentAttribKey) + /// Get the value of the AlignItems property + member this.AlignItems = element.GetAttributeKeyed(ViewAttributes.AlignItemsAttribKey) + /// Get the value of the Direction property + member this.Direction = element.GetAttributeKeyed(ViewAttributes.FlexLayoutDirectionAttribKey) + /// Get the value of the Position property + member this.Position = element.GetAttributeKeyed(ViewAttributes.PositionAttribKey) + /// Get the value of the Wrap property + member this.Wrap = element.GetAttributeKeyed(ViewAttributes.WrapAttribKey) + /// Get the value of the JustifyContent property + member this.JustifyContent = element.GetAttributeKeyed(ViewAttributes.JustifyContentAttribKey) + /// Get the value of the Children property + member this.Children = element.GetAttributeKeyed(ViewAttributes.ChildrenAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a TemplatedView +type TemplatedViewViewer(element: ViewElement) = + inherit LayoutViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.TemplatedView' is expected, but '%s' was provided." element.TargetType.FullName + +/// Viewer that allows to read the properties of a ViewElement representing a ContentView +type ContentViewViewer(element: ViewElement) = + inherit TemplatedViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.ContentView' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Content property + member this.Content = element.GetAttributeKeyed(ViewAttributes.ContentAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a DatePicker +type DatePickerViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.DatePicker' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Date property + member this.Date = element.GetAttributeKeyed(ViewAttributes.DateAttribKey) + /// Get the value of the Format property + member this.Format = element.GetAttributeKeyed(ViewAttributes.FormatAttribKey) + /// Get the value of the MinimumDate property + member this.MinimumDate = element.GetAttributeKeyed(ViewAttributes.MinimumDateAttribKey) + /// Get the value of the MaximumDate property + member this.MaximumDate = element.GetAttributeKeyed(ViewAttributes.MaximumDateAttribKey) + /// Get the value of the DateSelected property + member this.DateSelected = element.GetAttributeKeyed(ViewAttributes.DateSelectedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Picker +type PickerViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Picker' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the ItemsSource property + member this.ItemsSource = element.GetAttributeKeyed(ViewAttributes.PickerItemsSourceAttribKey) + /// Get the value of the SelectedIndex property + member this.SelectedIndex = element.GetAttributeKeyed(ViewAttributes.SelectedIndexAttribKey) + /// Get the value of the Title property + member this.Title = element.GetAttributeKeyed(ViewAttributes.TitleAttribKey) + /// Get the value of the TextColor property + member this.TextColor = element.GetAttributeKeyed(ViewAttributes.TextColorAttribKey) + /// Get the value of the SelectedIndexChanged property + member this.SelectedIndexChanged = element.GetAttributeKeyed(ViewAttributes.SelectedIndexChangedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Frame +type FrameViewer(element: ViewElement) = + inherit ContentViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Frame' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the BorderColor property + member this.BorderColor = element.GetAttributeKeyed(ViewAttributes.BorderColorAttribKey) + /// Get the value of the CornerRadius property + member this.CornerRadius = element.GetAttributeKeyed(ViewAttributes.FrameCornerRadiusAttribKey) + /// Get the value of the HasShadow property + member this.HasShadow = element.GetAttributeKeyed(ViewAttributes.HasShadowAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Image +type ImageViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Image' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Source property + member this.Source = element.GetAttributeKeyed(ViewAttributes.ImageSourceAttribKey) + /// Get the value of the Aspect property + member this.Aspect = element.GetAttributeKeyed(ViewAttributes.AspectAttribKey) + /// Get the value of the IsOpaque property + member this.IsOpaque = element.GetAttributeKeyed(ViewAttributes.IsOpaqueAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a ImageButton +type ImageButtonViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.ImageButton' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Command property + member this.Command = element.GetAttributeKeyed(ViewAttributes.ImageButtonCommandAttribKey) + /// Get the value of the Source property + member this.Source = element.GetAttributeKeyed(ViewAttributes.ImageSourceAttribKey) + /// Get the value of the Aspect property + member this.Aspect = element.GetAttributeKeyed(ViewAttributes.AspectAttribKey) + /// Get the value of the BorderColor property + member this.BorderColor = element.GetAttributeKeyed(ViewAttributes.BorderColorAttribKey) + /// Get the value of the BorderWidth property + member this.BorderWidth = element.GetAttributeKeyed(ViewAttributes.BorderWidthAttribKey) + /// Get the value of the CornerRadius property + member this.CornerRadius = element.GetAttributeKeyed(ViewAttributes.ImageButtonCornerRadiusAttribKey) + /// Get the value of the IsOpaque property + member this.IsOpaque = element.GetAttributeKeyed(ViewAttributes.IsOpaqueAttribKey) + /// Get the value of the Padding property + member this.Padding = element.GetAttributeKeyed(ViewAttributes.PaddingAttribKey) + /// Get the value of the Clicked property + member this.Clicked = element.GetAttributeKeyed(ViewAttributes.ClickedAttribKey) + /// Get the value of the Pressed property + member this.Pressed = element.GetAttributeKeyed(ViewAttributes.PressedAttribKey) + /// Get the value of the Released property + member this.Released = element.GetAttributeKeyed(ViewAttributes.ReleasedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a InputView +type InputViewViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.InputView' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Keyboard property + member this.Keyboard = element.GetAttributeKeyed(ViewAttributes.KeyboardAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Editor +type EditorViewer(element: ViewElement) = + inherit InputViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Editor' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Text property + member this.Text = element.GetAttributeKeyed(ViewAttributes.TextAttribKey) + /// Get the value of the FontSize property + member this.FontSize = element.GetAttributeKeyed(ViewAttributes.FontSizeAttribKey) + /// Get the value of the FontFamily property + member this.FontFamily = element.GetAttributeKeyed(ViewAttributes.FontFamilyAttribKey) + /// Get the value of the FontAttributes property + member this.FontAttributes = element.GetAttributeKeyed(ViewAttributes.FontAttributesAttribKey) + /// Get the value of the TextColor property + member this.TextColor = element.GetAttributeKeyed(ViewAttributes.TextColorAttribKey) + /// Get the value of the Completed property + member this.Completed = element.GetAttributeKeyed(ViewAttributes.EditorCompletedAttribKey) + /// Get the value of the TextChanged property + member this.TextChanged = element.GetAttributeKeyed(ViewAttributes.TextChangedAttribKey) + /// Get the value of the AutoSize property + member this.AutoSize = element.GetAttributeKeyed(ViewAttributes.AutoSizeAttribKey) + /// Get the value of the Placeholder property + member this.Placeholder = element.GetAttributeKeyed(ViewAttributes.PlaceholderAttribKey) + /// Get the value of the PlaceholderColor property + member this.PlaceholderColor = element.GetAttributeKeyed(ViewAttributes.PlaceholderColorAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Entry +type EntryViewer(element: ViewElement) = + inherit InputViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Entry' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Text property + member this.Text = element.GetAttributeKeyed(ViewAttributes.TextAttribKey) + /// Get the value of the Placeholder property + member this.Placeholder = element.GetAttributeKeyed(ViewAttributes.PlaceholderAttribKey) + /// Get the value of the HorizontalTextAlignment property + member this.HorizontalTextAlignment = element.GetAttributeKeyed(ViewAttributes.HorizontalTextAlignmentAttribKey) + /// Get the value of the FontSize property + member this.FontSize = element.GetAttributeKeyed(ViewAttributes.FontSizeAttribKey) + /// Get the value of the FontFamily property + member this.FontFamily = element.GetAttributeKeyed(ViewAttributes.FontFamilyAttribKey) + /// Get the value of the FontAttributes property + member this.FontAttributes = element.GetAttributeKeyed(ViewAttributes.FontAttributesAttribKey) + /// Get the value of the TextColor property + member this.TextColor = element.GetAttributeKeyed(ViewAttributes.TextColorAttribKey) + /// Get the value of the PlaceholderColor property + member this.PlaceholderColor = element.GetAttributeKeyed(ViewAttributes.PlaceholderColorAttribKey) + /// Get the value of the IsPassword property + member this.IsPassword = element.GetAttributeKeyed(ViewAttributes.IsPasswordAttribKey) + /// Get the value of the Completed property + member this.Completed = element.GetAttributeKeyed(ViewAttributes.EntryCompletedAttribKey) + /// Get the value of the TextChanged property + member this.TextChanged = element.GetAttributeKeyed(ViewAttributes.TextChangedAttribKey) + /// Get the value of the IsTextPredictionEnabled property + member this.IsTextPredictionEnabled = element.GetAttributeKeyed(ViewAttributes.IsTextPredictionEnabledAttribKey) + /// Get the value of the ReturnType property + member this.ReturnType = element.GetAttributeKeyed(ViewAttributes.ReturnTypeAttribKey) + /// Get the value of the ReturnCommand property + member this.ReturnCommand = element.GetAttributeKeyed(ViewAttributes.ReturnCommandAttribKey) + /// Get the value of the CursorPosition property + member this.CursorPosition = element.GetAttributeKeyed(ViewAttributes.CursorPositionAttribKey) + /// Get the value of the SelectionLength property + member this.SelectionLength = element.GetAttributeKeyed(ViewAttributes.SelectionLengthAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a EntryCell +type EntryCellViewer(element: ViewElement) = + inherit CellViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Fabulous.CustomControls.CustomEntryCell' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Label property + member this.Label = element.GetAttributeKeyed(ViewAttributes.LabelAttribKey) + /// Get the value of the Text property + member this.Text = element.GetAttributeKeyed(ViewAttributes.TextAttribKey) + /// Get the value of the Keyboard property + member this.Keyboard = element.GetAttributeKeyed(ViewAttributes.KeyboardAttribKey) + /// Get the value of the Placeholder property + member this.Placeholder = element.GetAttributeKeyed(ViewAttributes.PlaceholderAttribKey) + /// Get the value of the HorizontalTextAlignment property + member this.HorizontalTextAlignment = element.GetAttributeKeyed(ViewAttributes.HorizontalTextAlignmentAttribKey) + /// Get the value of the Completed property + member this.Completed = element.GetAttributeKeyed(ViewAttributes.EntryCompletedAttribKey) + /// Get the value of the TextChanged property + member this.TextChanged = element.GetAttributeKeyed(ViewAttributes.EntryCellTextChangedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Label +type LabelViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Label' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Text property + member this.Text = element.GetAttributeKeyed(ViewAttributes.TextAttribKey) + /// Get the value of the HorizontalTextAlignment property + member this.HorizontalTextAlignment = element.GetAttributeKeyed(ViewAttributes.HorizontalTextAlignmentAttribKey) + /// Get the value of the VerticalTextAlignment property + member this.VerticalTextAlignment = element.GetAttributeKeyed(ViewAttributes.VerticalTextAlignmentAttribKey) + /// Get the value of the FontSize property + member this.FontSize = element.GetAttributeKeyed(ViewAttributes.FontSizeAttribKey) + /// Get the value of the FontFamily property + member this.FontFamily = element.GetAttributeKeyed(ViewAttributes.FontFamilyAttribKey) + /// Get the value of the FontAttributes property + member this.FontAttributes = element.GetAttributeKeyed(ViewAttributes.FontAttributesAttribKey) + /// Get the value of the TextColor property + member this.TextColor = element.GetAttributeKeyed(ViewAttributes.TextColorAttribKey) + /// Get the value of the FormattedText property + member this.FormattedText = element.GetAttributeKeyed(ViewAttributes.FormattedTextAttribKey) + /// Get the value of the LineBreakMode property + member this.LineBreakMode = element.GetAttributeKeyed(ViewAttributes.LineBreakModeAttribKey) + /// Get the value of the LineHeight property + member this.LineHeight = element.GetAttributeKeyed(ViewAttributes.LineHeightAttribKey) + /// Get the value of the MaxLines property + member this.MaxLines = element.GetAttributeKeyed(ViewAttributes.MaxLinesAttribKey) + /// Get the value of the TextDecorations property + member this.TextDecorations = element.GetAttributeKeyed(ViewAttributes.TextDecorationsAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a StackLayout +type StackLayoutViewer(element: ViewElement) = + inherit LayoutViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.StackLayout' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Children property + member this.Children = element.GetAttributeKeyed(ViewAttributes.ChildrenAttribKey) + /// Get the value of the Orientation property + member this.Orientation = element.GetAttributeKeyed(ViewAttributes.StackOrientationAttribKey) + /// Get the value of the Spacing property + member this.Spacing = element.GetAttributeKeyed(ViewAttributes.SpacingAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Span +type SpanViewer(element: ViewElement) = + inherit ElementViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Span' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the FontFamily property + member this.FontFamily = element.GetAttributeKeyed(ViewAttributes.FontFamilyAttribKey) + /// Get the value of the FontAttributes property + member this.FontAttributes = element.GetAttributeKeyed(ViewAttributes.FontAttributesAttribKey) + /// Get the value of the FontSize property + member this.FontSize = element.GetAttributeKeyed(ViewAttributes.FontSizeAttribKey) + /// Get the value of the BackgroundColor property + member this.BackgroundColor = element.GetAttributeKeyed(ViewAttributes.BackgroundColorAttribKey) + /// Get the value of the ForegroundColor property + member this.ForegroundColor = element.GetAttributeKeyed(ViewAttributes.ForegroundColorAttribKey) + /// Get the value of the Text property + member this.Text = element.GetAttributeKeyed(ViewAttributes.TextAttribKey) + /// Get the value of the PropertyChanged property + member this.PropertyChanged = element.GetAttributeKeyed(ViewAttributes.PropertyChangedAttribKey) + /// Get the value of the LineHeight property + member this.LineHeight = element.GetAttributeKeyed(ViewAttributes.LineHeightAttribKey) + /// Get the value of the TextDecorations property + member this.TextDecorations = element.GetAttributeKeyed(ViewAttributes.TextDecorationsAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a FormattedString +type FormattedStringViewer(element: ViewElement) = + inherit ElementViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.FormattedString' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Spans property + member this.Spans = element.GetAttributeKeyed(ViewAttributes.SpansAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a TimePicker +type TimePickerViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.TimePicker' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Time property + member this.Time = element.GetAttributeKeyed(ViewAttributes.TimeAttribKey) + /// Get the value of the Format property + member this.Format = element.GetAttributeKeyed(ViewAttributes.FormatAttribKey) + /// Get the value of the TextColor property + member this.TextColor = element.GetAttributeKeyed(ViewAttributes.TextColorAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a WebView +type WebViewViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.WebView' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Source property + member this.Source = element.GetAttributeKeyed(ViewAttributes.WebSourceAttribKey) + /// Get the value of the Reload property + member this.Reload = element.GetAttributeKeyed(ViewAttributes.ReloadAttribKey) + /// Get the value of the Navigated property + member this.Navigated = element.GetAttributeKeyed(ViewAttributes.NavigatedAttribKey) + /// Get the value of the Navigating property + member this.Navigating = element.GetAttributeKeyed(ViewAttributes.NavigatingAttribKey) + /// Get the value of the ReloadRequested property + member this.ReloadRequested = element.GetAttributeKeyed(ViewAttributes.ReloadRequestedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Page +type PageViewer(element: ViewElement) = + inherit VisualElementViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Page' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Title property + member this.Title = element.GetAttributeKeyed(ViewAttributes.TitleAttribKey) + /// Get the value of the BackgroundImage property + member this.BackgroundImage = element.GetAttributeKeyed(ViewAttributes.BackgroundImageAttribKey) + /// Get the value of the Icon property + member this.Icon = element.GetAttributeKeyed(ViewAttributes.IconAttribKey) + /// Get the value of the IsBusy property + member this.IsBusy = element.GetAttributeKeyed(ViewAttributes.IsBusyAttribKey) + /// Get the value of the Padding property + member this.Padding = element.GetAttributeKeyed(ViewAttributes.PaddingAttribKey) + /// Get the value of the ToolbarItems property + member this.ToolbarItems = element.GetAttributeKeyed(ViewAttributes.ToolbarItemsAttribKey) + /// Get the value of the UseSafeArea property + member this.UseSafeArea = element.GetAttributeKeyed(ViewAttributes.UseSafeAreaAttribKey) + /// Get the value of the Appearing property + member this.Appearing = element.GetAttributeKeyed(ViewAttributes.Page_AppearingAttribKey) + /// Get the value of the Disappearing property + member this.Disappearing = element.GetAttributeKeyed(ViewAttributes.Page_DisappearingAttribKey) + /// Get the value of the LayoutChanged property + member this.LayoutChanged = element.GetAttributeKeyed(ViewAttributes.Page_LayoutChangedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a CarouselPage +type CarouselPageViewer(element: ViewElement) = + inherit PageViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.CarouselPage' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Children property + member this.Children = element.GetAttributeKeyed(ViewAttributes.ChildrenAttribKey) + /// Get the value of the CurrentPage property + member this.CurrentPage = element.GetAttributeKeyed(ViewAttributes.CarouselPage_CurrentPageAttribKey) + /// Get the value of the CurrentPageChanged property + member this.CurrentPageChanged = element.GetAttributeKeyed(ViewAttributes.CarouselPage_CurrentPageChangedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a NavigationPage +type NavigationPageViewer(element: ViewElement) = + inherit PageViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.NavigationPage' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Pages property + member this.Pages = element.GetAttributeKeyed(ViewAttributes.PagesAttribKey) + /// Get the value of the BarBackgroundColor property + member this.BarBackgroundColor = element.GetAttributeKeyed(ViewAttributes.BarBackgroundColorAttribKey) + /// Get the value of the BarTextColor property + member this.BarTextColor = element.GetAttributeKeyed(ViewAttributes.BarTextColorAttribKey) + /// Get the value of the Popped property + member this.Popped = element.GetAttributeKeyed(ViewAttributes.PoppedAttribKey) + /// Get the value of the PoppedToRoot property + member this.PoppedToRoot = element.GetAttributeKeyed(ViewAttributes.PoppedToRootAttribKey) + /// Get the value of the Pushed property + member this.Pushed = element.GetAttributeKeyed(ViewAttributes.PushedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a TabbedPage +type TabbedPageViewer(element: ViewElement) = + inherit PageViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.TabbedPage' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Children property + member this.Children = element.GetAttributeKeyed(ViewAttributes.ChildrenAttribKey) + /// Get the value of the BarBackgroundColor property + member this.BarBackgroundColor = element.GetAttributeKeyed(ViewAttributes.BarBackgroundColorAttribKey) + /// Get the value of the BarTextColor property + member this.BarTextColor = element.GetAttributeKeyed(ViewAttributes.BarTextColorAttribKey) + /// Get the value of the CurrentPage property + member this.CurrentPage = element.GetAttributeKeyed(ViewAttributes.TabbedPage_CurrentPageAttribKey) + /// Get the value of the CurrentPageChanged property + member this.CurrentPageChanged = element.GetAttributeKeyed(ViewAttributes.TabbedPage_CurrentPageChangedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a ContentPage +type ContentPageViewer(element: ViewElement) = + inherit PageViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.ContentPage' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Content property + member this.Content = element.GetAttributeKeyed(ViewAttributes.ContentAttribKey) + /// Get the value of the OnSizeAllocatedCallback property + member this.OnSizeAllocatedCallback = element.GetAttributeKeyed(ViewAttributes.OnSizeAllocatedCallbackAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a MasterDetailPage +type MasterDetailPageViewer(element: ViewElement) = + inherit PageViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.MasterDetailPage' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Master property + member this.Master = element.GetAttributeKeyed(ViewAttributes.MasterAttribKey) + /// Get the value of the Detail property + member this.Detail = element.GetAttributeKeyed(ViewAttributes.DetailAttribKey) + /// Get the value of the IsGestureEnabled property + member this.IsGestureEnabled = element.GetAttributeKeyed(ViewAttributes.IsGestureEnabledAttribKey) + /// Get the value of the IsPresented property + member this.IsPresented = element.GetAttributeKeyed(ViewAttributes.IsPresentedAttribKey) + /// Get the value of the MasterBehavior property + member this.MasterBehavior = element.GetAttributeKeyed(ViewAttributes.MasterBehaviorAttribKey) + /// Get the value of the IsPresentedChanged property + member this.IsPresentedChanged = element.GetAttributeKeyed(ViewAttributes.IsPresentedChangedAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a MenuItem +type MenuItemViewer(element: ViewElement) = + inherit ElementViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.MenuItem' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Text property + member this.Text = element.GetAttributeKeyed(ViewAttributes.TextAttribKey) + /// Get the value of the Command property + member this.Command = element.GetAttributeKeyed(ViewAttributes.CommandAttribKey) + /// Get the value of the CommandParameter property + member this.CommandParameter = element.GetAttributeKeyed(ViewAttributes.CommandParameterAttribKey) + /// Get the value of the Icon property + member this.Icon = element.GetAttributeKeyed(ViewAttributes.IconAttribKey) + /// Get the value of the Accelerator property + member this.Accelerator = element.GetAttributeKeyed(ViewAttributes.AcceleratorAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a TextCell +type TextCellViewer(element: ViewElement) = + inherit CellViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.TextCell' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Text property + member this.Text = element.GetAttributeKeyed(ViewAttributes.TextAttribKey) + /// Get the value of the Detail property + member this.Detail = element.GetAttributeKeyed(ViewAttributes.TextDetailAttribKey) + /// Get the value of the TextColor property + member this.TextColor = element.GetAttributeKeyed(ViewAttributes.TextColorAttribKey) + /// Get the value of the DetailColor property + member this.DetailColor = element.GetAttributeKeyed(ViewAttributes.TextDetailColorAttribKey) + /// Get the value of the Command property + member this.Command = element.GetAttributeKeyed(ViewAttributes.TextCellCommandAttribKey) + /// Get the value of the CanExecute property + member this.CanExecute = element.GetAttributeKeyed(ViewAttributes.TextCellCanExecuteAttribKey) + /// Get the value of the CommandParameter property + member this.CommandParameter = element.GetAttributeKeyed(ViewAttributes.CommandParameterAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a ToolbarItem +type ToolbarItemViewer(element: ViewElement) = + inherit MenuItemViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.ToolbarItem' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Order property + member this.Order = element.GetAttributeKeyed(ViewAttributes.OrderAttribKey) + /// Get the value of the Priority property + member this.Priority = element.GetAttributeKeyed(ViewAttributes.PriorityAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a ImageCell +type ImageCellViewer(element: ViewElement) = + inherit TextCellViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.ImageCell' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the ImageSource property + member this.ImageSource = element.GetAttributeKeyed(ViewAttributes.ImageSourceAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a ViewCell +type ViewCellViewer(element: ViewElement) = + inherit CellViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.ViewCell' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the View property + member this.View = element.GetAttributeKeyed(ViewAttributes.ViewAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a ListView +type ListViewViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.ListView' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the ItemsSource property + member this.ItemsSource = element.GetAttributeKeyed(ViewAttributes.ListViewItemsAttribKey) + /// Get the value of the Footer property + member this.Footer = element.GetAttributeKeyed(ViewAttributes.FooterAttribKey) + /// Get the value of the HasUnevenRows property + member this.HasUnevenRows = element.GetAttributeKeyed(ViewAttributes.HasUnevenRowsAttribKey) + /// Get the value of the Header property + member this.Header = element.GetAttributeKeyed(ViewAttributes.HeaderAttribKey) + /// Get the value of the HeaderTemplate property + member this.HeaderTemplate = element.GetAttributeKeyed(ViewAttributes.HeaderTemplateAttribKey) + /// Get the value of the IsGroupingEnabled property + member this.IsGroupingEnabled = element.GetAttributeKeyed(ViewAttributes.IsGroupingEnabledAttribKey) + /// Get the value of the IsPullToRefreshEnabled property + member this.IsPullToRefreshEnabled = element.GetAttributeKeyed(ViewAttributes.IsPullToRefreshEnabledAttribKey) + /// Get the value of the IsRefreshing property + member this.IsRefreshing = element.GetAttributeKeyed(ViewAttributes.IsRefreshingAttribKey) + /// Get the value of the RefreshCommand property + member this.RefreshCommand = element.GetAttributeKeyed(ViewAttributes.RefreshCommandAttribKey) + /// Get the value of the RowHeight property + member this.RowHeight = element.GetAttributeKeyed(ViewAttributes.RowHeightAttribKey) + /// Get the value of the SelectedItem property + member this.SelectedItem = element.GetAttributeKeyed(ViewAttributes.ListView_SelectedItemAttribKey) + /// Get the value of the SeparatorVisibility property + member this.SeparatorVisibility = element.GetAttributeKeyed(ViewAttributes.ListView_SeparatorVisibilityAttribKey) + /// Get the value of the SeparatorColor property + member this.SeparatorColor = element.GetAttributeKeyed(ViewAttributes.ListView_SeparatorColorAttribKey) + /// Get the value of the ItemAppearing property + member this.ItemAppearing = element.GetAttributeKeyed(ViewAttributes.ListView_ItemAppearingAttribKey) + /// Get the value of the ItemDisappearing property + member this.ItemDisappearing = element.GetAttributeKeyed(ViewAttributes.ListView_ItemDisappearingAttribKey) + /// Get the value of the ItemSelected property + member this.ItemSelected = element.GetAttributeKeyed(ViewAttributes.ListView_ItemSelectedAttribKey) + /// Get the value of the ItemTapped property + member this.ItemTapped = element.GetAttributeKeyed(ViewAttributes.ListView_ItemTappedAttribKey) + /// Get the value of the Refreshing property + member this.Refreshing = element.GetAttributeKeyed(ViewAttributes.ListView_RefreshingAttribKey) + /// Get the value of the SelectionMode property + member this.SelectionMode = element.GetAttributeKeyed(ViewAttributes.SelectionModeAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a ListViewGrouped +type ListViewGroupedViewer(element: ViewElement) = + inherit ViewViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.ListView' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the ItemsSource property + member this.ItemsSource = element.GetAttributeKeyed(ViewAttributes.ListViewGrouped_ItemsSourceAttribKey) + /// Get the value of the ShowJumpList property + member this.ShowJumpList = element.GetAttributeKeyed(ViewAttributes.ListViewGrouped_ShowJumpListAttribKey) + /// Get the value of the Footer property + member this.Footer = element.GetAttributeKeyed(ViewAttributes.FooterAttribKey) + /// Get the value of the HasUnevenRows property + member this.HasUnevenRows = element.GetAttributeKeyed(ViewAttributes.HasUnevenRowsAttribKey) + /// Get the value of the Header property + member this.Header = element.GetAttributeKeyed(ViewAttributes.HeaderAttribKey) + /// Get the value of the IsPullToRefreshEnabled property + member this.IsPullToRefreshEnabled = element.GetAttributeKeyed(ViewAttributes.IsPullToRefreshEnabledAttribKey) + /// Get the value of the IsRefreshing property + member this.IsRefreshing = element.GetAttributeKeyed(ViewAttributes.IsRefreshingAttribKey) + /// Get the value of the RefreshCommand property + member this.RefreshCommand = element.GetAttributeKeyed(ViewAttributes.RefreshCommandAttribKey) + /// Get the value of the RowHeight property + member this.RowHeight = element.GetAttributeKeyed(ViewAttributes.RowHeightAttribKey) + /// Get the value of the SelectedItem property + member this.SelectedItem = element.GetAttributeKeyed(ViewAttributes.ListViewGrouped_SelectedItemAttribKey) + /// Get the value of the SeparatorVisibility property + member this.SeparatorVisibility = element.GetAttributeKeyed(ViewAttributes.SeparatorVisibilityAttribKey) + /// Get the value of the SeparatorColor property + member this.SeparatorColor = element.GetAttributeKeyed(ViewAttributes.SeparatorColorAttribKey) + /// Get the value of the ItemAppearing property + member this.ItemAppearing = element.GetAttributeKeyed(ViewAttributes.ListViewGrouped_ItemAppearingAttribKey) + /// Get the value of the ItemDisappearing property + member this.ItemDisappearing = element.GetAttributeKeyed(ViewAttributes.ListViewGrouped_ItemDisappearingAttribKey) + /// Get the value of the ItemSelected property + member this.ItemSelected = element.GetAttributeKeyed(ViewAttributes.ListViewGrouped_ItemSelectedAttribKey) + /// Get the value of the ItemTapped property + member this.ItemTapped = element.GetAttributeKeyed(ViewAttributes.ListViewGrouped_ItemTappedAttribKey) + /// Get the value of the Refreshing property + member this.Refreshing = element.GetAttributeKeyed(ViewAttributes.RefreshingAttribKey) + /// Get the value of the SelectionMode property + member this.SelectionMode = element.GetAttributeKeyed(ViewAttributes.SelectionModeAttribKey) + +type View() = + /// Describes a Element in the view + static member inline Element(?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Element -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructElement(?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a VisualElement in the view + static member inline VisualElement(?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.VisualElement -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructVisualElement(?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a View in the view + static member inline View(?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.View -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructView(?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a IGestureRecognizer in the view + static member inline IGestureRecognizer() = + + ViewBuilders.ConstructIGestureRecognizer() + + /// Describes a PanGestureRecognizer in the view + static member inline PanGestureRecognizer(?touchPoints: int, + ?panUpdated: Xamarin.Forms.PanUpdatedEventArgs -> unit, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.PanGestureRecognizer -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructPanGestureRecognizer(?touchPoints=touchPoints, + ?panUpdated=panUpdated, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a TapGestureRecognizer in the view + static member inline TapGestureRecognizer(?command: unit -> unit, + ?numberOfTapsRequired: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TapGestureRecognizer -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructTapGestureRecognizer(?command=command, + ?numberOfTapsRequired=numberOfTapsRequired, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a ClickGestureRecognizer in the view + static member inline ClickGestureRecognizer(?command: unit -> unit, + ?numberOfClicksRequired: int, + ?buttons: Xamarin.Forms.ButtonsMask, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ClickGestureRecognizer -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructClickGestureRecognizer(?command=command, + ?numberOfClicksRequired=numberOfClicksRequired, + ?buttons=buttons, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a PinchGestureRecognizer in the view + static member inline PinchGestureRecognizer(?isPinching: bool, + ?pinchUpdated: Xamarin.Forms.PinchGestureUpdatedEventArgs -> unit, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.PinchGestureRecognizer -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructPinchGestureRecognizer(?isPinching=isPinching, + ?pinchUpdated=pinchUpdated, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a SwipeGestureRecognizer in the view + static member inline SwipeGestureRecognizer(?command: unit -> unit, + ?direction: Xamarin.Forms.SwipeDirection, + ?threshold: System.UInt32, + ?swiped: Xamarin.Forms.SwipedEventArgs -> unit, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.SwipeGestureRecognizer -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructSwipeGestureRecognizer(?command=command, + ?direction=direction, + ?threshold=threshold, + ?swiped=swiped, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a ActivityIndicator in the view + static member inline ActivityIndicator(?color: Xamarin.Forms.Color, + ?isRunning: bool, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ActivityIndicator -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructActivityIndicator(?color=color, + ?isRunning=isRunning, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a BoxView in the view + static member inline BoxView(?color: Xamarin.Forms.Color, + ?cornerRadius: Xamarin.Forms.CornerRadius, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.BoxView -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructBoxView(?color=color, + ?cornerRadius=cornerRadius, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a ProgressBar in the view + static member inline ProgressBar(?progress: double, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ProgressBar -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructProgressBar(?progress=progress, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Layout in the view + static member inline Layout(?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Layout -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructLayout(?isClippedToBounds=isClippedToBounds, + ?padding=padding, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a ScrollView in the view + static member inline ScrollView(?content: ViewElement, + ?orientation: Xamarin.Forms.ScrollOrientation, + ?horizontalScrollBarVisibility: Xamarin.Forms.ScrollBarVisibility, + ?verticalScrollBarVisibility: Xamarin.Forms.ScrollBarVisibility, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ScrollView -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructScrollView(?content=content, + ?orientation=orientation, + ?horizontalScrollBarVisibility=horizontalScrollBarVisibility, + ?verticalScrollBarVisibility=verticalScrollBarVisibility, + ?isClippedToBounds=isClippedToBounds, + ?padding=padding, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a SearchBar in the view + static member inline SearchBar(?cancelButtonColor: Xamarin.Forms.Color, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?fontSize: obj, + ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, + ?placeholder: string, + ?placeholderColor: Xamarin.Forms.Color, + ?searchCommand: string -> unit, + ?canExecute: bool, + ?text: string, + ?textColor: Xamarin.Forms.Color, + ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.SearchBar -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructSearchBar(?cancelButtonColor=cancelButtonColor, + ?fontFamily=fontFamily, + ?fontAttributes=fontAttributes, + ?fontSize=fontSize, + ?horizontalTextAlignment=horizontalTextAlignment, + ?placeholder=placeholder, + ?placeholderColor=placeholderColor, + ?searchCommand=searchCommand, + ?canExecute=canExecute, + ?text=text, + ?textColor=textColor, + ?textChanged=textChanged, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Button in the view + static member inline Button(?text: string, + ?command: unit -> unit, + ?canExecute: bool, + ?borderColor: Xamarin.Forms.Color, + ?borderWidth: double, + ?commandParameter: System.Object, + ?contentLayout: Xamarin.Forms.Button.ButtonContentLayout, + ?cornerRadius: int, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?fontSize: obj, + ?image: string, + ?textColor: Xamarin.Forms.Color, + ?padding: Xamarin.Forms.Thickness, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Button -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructButton(?text=text, + ?command=command, + ?canExecute=canExecute, + ?borderColor=borderColor, + ?borderWidth=borderWidth, + ?commandParameter=commandParameter, + ?contentLayout=contentLayout, + ?cornerRadius=cornerRadius, + ?fontFamily=fontFamily, + ?fontAttributes=fontAttributes, + ?fontSize=fontSize, + ?image=image, + ?textColor=textColor, + ?padding=padding, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Slider in the view + static member inline Slider(?minimumMaximum: float * float, + ?value: double, + ?valueChanged: Xamarin.Forms.ValueChangedEventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Slider -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructSlider(?minimumMaximum=minimumMaximum, + ?value=value, + ?valueChanged=valueChanged, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Stepper in the view + static member inline Stepper(?minimumMaximum: float * float, + ?value: double, + ?increment: double, + ?valueChanged: Xamarin.Forms.ValueChangedEventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Stepper -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructStepper(?minimumMaximum=minimumMaximum, + ?value=value, + ?increment=increment, + ?valueChanged=valueChanged, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Switch in the view + static member inline Switch(?isToggled: bool, + ?toggled: Xamarin.Forms.ToggledEventArgs -> unit, + ?onColor: Xamarin.Forms.Color, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Switch -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructSwitch(?isToggled=isToggled, + ?toggled=toggled, + ?onColor=onColor, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Cell in the view + static member inline Cell(?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Cell -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructCell(?height=height, + ?isEnabled=isEnabled, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a SwitchCell in the view + static member inline SwitchCell(?on: bool, + ?text: string, + ?onChanged: Xamarin.Forms.ToggledEventArgs -> unit, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.SwitchCell -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructSwitchCell(?on=on, + ?text=text, + ?onChanged=onChanged, + ?height=height, + ?isEnabled=isEnabled, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a TableView in the view + static member inline TableView(?intent: Xamarin.Forms.TableIntent, + ?hasUnevenRows: bool, + ?rowHeight: int, + ?items: (string * ViewElement list) list, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TableView -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructTableView(?intent=intent, + ?hasUnevenRows=hasUnevenRows, + ?rowHeight=rowHeight, + ?items=items, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a RowDefinition in the view + static member inline RowDefinition(?height: obj) = + + ViewBuilders.ConstructRowDefinition(?height=height) + + /// Describes a ColumnDefinition in the view + static member inline ColumnDefinition(?width: obj) = + + ViewBuilders.ConstructColumnDefinition(?width=width) + + /// Describes a Grid in the view + static member inline Grid(?rowdefs: obj list, + ?coldefs: obj list, + ?rowSpacing: double, + ?columnSpacing: double, + ?children: ViewElement list, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Grid -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructGrid(?rowdefs=rowdefs, + ?coldefs=coldefs, + ?rowSpacing=rowSpacing, + ?columnSpacing=columnSpacing, + ?children=children, + ?isClippedToBounds=isClippedToBounds, + ?padding=padding, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a AbsoluteLayout in the view + static member inline AbsoluteLayout(?children: ViewElement list, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.AbsoluteLayout -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructAbsoluteLayout(?children=children, + ?isClippedToBounds=isClippedToBounds, + ?padding=padding, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a RelativeLayout in the view + static member inline RelativeLayout(?children: ViewElement list, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.RelativeLayout -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructRelativeLayout(?children=children, + ?isClippedToBounds=isClippedToBounds, + ?padding=padding, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a FlexLayout in the view + static member inline FlexLayout(?alignContent: Xamarin.Forms.FlexAlignContent, + ?alignItems: Xamarin.Forms.FlexAlignItems, + ?direction: Xamarin.Forms.FlexDirection, + ?position: Xamarin.Forms.FlexPosition, + ?wrap: Xamarin.Forms.FlexWrap, + ?justifyContent: Xamarin.Forms.FlexJustify, + ?children: ViewElement list, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.FlexLayout -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructFlexLayout(?alignContent=alignContent, + ?alignItems=alignItems, + ?direction=direction, + ?position=position, + ?wrap=wrap, + ?justifyContent=justifyContent, + ?children=children, + ?isClippedToBounds=isClippedToBounds, + ?padding=padding, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a TemplatedView in the view + static member inline TemplatedView(?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TemplatedView -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructTemplatedView(?isClippedToBounds=isClippedToBounds, + ?padding=padding, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a ContentView in the view + static member inline ContentView(?content: ViewElement, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ContentView -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructContentView(?content=content, + ?isClippedToBounds=isClippedToBounds, + ?padding=padding, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a DatePicker in the view + static member inline DatePicker(?date: System.DateTime, + ?format: string, + ?minimumDate: System.DateTime, + ?maximumDate: System.DateTime, + ?dateSelected: Xamarin.Forms.DateChangedEventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.DatePicker -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructDatePicker(?date=date, + ?format=format, + ?minimumDate=minimumDate, + ?maximumDate=maximumDate, + ?dateSelected=dateSelected, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Picker in the view + static member inline Picker(?itemsSource: seq<'T>, + ?selectedIndex: int, + ?title: string, + ?textColor: Xamarin.Forms.Color, + ?selectedIndexChanged: (int * 'T option) -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Picker -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructPicker(?itemsSource=itemsSource, + ?selectedIndex=selectedIndex, + ?title=title, + ?textColor=textColor, + ?selectedIndexChanged=selectedIndexChanged, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Frame in the view + static member inline Frame(?borderColor: Xamarin.Forms.Color, + ?cornerRadius: double, + ?hasShadow: bool, + ?content: ViewElement, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Frame -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructFrame(?borderColor=borderColor, + ?cornerRadius=cornerRadius, + ?hasShadow=hasShadow, + ?content=content, + ?isClippedToBounds=isClippedToBounds, + ?padding=padding, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Image in the view + static member inline Image(?source: obj, + ?aspect: Xamarin.Forms.Aspect, + ?isOpaque: bool, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Image -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructImage(?source=source, + ?aspect=aspect, + ?isOpaque=isOpaque, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a ImageButton in the view + static member inline ImageButton(?command: unit -> unit, + ?source: obj, + ?aspect: Xamarin.Forms.Aspect, + ?borderColor: Xamarin.Forms.Color, + ?borderWidth: double, + ?cornerRadius: int, + ?isOpaque: bool, + ?padding: Xamarin.Forms.Thickness, + ?clicked: System.EventArgs -> unit, + ?pressed: System.EventArgs -> unit, + ?released: System.EventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ImageButton -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructImageButton(?command=command, + ?source=source, + ?aspect=aspect, + ?borderColor=borderColor, + ?borderWidth=borderWidth, + ?cornerRadius=cornerRadius, + ?isOpaque=isOpaque, + ?padding=padding, + ?clicked=clicked, + ?pressed=pressed, + ?released=released, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a InputView in the view + static member inline InputView(?keyboard: Xamarin.Forms.Keyboard, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.InputView -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructInputView(?keyboard=keyboard, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Editor in the view + static member inline Editor(?text: string, + ?fontSize: obj, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?textColor: Xamarin.Forms.Color, + ?completed: string -> unit, + ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, + ?autoSize: Xamarin.Forms.EditorAutoSizeOption, + ?placeholder: string, + ?placeholderColor: Xamarin.Forms.Color, + ?keyboard: Xamarin.Forms.Keyboard, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Editor -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructEditor(?text=text, + ?fontSize=fontSize, + ?fontFamily=fontFamily, + ?fontAttributes=fontAttributes, + ?textColor=textColor, + ?completed=completed, + ?textChanged=textChanged, + ?autoSize=autoSize, + ?placeholder=placeholder, + ?placeholderColor=placeholderColor, + ?keyboard=keyboard, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Entry in the view + static member inline Entry(?text: string, + ?placeholder: string, + ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, + ?fontSize: obj, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?textColor: Xamarin.Forms.Color, + ?placeholderColor: Xamarin.Forms.Color, + ?isPassword: bool, + ?completed: string -> unit, + ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, + ?isTextPredictionEnabled: bool, + ?returnType: Xamarin.Forms.ReturnType, + ?returnCommand: unit -> unit, + ?cursorPosition: int, + ?selectionLength: int, + ?keyboard: Xamarin.Forms.Keyboard, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Entry -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructEntry(?text=text, + ?placeholder=placeholder, + ?horizontalTextAlignment=horizontalTextAlignment, + ?fontSize=fontSize, + ?fontFamily=fontFamily, + ?fontAttributes=fontAttributes, + ?textColor=textColor, + ?placeholderColor=placeholderColor, + ?isPassword=isPassword, + ?completed=completed, + ?textChanged=textChanged, + ?isTextPredictionEnabled=isTextPredictionEnabled, + ?returnType=returnType, + ?returnCommand=returnCommand, + ?cursorPosition=cursorPosition, + ?selectionLength=selectionLength, + ?keyboard=keyboard, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a EntryCell in the view + static member inline EntryCell(?label: string, + ?text: string, + ?keyboard: Xamarin.Forms.Keyboard, + ?placeholder: string, + ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, + ?completed: string -> unit, + ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Fabulous.CustomControls.CustomEntryCell -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructEntryCell(?label=label, + ?text=text, + ?keyboard=keyboard, + ?placeholder=placeholder, + ?horizontalTextAlignment=horizontalTextAlignment, + ?completed=completed, + ?textChanged=textChanged, + ?height=height, + ?isEnabled=isEnabled, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Label in the view + static member inline Label(?text: string, + ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, + ?verticalTextAlignment: Xamarin.Forms.TextAlignment, + ?fontSize: obj, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?textColor: Xamarin.Forms.Color, + ?formattedText: ViewElement, + ?lineBreakMode: Xamarin.Forms.LineBreakMode, + ?lineHeight: double, + ?maxLines: int, + ?textDecorations: Xamarin.Forms.TextDecorations, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Label -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructLabel(?text=text, + ?horizontalTextAlignment=horizontalTextAlignment, + ?verticalTextAlignment=verticalTextAlignment, + ?fontSize=fontSize, + ?fontFamily=fontFamily, + ?fontAttributes=fontAttributes, + ?textColor=textColor, + ?formattedText=formattedText, + ?lineBreakMode=lineBreakMode, + ?lineHeight=lineHeight, + ?maxLines=maxLines, + ?textDecorations=textDecorations, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a StackLayout in the view + static member inline StackLayout(?children: ViewElement list, + ?orientation: Xamarin.Forms.StackOrientation, + ?spacing: double, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.StackLayout -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructStackLayout(?children=children, + ?orientation=orientation, + ?spacing=spacing, + ?isClippedToBounds=isClippedToBounds, + ?padding=padding, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Span in the view + static member inline Span(?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?fontSize: obj, + ?backgroundColor: Xamarin.Forms.Color, + ?foregroundColor: Xamarin.Forms.Color, + ?text: string, + ?propertyChanged: System.ComponentModel.PropertyChangedEventArgs -> unit, + ?lineHeight: double, + ?textDecorations: Xamarin.Forms.TextDecorations, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Span -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructSpan(?fontFamily=fontFamily, + ?fontAttributes=fontAttributes, + ?fontSize=fontSize, + ?backgroundColor=backgroundColor, + ?foregroundColor=foregroundColor, + ?text=text, + ?propertyChanged=propertyChanged, + ?lineHeight=lineHeight, + ?textDecorations=textDecorations, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a FormattedString in the view + static member inline FormattedString(?spans: ViewElement[], + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.FormattedString -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructFormattedString(?spans=spans, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a TimePicker in the view + static member inline TimePicker(?time: System.TimeSpan, + ?format: string, + ?textColor: Xamarin.Forms.Color, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TimePicker -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructTimePicker(?time=time, + ?format=format, + ?textColor=textColor, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a WebView in the view + static member inline WebView(?source: Xamarin.Forms.WebViewSource, + ?reload: bool, + ?navigated: Xamarin.Forms.WebNavigatedEventArgs -> unit, + ?navigating: Xamarin.Forms.WebNavigatingEventArgs -> unit, + ?reloadRequested: System.EventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.WebView -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructWebView(?source=source, + ?reload=reload, + ?navigated=navigated, + ?navigating=navigating, + ?reloadRequested=reloadRequested, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a Page in the view + static member inline Page(?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Page -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructPage(?title=title, + ?backgroundImage=backgroundImage, + ?icon=icon, + ?isBusy=isBusy, + ?padding=padding, + ?toolbarItems=toolbarItems, + ?useSafeArea=useSafeArea, + ?appearing=appearing, + ?disappearing=disappearing, + ?layoutChanged=layoutChanged, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a CarouselPage in the view + static member inline CarouselPage(?children: ViewElement list, + ?currentPage: int, + ?currentPageChanged: int option -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.CarouselPage -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructCarouselPage(?children=children, + ?currentPage=currentPage, + ?currentPageChanged=currentPageChanged, + ?title=title, + ?backgroundImage=backgroundImage, + ?icon=icon, + ?isBusy=isBusy, + ?padding=padding, + ?toolbarItems=toolbarItems, + ?useSafeArea=useSafeArea, + ?appearing=appearing, + ?disappearing=disappearing, + ?layoutChanged=layoutChanged, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a NavigationPage in the view + static member inline NavigationPage(?pages: ViewElement list, + ?barBackgroundColor: Xamarin.Forms.Color, + ?barTextColor: Xamarin.Forms.Color, + ?popped: Xamarin.Forms.NavigationEventArgs -> unit, + ?poppedToRoot: Xamarin.Forms.NavigationEventArgs -> unit, + ?pushed: Xamarin.Forms.NavigationEventArgs -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.NavigationPage -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructNavigationPage(?pages=pages, + ?barBackgroundColor=barBackgroundColor, + ?barTextColor=barTextColor, + ?popped=popped, + ?poppedToRoot=poppedToRoot, + ?pushed=pushed, + ?title=title, + ?backgroundImage=backgroundImage, + ?icon=icon, + ?isBusy=isBusy, + ?padding=padding, + ?toolbarItems=toolbarItems, + ?useSafeArea=useSafeArea, + ?appearing=appearing, + ?disappearing=disappearing, + ?layoutChanged=layoutChanged, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a TabbedPage in the view + static member inline TabbedPage(?children: ViewElement list, + ?barBackgroundColor: Xamarin.Forms.Color, + ?barTextColor: Xamarin.Forms.Color, + ?currentPage: int, + ?currentPageChanged: int option -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TabbedPage -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructTabbedPage(?children=children, + ?barBackgroundColor=barBackgroundColor, + ?barTextColor=barTextColor, + ?currentPage=currentPage, + ?currentPageChanged=currentPageChanged, + ?title=title, + ?backgroundImage=backgroundImage, + ?icon=icon, + ?isBusy=isBusy, + ?padding=padding, + ?toolbarItems=toolbarItems, + ?useSafeArea=useSafeArea, + ?appearing=appearing, + ?disappearing=disappearing, + ?layoutChanged=layoutChanged, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a ContentPage in the view + static member inline ContentPage(?content: ViewElement, + ?onSizeAllocated: (double * double) -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ContentPage -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructContentPage(?content=content, + ?onSizeAllocated=onSizeAllocated, + ?title=title, + ?backgroundImage=backgroundImage, + ?icon=icon, + ?isBusy=isBusy, + ?padding=padding, + ?toolbarItems=toolbarItems, + ?useSafeArea=useSafeArea, + ?appearing=appearing, + ?disappearing=disappearing, + ?layoutChanged=layoutChanged, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a MasterDetailPage in the view + static member inline MasterDetailPage(?master: ViewElement, + ?detail: ViewElement, + ?isGestureEnabled: bool, + ?isPresented: bool, + ?masterBehavior: Xamarin.Forms.MasterBehavior, + ?isPresentedChanged: bool -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.MasterDetailPage -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructMasterDetailPage(?master=master, + ?detail=detail, + ?isGestureEnabled=isGestureEnabled, + ?isPresented=isPresented, + ?masterBehavior=masterBehavior, + ?isPresentedChanged=isPresentedChanged, + ?title=title, + ?backgroundImage=backgroundImage, + ?icon=icon, + ?isBusy=isBusy, + ?padding=padding, + ?toolbarItems=toolbarItems, + ?useSafeArea=useSafeArea, + ?appearing=appearing, + ?disappearing=disappearing, + ?layoutChanged=layoutChanged, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a MenuItem in the view + static member inline MenuItem(?text: string, + ?command: unit -> unit, + ?commandParameter: System.Object, + ?icon: string, + ?accelerator: string, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.MenuItem -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructMenuItem(?text=text, + ?command=command, + ?commandParameter=commandParameter, + ?icon=icon, + ?accelerator=accelerator, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a TextCell in the view + static member inline TextCell(?text: string, + ?detail: string, + ?textColor: Xamarin.Forms.Color, + ?detailColor: Xamarin.Forms.Color, + ?command: unit -> unit, + ?canExecute: bool, + ?commandParameter: System.Object, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TextCell -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructTextCell(?text=text, + ?detail=detail, + ?textColor=textColor, + ?detailColor=detailColor, + ?command=command, + ?canExecute=canExecute, + ?commandParameter=commandParameter, + ?height=height, + ?isEnabled=isEnabled, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a ToolbarItem in the view + static member inline ToolbarItem(?order: Xamarin.Forms.ToolbarItemOrder, + ?priority: int, + ?text: string, + ?command: unit -> unit, + ?commandParameter: System.Object, + ?icon: string, + ?accelerator: string, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ToolbarItem -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructToolbarItem(?order=order, + ?priority=priority, + ?text=text, + ?command=command, + ?commandParameter=commandParameter, + ?icon=icon, + ?accelerator=accelerator, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a ImageCell in the view + static member inline ImageCell(?imageSource: obj, + ?text: string, + ?detail: string, + ?textColor: Xamarin.Forms.Color, + ?detailColor: Xamarin.Forms.Color, + ?command: unit -> unit, + ?canExecute: bool, + ?commandParameter: System.Object, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ImageCell -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructImageCell(?imageSource=imageSource, + ?text=text, + ?detail=detail, + ?textColor=textColor, + ?detailColor=detailColor, + ?command=command, + ?canExecute=canExecute, + ?commandParameter=commandParameter, + ?height=height, + ?isEnabled=isEnabled, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a ViewCell in the view + static member inline ViewCell(?view: ViewElement, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ViewCell -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructViewCell(?view=view, + ?height=height, + ?isEnabled=isEnabled, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + + /// Describes a ListView in the view + static member inline ListView(?items: seq, + ?footer: System.Object, + ?hasUnevenRows: bool, + ?header: System.Object, + ?headerTemplate: Xamarin.Forms.DataTemplate, + ?isGroupingEnabled: bool, + ?isPullToRefreshEnabled: bool, + ?isRefreshing: bool, + ?refreshCommand: unit -> unit, + ?rowHeight: int, + ?selectedItem: int option, + ?separatorVisibility: Xamarin.Forms.SeparatorVisibility, + ?separatorColor: Xamarin.Forms.Color, + ?itemAppearing: int -> unit, + ?itemDisappearing: int -> unit, + ?itemSelected: int option -> unit, + ?itemTapped: int -> unit, + ?refreshing: unit -> unit, + ?selectionMode: Xamarin.Forms.ListViewSelectionMode, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ListView -> unit), + ?ref: ViewRef) = + + ViewBuilders.ConstructListView(?items=items, + ?footer=footer, + ?hasUnevenRows=hasUnevenRows, + ?header=header, + ?headerTemplate=headerTemplate, + ?isGroupingEnabled=isGroupingEnabled, + ?isPullToRefreshEnabled=isPullToRefreshEnabled, + ?isRefreshing=isRefreshing, + ?refreshCommand=refreshCommand, + ?rowHeight=rowHeight, + ?selectedItem=selectedItem, + ?separatorVisibility=separatorVisibility, + ?separatorColor=separatorColor, + ?itemAppearing=itemAppearing, + ?itemDisappearing=itemDisappearing, + ?itemSelected=itemSelected, + ?itemTapped=itemTapped, + ?refreshing=refreshing, + ?selectionMode=selectionMode, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, + ?styleSheets=styleSheets, + ?isTabStop=isTabStop, + ?scaleX=scaleX, + ?scaleY=scaleY, + ?tabIndex=tabIndex, + ?classId=classId, + ?styleId=styleId, + ?automationId=automationId, + ?created=created, + ?ref=ref) + /// Describes a ListViewGrouped in the view static member inline ListViewGrouped(?items: (string * ViewElement * ViewElement list) list, ?showJumpList: bool, @@ -11957,10 +15935,9 @@ type View() = ?styleId: string, ?automationId: string, ?created: (Xamarin.Forms.ListView -> unit), - ?ref: ViewRef) = + ?ref: ViewRef) = - let attribBuilder = View.BuildListViewGrouped(0, - ?items=items, + ViewBuilders.ConstructListViewGrouped(?items=items, ?showJumpList=showJumpList, ?footer=footer, ?hasUnevenRows=hasUnevenRows, @@ -12011,13 +15988,9 @@ type View() = ?classId=classId, ?styleId=styleId, ?automationId=automationId, - ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), - ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - - ViewElement.Create(View.CreateFuncListViewGrouped, View.UpdateFuncListViewGrouped, attribBuilder) + ?created=created, + ?ref=ref) - [] - static member val ProtoListViewGrouped : ViewElement option = None with get, set [] module ViewElementExtensions = @@ -12025,1388 +15998,1437 @@ module ViewElementExtensions = type ViewElement with /// Adjusts the ClassId property in the visual element - member x.ClassId(value: string) = x.WithAttribute(View._ClassIdAttribKey, (value)) + member x.ClassId(value: string) = x.WithAttribute(ViewAttributes.ClassIdAttribKey, (value)) /// Adjusts the StyleId property in the visual element - member x.StyleId(value: string) = x.WithAttribute(View._StyleIdAttribKey, (value)) + member x.StyleId(value: string) = x.WithAttribute(ViewAttributes.StyleIdAttribKey, (value)) /// Adjusts the AutomationId property in the visual element - member x.AutomationId(value: string) = x.WithAttribute(View._AutomationIdAttribKey, (value)) + member x.AutomationId(value: string) = x.WithAttribute(ViewAttributes.AutomationIdAttribKey, (value)) /// Adjusts the AnchorX property in the visual element - member x.AnchorX(value: double) = x.WithAttribute(View._AnchorXAttribKey, (value)) + member x.AnchorX(value: double) = x.WithAttribute(ViewAttributes.AnchorXAttribKey, (value)) /// Adjusts the AnchorY property in the visual element - member x.AnchorY(value: double) = x.WithAttribute(View._AnchorYAttribKey, (value)) + member x.AnchorY(value: double) = x.WithAttribute(ViewAttributes.AnchorYAttribKey, (value)) /// Adjusts the BackgroundColor property in the visual element - member x.BackgroundColor(value: Xamarin.Forms.Color) = x.WithAttribute(View._BackgroundColorAttribKey, (value)) + member x.BackgroundColor(value: Xamarin.Forms.Color) = x.WithAttribute(ViewAttributes.BackgroundColorAttribKey, (value)) /// Adjusts the HeightRequest property in the visual element - member x.HeightRequest(value: double) = x.WithAttribute(View._HeightRequestAttribKey, (value)) + member x.HeightRequest(value: double) = x.WithAttribute(ViewAttributes.HeightRequestAttribKey, (value)) /// Adjusts the InputTransparent property in the visual element - member x.InputTransparent(value: bool) = x.WithAttribute(View._InputTransparentAttribKey, (value)) + member x.InputTransparent(value: bool) = x.WithAttribute(ViewAttributes.InputTransparentAttribKey, (value)) /// Adjusts the IsEnabled property in the visual element - member x.IsEnabled(value: bool) = x.WithAttribute(View._IsEnabledAttribKey, (value)) + member x.IsEnabled(value: bool) = x.WithAttribute(ViewAttributes.IsEnabledAttribKey, (value)) /// Adjusts the IsVisible property in the visual element - member x.IsVisible(value: bool) = x.WithAttribute(View._IsVisibleAttribKey, (value)) + member x.IsVisible(value: bool) = x.WithAttribute(ViewAttributes.IsVisibleAttribKey, (value)) /// Adjusts the MinimumHeightRequest property in the visual element - member x.MinimumHeightRequest(value: double) = x.WithAttribute(View._MinimumHeightRequestAttribKey, (value)) + member x.MinimumHeightRequest(value: double) = x.WithAttribute(ViewAttributes.MinimumHeightRequestAttribKey, (value)) /// Adjusts the MinimumWidthRequest property in the visual element - member x.MinimumWidthRequest(value: double) = x.WithAttribute(View._MinimumWidthRequestAttribKey, (value)) + member x.MinimumWidthRequest(value: double) = x.WithAttribute(ViewAttributes.MinimumWidthRequestAttribKey, (value)) /// Adjusts the Opacity property in the visual element - member x.Opacity(value: double) = x.WithAttribute(View._OpacityAttribKey, (value)) + member x.Opacity(value: double) = x.WithAttribute(ViewAttributes.OpacityAttribKey, (value)) /// Adjusts the Rotation property in the visual element - member x.Rotation(value: double) = x.WithAttribute(View._RotationAttribKey, (value)) + member x.Rotation(value: double) = x.WithAttribute(ViewAttributes.RotationAttribKey, (value)) /// Adjusts the RotationX property in the visual element - member x.RotationX(value: double) = x.WithAttribute(View._RotationXAttribKey, (value)) + member x.RotationX(value: double) = x.WithAttribute(ViewAttributes.RotationXAttribKey, (value)) /// Adjusts the RotationY property in the visual element - member x.RotationY(value: double) = x.WithAttribute(View._RotationYAttribKey, (value)) + member x.RotationY(value: double) = x.WithAttribute(ViewAttributes.RotationYAttribKey, (value)) /// Adjusts the Scale property in the visual element - member x.Scale(value: double) = x.WithAttribute(View._ScaleAttribKey, (value)) + member x.Scale(value: double) = x.WithAttribute(ViewAttributes.ScaleAttribKey, (value)) /// Adjusts the Style property in the visual element - member x.Style(value: Xamarin.Forms.Style) = x.WithAttribute(View._StyleAttribKey, (value)) + member x.Style(value: Xamarin.Forms.Style) = x.WithAttribute(ViewAttributes.StyleAttribKey, (value)) /// Adjusts the StyleClass property in the visual element - member x.StyleClass(value: obj) = x.WithAttribute(View._StyleClassAttribKey, makeStyleClass(value)) + member x.StyleClass(value: obj) = x.WithAttribute(ViewAttributes.StyleClassAttribKey, makeStyleClass(value)) /// Adjusts the TranslationX property in the visual element - member x.TranslationX(value: double) = x.WithAttribute(View._TranslationXAttribKey, (value)) + member x.TranslationX(value: double) = x.WithAttribute(ViewAttributes.TranslationXAttribKey, (value)) /// Adjusts the TranslationY property in the visual element - member x.TranslationY(value: double) = x.WithAttribute(View._TranslationYAttribKey, (value)) + member x.TranslationY(value: double) = x.WithAttribute(ViewAttributes.TranslationYAttribKey, (value)) /// Adjusts the WidthRequest property in the visual element - member x.WidthRequest(value: double) = x.WithAttribute(View._WidthRequestAttribKey, (value)) + member x.WidthRequest(value: double) = x.WithAttribute(ViewAttributes.WidthRequestAttribKey, (value)) /// Adjusts the Resources property in the visual element - member x.Resources(value: (string * obj) list) = x.WithAttribute(View._ResourcesAttribKey, (value)) + member x.Resources(value: (string * obj) list) = x.WithAttribute(ViewAttributes.ResourcesAttribKey, (value)) /// Adjusts the Styles property in the visual element - member x.Styles(value: Xamarin.Forms.Style list) = x.WithAttribute(View._StylesAttribKey, (value)) + member x.Styles(value: Xamarin.Forms.Style list) = x.WithAttribute(ViewAttributes.StylesAttribKey, (value)) /// Adjusts the StyleSheets property in the visual element - member x.StyleSheets(value: Xamarin.Forms.StyleSheets.StyleSheet list) = x.WithAttribute(View._StyleSheetsAttribKey, (value)) + member x.StyleSheets(value: Xamarin.Forms.StyleSheets.StyleSheet list) = x.WithAttribute(ViewAttributes.StyleSheetsAttribKey, (value)) /// Adjusts the IsTabStop property in the visual element - member x.IsTabStop(value: bool) = x.WithAttribute(View._IsTabStopAttribKey, (value)) + member x.IsTabStop(value: bool) = x.WithAttribute(ViewAttributes.IsTabStopAttribKey, (value)) /// Adjusts the ScaleX property in the visual element - member x.ScaleX(value: double) = x.WithAttribute(View._ScaleXAttribKey, (value)) + member x.ScaleX(value: double) = x.WithAttribute(ViewAttributes.ScaleXAttribKey, (value)) /// Adjusts the ScaleY property in the visual element - member x.ScaleY(value: double) = x.WithAttribute(View._ScaleYAttribKey, (value)) + member x.ScaleY(value: double) = x.WithAttribute(ViewAttributes.ScaleYAttribKey, (value)) /// Adjusts the TabIndex property in the visual element - member x.TabIndex(value: int) = x.WithAttribute(View._TabIndexAttribKey, (value)) + member x.TabIndex(value: int) = x.WithAttribute(ViewAttributes.TabIndexAttribKey, (value)) /// Adjusts the HorizontalOptions property in the visual element - member x.HorizontalOptions(value: Xamarin.Forms.LayoutOptions) = x.WithAttribute(View._HorizontalOptionsAttribKey, (value)) + member x.HorizontalOptions(value: Xamarin.Forms.LayoutOptions) = x.WithAttribute(ViewAttributes.HorizontalOptionsAttribKey, (value)) /// Adjusts the VerticalOptions property in the visual element - member x.VerticalOptions(value: Xamarin.Forms.LayoutOptions) = x.WithAttribute(View._VerticalOptionsAttribKey, (value)) + member x.VerticalOptions(value: Xamarin.Forms.LayoutOptions) = x.WithAttribute(ViewAttributes.VerticalOptionsAttribKey, (value)) /// Adjusts the Margin property in the visual element - member x.Margin(value: obj) = x.WithAttribute(View._MarginAttribKey, makeThickness(value)) + member x.Margin(value: obj) = x.WithAttribute(ViewAttributes.MarginAttribKey, makeThickness(value)) /// Adjusts the GestureRecognizers property in the visual element - member x.GestureRecognizers(value: ViewElement list) = x.WithAttribute(View._GestureRecognizersAttribKey, Array.ofList(value)) + member x.GestureRecognizers(value: ViewElement list) = x.WithAttribute(ViewAttributes.GestureRecognizersAttribKey, Array.ofList(value)) /// Adjusts the TouchPoints property in the visual element - member x.TouchPoints(value: int) = x.WithAttribute(View._TouchPointsAttribKey, (value)) + member x.TouchPoints(value: int) = x.WithAttribute(ViewAttributes.TouchPointsAttribKey, (value)) /// Adjusts the PanUpdated property in the visual element - member x.PanUpdated(value: Xamarin.Forms.PanUpdatedEventArgs -> unit) = x.WithAttribute(View._PanUpdatedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.PanUpdated(value: Xamarin.Forms.PanUpdatedEventArgs -> unit) = x.WithAttribute(ViewAttributes.PanUpdatedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the Command property in the visual element - member x.Command(value: unit -> unit) = x.WithAttribute(View._CommandAttribKey, makeCommand(value)) + member x.Command(value: unit -> unit) = x.WithAttribute(ViewAttributes.CommandAttribKey, makeCommand(value)) /// Adjusts the NumberOfTapsRequired property in the visual element - member x.NumberOfTapsRequired(value: int) = x.WithAttribute(View._NumberOfTapsRequiredAttribKey, (value)) + member x.NumberOfTapsRequired(value: int) = x.WithAttribute(ViewAttributes.NumberOfTapsRequiredAttribKey, (value)) /// Adjusts the NumberOfClicksRequired property in the visual element - member x.NumberOfClicksRequired(value: int) = x.WithAttribute(View._NumberOfClicksRequiredAttribKey, (value)) + member x.NumberOfClicksRequired(value: int) = x.WithAttribute(ViewAttributes.NumberOfClicksRequiredAttribKey, (value)) /// Adjusts the Buttons property in the visual element - member x.Buttons(value: Xamarin.Forms.ButtonsMask) = x.WithAttribute(View._ButtonsAttribKey, (value)) + member x.Buttons(value: Xamarin.Forms.ButtonsMask) = x.WithAttribute(ViewAttributes.ButtonsAttribKey, (value)) /// Adjusts the IsPinching property in the visual element - member x.IsPinching(value: bool) = x.WithAttribute(View._IsPinchingAttribKey, (value)) + member x.IsPinching(value: bool) = x.WithAttribute(ViewAttributes.IsPinchingAttribKey, (value)) /// Adjusts the PinchUpdated property in the visual element - member x.PinchUpdated(value: Xamarin.Forms.PinchGestureUpdatedEventArgs -> unit) = x.WithAttribute(View._PinchUpdatedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.PinchUpdated(value: Xamarin.Forms.PinchGestureUpdatedEventArgs -> unit) = x.WithAttribute(ViewAttributes.PinchUpdatedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the SwipeGestureRecognizerDirection property in the visual element - member x.SwipeGestureRecognizerDirection(value: Xamarin.Forms.SwipeDirection) = x.WithAttribute(View._SwipeGestureRecognizerDirectionAttribKey, (value)) + member x.SwipeGestureRecognizerDirection(value: Xamarin.Forms.SwipeDirection) = x.WithAttribute(ViewAttributes.SwipeGestureRecognizerDirectionAttribKey, (value)) /// Adjusts the Threshold property in the visual element - member x.Threshold(value: System.UInt32) = x.WithAttribute(View._ThresholdAttribKey, (value)) + member x.Threshold(value: System.UInt32) = x.WithAttribute(ViewAttributes.ThresholdAttribKey, (value)) /// Adjusts the Swiped property in the visual element - member x.Swiped(value: Xamarin.Forms.SwipedEventArgs -> unit) = x.WithAttribute(View._SwipedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.Swiped(value: Xamarin.Forms.SwipedEventArgs -> unit) = x.WithAttribute(ViewAttributes.SwipedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the Color property in the visual element - member x.Color(value: Xamarin.Forms.Color) = x.WithAttribute(View._ColorAttribKey, (value)) + member x.Color(value: Xamarin.Forms.Color) = x.WithAttribute(ViewAttributes.ColorAttribKey, (value)) /// Adjusts the IsRunning property in the visual element - member x.IsRunning(value: bool) = x.WithAttribute(View._IsRunningAttribKey, (value)) + member x.IsRunning(value: bool) = x.WithAttribute(ViewAttributes.IsRunningAttribKey, (value)) /// Adjusts the BoxViewCornerRadius property in the visual element - member x.BoxViewCornerRadius(value: Xamarin.Forms.CornerRadius) = x.WithAttribute(View._BoxViewCornerRadiusAttribKey, (value)) + member x.BoxViewCornerRadius(value: Xamarin.Forms.CornerRadius) = x.WithAttribute(ViewAttributes.BoxViewCornerRadiusAttribKey, (value)) /// Adjusts the Progress property in the visual element - member x.Progress(value: double) = x.WithAttribute(View._ProgressAttribKey, (value)) + member x.Progress(value: double) = x.WithAttribute(ViewAttributes.ProgressAttribKey, (value)) /// Adjusts the IsClippedToBounds property in the visual element - member x.IsClippedToBounds(value: bool) = x.WithAttribute(View._IsClippedToBoundsAttribKey, (value)) + member x.IsClippedToBounds(value: bool) = x.WithAttribute(ViewAttributes.IsClippedToBoundsAttribKey, (value)) /// Adjusts the Padding property in the visual element - member x.Padding(value: obj) = x.WithAttribute(View._PaddingAttribKey, makeThickness(value)) + member x.Padding(value: obj) = x.WithAttribute(ViewAttributes.PaddingAttribKey, makeThickness(value)) /// Adjusts the Content property in the visual element - member x.Content(value: ViewElement) = x.WithAttribute(View._ContentAttribKey, (value)) + member x.Content(value: ViewElement) = x.WithAttribute(ViewAttributes.ContentAttribKey, (value)) /// Adjusts the ScrollOrientation property in the visual element - member x.ScrollOrientation(value: Xamarin.Forms.ScrollOrientation) = x.WithAttribute(View._ScrollOrientationAttribKey, (value)) + member x.ScrollOrientation(value: Xamarin.Forms.ScrollOrientation) = x.WithAttribute(ViewAttributes.ScrollOrientationAttribKey, (value)) /// Adjusts the HorizontalScrollBarVisibility property in the visual element - member x.HorizontalScrollBarVisibility(value: Xamarin.Forms.ScrollBarVisibility) = x.WithAttribute(View._HorizontalScrollBarVisibilityAttribKey, (value)) + member x.HorizontalScrollBarVisibility(value: Xamarin.Forms.ScrollBarVisibility) = x.WithAttribute(ViewAttributes.HorizontalScrollBarVisibilityAttribKey, (value)) /// Adjusts the VerticalScrollBarVisibility property in the visual element - member x.VerticalScrollBarVisibility(value: Xamarin.Forms.ScrollBarVisibility) = x.WithAttribute(View._VerticalScrollBarVisibilityAttribKey, (value)) + member x.VerticalScrollBarVisibility(value: Xamarin.Forms.ScrollBarVisibility) = x.WithAttribute(ViewAttributes.VerticalScrollBarVisibilityAttribKey, (value)) /// Adjusts the CancelButtonColor property in the visual element - member x.CancelButtonColor(value: Xamarin.Forms.Color) = x.WithAttribute(View._CancelButtonColorAttribKey, (value)) + member x.CancelButtonColor(value: Xamarin.Forms.Color) = x.WithAttribute(ViewAttributes.CancelButtonColorAttribKey, (value)) /// Adjusts the FontFamily property in the visual element - member x.FontFamily(value: string) = x.WithAttribute(View._FontFamilyAttribKey, (value)) + member x.FontFamily(value: string) = x.WithAttribute(ViewAttributes.FontFamilyAttribKey, (value)) /// Adjusts the FontAttributes property in the visual element - member x.FontAttributes(value: Xamarin.Forms.FontAttributes) = x.WithAttribute(View._FontAttributesAttribKey, (value)) + member x.FontAttributes(value: Xamarin.Forms.FontAttributes) = x.WithAttribute(ViewAttributes.FontAttributesAttribKey, (value)) /// Adjusts the FontSize property in the visual element - member x.FontSize(value: obj) = x.WithAttribute(View._FontSizeAttribKey, makeFontSize(value)) + member x.FontSize(value: obj) = x.WithAttribute(ViewAttributes.FontSizeAttribKey, makeFontSize(value)) /// Adjusts the HorizontalTextAlignment property in the visual element - member x.HorizontalTextAlignment(value: Xamarin.Forms.TextAlignment) = x.WithAttribute(View._HorizontalTextAlignmentAttribKey, (value)) + member x.HorizontalTextAlignment(value: Xamarin.Forms.TextAlignment) = x.WithAttribute(ViewAttributes.HorizontalTextAlignmentAttribKey, (value)) /// Adjusts the Placeholder property in the visual element - member x.Placeholder(value: string) = x.WithAttribute(View._PlaceholderAttribKey, (value)) + member x.Placeholder(value: string) = x.WithAttribute(ViewAttributes.PlaceholderAttribKey, (value)) /// Adjusts the PlaceholderColor property in the visual element - member x.PlaceholderColor(value: Xamarin.Forms.Color) = x.WithAttribute(View._PlaceholderColorAttribKey, (value)) + member x.PlaceholderColor(value: Xamarin.Forms.Color) = x.WithAttribute(ViewAttributes.PlaceholderColorAttribKey, (value)) /// Adjusts the SearchBarCommand property in the visual element - member x.SearchBarCommand(value: string -> unit) = x.WithAttribute(View._SearchBarCommandAttribKey, (value)) + member x.SearchBarCommand(value: string -> unit) = x.WithAttribute(ViewAttributes.SearchBarCommandAttribKey, (value)) /// Adjusts the SearchBarCanExecute property in the visual element - member x.SearchBarCanExecute(value: bool) = x.WithAttribute(View._SearchBarCanExecuteAttribKey, (value)) + member x.SearchBarCanExecute(value: bool) = x.WithAttribute(ViewAttributes.SearchBarCanExecuteAttribKey, (value)) /// Adjusts the Text property in the visual element - member x.Text(value: string) = x.WithAttribute(View._TextAttribKey, (value)) + member x.Text(value: string) = x.WithAttribute(ViewAttributes.TextAttribKey, (value)) /// Adjusts the TextColor property in the visual element - member x.TextColor(value: Xamarin.Forms.Color) = x.WithAttribute(View._TextColorAttribKey, (value)) + member x.TextColor(value: Xamarin.Forms.Color) = x.WithAttribute(ViewAttributes.TextColorAttribKey, (value)) /// Adjusts the SearchBarTextChanged property in the visual element - member x.SearchBarTextChanged(value: Xamarin.Forms.TextChangedEventArgs -> unit) = x.WithAttribute(View._SearchBarTextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.SearchBarTextChanged(value: Xamarin.Forms.TextChangedEventArgs -> unit) = x.WithAttribute(ViewAttributes.SearchBarTextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the ButtonCommand property in the visual element - member x.ButtonCommand(value: unit -> unit) = x.WithAttribute(View._ButtonCommandAttribKey, (value)) + member x.ButtonCommand(value: unit -> unit) = x.WithAttribute(ViewAttributes.ButtonCommandAttribKey, (value)) /// Adjusts the ButtonCanExecute property in the visual element - member x.ButtonCanExecute(value: bool) = x.WithAttribute(View._ButtonCanExecuteAttribKey, (value)) + member x.ButtonCanExecute(value: bool) = x.WithAttribute(ViewAttributes.ButtonCanExecuteAttribKey, (value)) /// Adjusts the BorderColor property in the visual element - member x.BorderColor(value: Xamarin.Forms.Color) = x.WithAttribute(View._BorderColorAttribKey, (value)) + member x.BorderColor(value: Xamarin.Forms.Color) = x.WithAttribute(ViewAttributes.BorderColorAttribKey, (value)) /// Adjusts the BorderWidth property in the visual element - member x.BorderWidth(value: double) = x.WithAttribute(View._BorderWidthAttribKey, (value)) + member x.BorderWidth(value: double) = x.WithAttribute(ViewAttributes.BorderWidthAttribKey, (value)) /// Adjusts the CommandParameter property in the visual element - member x.CommandParameter(value: System.Object) = x.WithAttribute(View._CommandParameterAttribKey, (value)) + member x.CommandParameter(value: System.Object) = x.WithAttribute(ViewAttributes.CommandParameterAttribKey, (value)) /// Adjusts the ContentLayout property in the visual element - member x.ContentLayout(value: Xamarin.Forms.Button.ButtonContentLayout) = x.WithAttribute(View._ContentLayoutAttribKey, (value)) + member x.ContentLayout(value: Xamarin.Forms.Button.ButtonContentLayout) = x.WithAttribute(ViewAttributes.ContentLayoutAttribKey, (value)) /// Adjusts the ButtonCornerRadius property in the visual element - member x.ButtonCornerRadius(value: int) = x.WithAttribute(View._ButtonCornerRadiusAttribKey, (value)) + member x.ButtonCornerRadius(value: int) = x.WithAttribute(ViewAttributes.ButtonCornerRadiusAttribKey, (value)) /// Adjusts the ButtonImageSource property in the visual element - member x.ButtonImageSource(value: string) = x.WithAttribute(View._ButtonImageSourceAttribKey, (value)) + member x.ButtonImageSource(value: string) = x.WithAttribute(ViewAttributes.ButtonImageSourceAttribKey, (value)) /// Adjusts the MinimumMaximum property in the visual element - member x.MinimumMaximum(value: float * float) = x.WithAttribute(View._MinimumMaximumAttribKey, (value)) + member x.MinimumMaximum(value: float * float) = x.WithAttribute(ViewAttributes.MinimumMaximumAttribKey, (value)) /// Adjusts the Value property in the visual element - member x.Value(value: double) = x.WithAttribute(View._ValueAttribKey, (value)) + member x.Value(value: double) = x.WithAttribute(ViewAttributes.ValueAttribKey, (value)) /// Adjusts the ValueChanged property in the visual element - member x.ValueChanged(value: Xamarin.Forms.ValueChangedEventArgs -> unit) = x.WithAttribute(View._ValueChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.ValueChanged(value: Xamarin.Forms.ValueChangedEventArgs -> unit) = x.WithAttribute(ViewAttributes.ValueChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the Increment property in the visual element - member x.Increment(value: double) = x.WithAttribute(View._IncrementAttribKey, (value)) + member x.Increment(value: double) = x.WithAttribute(ViewAttributes.IncrementAttribKey, (value)) /// Adjusts the IsToggled property in the visual element - member x.IsToggled(value: bool) = x.WithAttribute(View._IsToggledAttribKey, (value)) + member x.IsToggled(value: bool) = x.WithAttribute(ViewAttributes.IsToggledAttribKey, (value)) /// Adjusts the Toggled property in the visual element - member x.Toggled(value: Xamarin.Forms.ToggledEventArgs -> unit) = x.WithAttribute(View._ToggledAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.Toggled(value: Xamarin.Forms.ToggledEventArgs -> unit) = x.WithAttribute(ViewAttributes.ToggledAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the OnColor property in the visual element - member x.OnColor(value: Xamarin.Forms.Color) = x.WithAttribute(View._OnColorAttribKey, (value)) + member x.OnColor(value: Xamarin.Forms.Color) = x.WithAttribute(ViewAttributes.OnColorAttribKey, (value)) /// Adjusts the Height property in the visual element - member x.Height(value: double) = x.WithAttribute(View._HeightAttribKey, (value)) + member x.Height(value: double) = x.WithAttribute(ViewAttributes.HeightAttribKey, (value)) /// Adjusts the On property in the visual element - member x.On(value: bool) = x.WithAttribute(View._OnAttribKey, (value)) + member x.On(value: bool) = x.WithAttribute(ViewAttributes.OnAttribKey, (value)) /// Adjusts the OnChanged property in the visual element - member x.OnChanged(value: Xamarin.Forms.ToggledEventArgs -> unit) = x.WithAttribute(View._OnChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.OnChanged(value: Xamarin.Forms.ToggledEventArgs -> unit) = x.WithAttribute(ViewAttributes.OnChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the Intent property in the visual element - member x.Intent(value: Xamarin.Forms.TableIntent) = x.WithAttribute(View._IntentAttribKey, (value)) + member x.Intent(value: Xamarin.Forms.TableIntent) = x.WithAttribute(ViewAttributes.IntentAttribKey, (value)) /// Adjusts the HasUnevenRows property in the visual element - member x.HasUnevenRows(value: bool) = x.WithAttribute(View._HasUnevenRowsAttribKey, (value)) + member x.HasUnevenRows(value: bool) = x.WithAttribute(ViewAttributes.HasUnevenRowsAttribKey, (value)) /// Adjusts the RowHeight property in the visual element - member x.RowHeight(value: int) = x.WithAttribute(View._RowHeightAttribKey, (value)) + member x.RowHeight(value: int) = x.WithAttribute(ViewAttributes.RowHeightAttribKey, (value)) /// Adjusts the TableRoot property in the visual element - member x.TableRoot(value: (string * ViewElement list) list) = x.WithAttribute(View._TableRootAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun (title, es) -> (title, Array.ofList es)))(value)) + member x.TableRoot(value: (string * ViewElement list) list) = x.WithAttribute(ViewAttributes.TableRootAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun (title, es) -> (title, Array.ofList es)))(value)) /// Adjusts the RowDefinitionHeight property in the visual element - member x.RowDefinitionHeight(value: obj) = x.WithAttribute(View._RowDefinitionHeightAttribKey, makeGridLength(value)) + member x.RowDefinitionHeight(value: obj) = x.WithAttribute(ViewAttributes.RowDefinitionHeightAttribKey, makeGridLength(value)) /// Adjusts the ColumnDefinitionWidth property in the visual element - member x.ColumnDefinitionWidth(value: obj) = x.WithAttribute(View._ColumnDefinitionWidthAttribKey, makeGridLength(value)) + member x.ColumnDefinitionWidth(value: obj) = x.WithAttribute(ViewAttributes.ColumnDefinitionWidthAttribKey, makeGridLength(value)) /// Adjusts the GridRowDefinitions property in the visual element - member x.GridRowDefinitions(value: obj list) = x.WithAttribute(View._GridRowDefinitionsAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun h -> View.RowDefinition(height=h)))(value)) + member x.GridRowDefinitions(value: obj list) = x.WithAttribute(ViewAttributes.GridRowDefinitionsAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun h -> ViewBuilders.ConstructRowDefinition(height=h)))(value)) /// Adjusts the GridColumnDefinitions property in the visual element - member x.GridColumnDefinitions(value: obj list) = x.WithAttribute(View._GridColumnDefinitionsAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun h -> View.ColumnDefinition(width=h)))(value)) + member x.GridColumnDefinitions(value: obj list) = x.WithAttribute(ViewAttributes.GridColumnDefinitionsAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun h -> ViewBuilders.ConstructColumnDefinition(width=h)))(value)) /// Adjusts the RowSpacing property in the visual element - member x.RowSpacing(value: double) = x.WithAttribute(View._RowSpacingAttribKey, (value)) + member x.RowSpacing(value: double) = x.WithAttribute(ViewAttributes.RowSpacingAttribKey, (value)) /// Adjusts the ColumnSpacing property in the visual element - member x.ColumnSpacing(value: double) = x.WithAttribute(View._ColumnSpacingAttribKey, (value)) + member x.ColumnSpacing(value: double) = x.WithAttribute(ViewAttributes.ColumnSpacingAttribKey, (value)) /// Adjusts the Children property in the visual element - member x.Children(value: ViewElement list) = x.WithAttribute(View._ChildrenAttribKey, Array.ofList(value)) + member x.Children(value: ViewElement list) = x.WithAttribute(ViewAttributes.ChildrenAttribKey, Array.ofList(value)) /// Adjusts the GridRow property in the visual element - member x.GridRow(value: int) = x.WithAttribute(View._GridRowAttribKey, (value)) + member x.GridRow(value: int) = x.WithAttribute(ViewAttributes.GridRowAttribKey, (value)) /// Adjusts the GridRowSpan property in the visual element - member x.GridRowSpan(value: int) = x.WithAttribute(View._GridRowSpanAttribKey, (value)) + member x.GridRowSpan(value: int) = x.WithAttribute(ViewAttributes.GridRowSpanAttribKey, (value)) /// Adjusts the GridColumn property in the visual element - member x.GridColumn(value: int) = x.WithAttribute(View._GridColumnAttribKey, (value)) + member x.GridColumn(value: int) = x.WithAttribute(ViewAttributes.GridColumnAttribKey, (value)) /// Adjusts the GridColumnSpan property in the visual element - member x.GridColumnSpan(value: int) = x.WithAttribute(View._GridColumnSpanAttribKey, (value)) + member x.GridColumnSpan(value: int) = x.WithAttribute(ViewAttributes.GridColumnSpanAttribKey, (value)) /// Adjusts the LayoutBounds property in the visual element - member x.LayoutBounds(value: Xamarin.Forms.Rectangle) = x.WithAttribute(View._LayoutBoundsAttribKey, (value)) + member x.LayoutBounds(value: Xamarin.Forms.Rectangle) = x.WithAttribute(ViewAttributes.LayoutBoundsAttribKey, (value)) /// Adjusts the LayoutFlags property in the visual element - member x.LayoutFlags(value: Xamarin.Forms.AbsoluteLayoutFlags) = x.WithAttribute(View._LayoutFlagsAttribKey, (value)) + member x.LayoutFlags(value: Xamarin.Forms.AbsoluteLayoutFlags) = x.WithAttribute(ViewAttributes.LayoutFlagsAttribKey, (value)) /// Adjusts the BoundsConstraint property in the visual element - member x.BoundsConstraint(value: Xamarin.Forms.BoundsConstraint) = x.WithAttribute(View._BoundsConstraintAttribKey, (value)) + member x.BoundsConstraint(value: Xamarin.Forms.BoundsConstraint) = x.WithAttribute(ViewAttributes.BoundsConstraintAttribKey, (value)) /// Adjusts the HeightConstraint property in the visual element - member x.HeightConstraint(value: Xamarin.Forms.Constraint) = x.WithAttribute(View._HeightConstraintAttribKey, (value)) + member x.HeightConstraint(value: Xamarin.Forms.Constraint) = x.WithAttribute(ViewAttributes.HeightConstraintAttribKey, (value)) /// Adjusts the WidthConstraint property in the visual element - member x.WidthConstraint(value: Xamarin.Forms.Constraint) = x.WithAttribute(View._WidthConstraintAttribKey, (value)) + member x.WidthConstraint(value: Xamarin.Forms.Constraint) = x.WithAttribute(ViewAttributes.WidthConstraintAttribKey, (value)) /// Adjusts the XConstraint property in the visual element - member x.XConstraint(value: Xamarin.Forms.Constraint) = x.WithAttribute(View._XConstraintAttribKey, (value)) + member x.XConstraint(value: Xamarin.Forms.Constraint) = x.WithAttribute(ViewAttributes.XConstraintAttribKey, (value)) /// Adjusts the YConstraint property in the visual element - member x.YConstraint(value: Xamarin.Forms.Constraint) = x.WithAttribute(View._YConstraintAttribKey, (value)) + member x.YConstraint(value: Xamarin.Forms.Constraint) = x.WithAttribute(ViewAttributes.YConstraintAttribKey, (value)) /// Adjusts the AlignContent property in the visual element - member x.AlignContent(value: Xamarin.Forms.FlexAlignContent) = x.WithAttribute(View._AlignContentAttribKey, (value)) + member x.AlignContent(value: Xamarin.Forms.FlexAlignContent) = x.WithAttribute(ViewAttributes.AlignContentAttribKey, (value)) /// Adjusts the AlignItems property in the visual element - member x.AlignItems(value: Xamarin.Forms.FlexAlignItems) = x.WithAttribute(View._AlignItemsAttribKey, (value)) + member x.AlignItems(value: Xamarin.Forms.FlexAlignItems) = x.WithAttribute(ViewAttributes.AlignItemsAttribKey, (value)) /// Adjusts the FlexLayoutDirection property in the visual element - member x.FlexLayoutDirection(value: Xamarin.Forms.FlexDirection) = x.WithAttribute(View._FlexLayoutDirectionAttribKey, (value)) + member x.FlexLayoutDirection(value: Xamarin.Forms.FlexDirection) = x.WithAttribute(ViewAttributes.FlexLayoutDirectionAttribKey, (value)) /// Adjusts the Position property in the visual element - member x.Position(value: Xamarin.Forms.FlexPosition) = x.WithAttribute(View._PositionAttribKey, (value)) + member x.Position(value: Xamarin.Forms.FlexPosition) = x.WithAttribute(ViewAttributes.PositionAttribKey, (value)) /// Adjusts the Wrap property in the visual element - member x.Wrap(value: Xamarin.Forms.FlexWrap) = x.WithAttribute(View._WrapAttribKey, (value)) + member x.Wrap(value: Xamarin.Forms.FlexWrap) = x.WithAttribute(ViewAttributes.WrapAttribKey, (value)) /// Adjusts the JustifyContent property in the visual element - member x.JustifyContent(value: Xamarin.Forms.FlexJustify) = x.WithAttribute(View._JustifyContentAttribKey, (value)) + member x.JustifyContent(value: Xamarin.Forms.FlexJustify) = x.WithAttribute(ViewAttributes.JustifyContentAttribKey, (value)) /// Adjusts the FlexAlignSelf property in the visual element - member x.FlexAlignSelf(value: Xamarin.Forms.FlexAlignSelf) = x.WithAttribute(View._FlexAlignSelfAttribKey, (value)) + member x.FlexAlignSelf(value: Xamarin.Forms.FlexAlignSelf) = x.WithAttribute(ViewAttributes.FlexAlignSelfAttribKey, (value)) /// Adjusts the FlexOrder property in the visual element - member x.FlexOrder(value: int) = x.WithAttribute(View._FlexOrderAttribKey, (value)) + member x.FlexOrder(value: int) = x.WithAttribute(ViewAttributes.FlexOrderAttribKey, (value)) /// Adjusts the FlexBasis property in the visual element - member x.FlexBasis(value: Xamarin.Forms.FlexBasis) = x.WithAttribute(View._FlexBasisAttribKey, (value)) + member x.FlexBasis(value: Xamarin.Forms.FlexBasis) = x.WithAttribute(ViewAttributes.FlexBasisAttribKey, (value)) /// Adjusts the FlexGrow property in the visual element - member x.FlexGrow(value: double) = x.WithAttribute(View._FlexGrowAttribKey, single(value)) + member x.FlexGrow(value: double) = x.WithAttribute(ViewAttributes.FlexGrowAttribKey, single(value)) /// Adjusts the FlexShrink property in the visual element - member x.FlexShrink(value: double) = x.WithAttribute(View._FlexShrinkAttribKey, single(value)) + member x.FlexShrink(value: double) = x.WithAttribute(ViewAttributes.FlexShrinkAttribKey, single(value)) /// Adjusts the Date property in the visual element - member x.Date(value: System.DateTime) = x.WithAttribute(View._DateAttribKey, (value)) + member x.Date(value: System.DateTime) = x.WithAttribute(ViewAttributes.DateAttribKey, (value)) /// Adjusts the Format property in the visual element - member x.Format(value: string) = x.WithAttribute(View._FormatAttribKey, (value)) + member x.Format(value: string) = x.WithAttribute(ViewAttributes.FormatAttribKey, (value)) /// Adjusts the MinimumDate property in the visual element - member x.MinimumDate(value: System.DateTime) = x.WithAttribute(View._MinimumDateAttribKey, (value)) + member x.MinimumDate(value: System.DateTime) = x.WithAttribute(ViewAttributes.MinimumDateAttribKey, (value)) /// Adjusts the MaximumDate property in the visual element - member x.MaximumDate(value: System.DateTime) = x.WithAttribute(View._MaximumDateAttribKey, (value)) + member x.MaximumDate(value: System.DateTime) = x.WithAttribute(ViewAttributes.MaximumDateAttribKey, (value)) /// Adjusts the DateSelected property in the visual element - member x.DateSelected(value: Xamarin.Forms.DateChangedEventArgs -> unit) = x.WithAttribute(View._DateSelectedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.DateSelected(value: Xamarin.Forms.DateChangedEventArgs -> unit) = x.WithAttribute(ViewAttributes.DateSelectedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the PickerItemsSource property in the visual element - member x.PickerItemsSource(value: seq<'T>) = x.WithAttribute(View._PickerItemsSourceAttribKey, seqToIListUntyped(value)) + member x.PickerItemsSource(value: seq<'T>) = x.WithAttribute(ViewAttributes.PickerItemsSourceAttribKey, seqToIListUntyped(value)) /// Adjusts the SelectedIndex property in the visual element - member x.SelectedIndex(value: int) = x.WithAttribute(View._SelectedIndexAttribKey, (value)) + member x.SelectedIndex(value: int) = x.WithAttribute(ViewAttributes.SelectedIndexAttribKey, (value)) /// Adjusts the Title property in the visual element - member x.Title(value: string) = x.WithAttribute(View._TitleAttribKey, (value)) + member x.Title(value: string) = x.WithAttribute(ViewAttributes.TitleAttribKey, (value)) /// Adjusts the SelectedIndexChanged property in the visual element - member x.SelectedIndexChanged(value: (int * 'T option) -> unit) = x.WithAttribute(View._SelectedIndexChangedAttribKey, (fun f -> System.EventHandler(fun sender args -> let picker = (sender :?> Xamarin.Forms.Picker) in f (picker.SelectedIndex, (picker.SelectedItem |> Option.ofObj |> Option.map unbox<'T>))))(value)) + member x.SelectedIndexChanged(value: (int * 'T option) -> unit) = x.WithAttribute(ViewAttributes.SelectedIndexChangedAttribKey, (fun f -> System.EventHandler(fun sender args -> let picker = (sender :?> Xamarin.Forms.Picker) in f (picker.SelectedIndex, (picker.SelectedItem |> Option.ofObj |> Option.map unbox<'T>))))(value)) /// Adjusts the FrameCornerRadius property in the visual element - member x.FrameCornerRadius(value: double) = x.WithAttribute(View._FrameCornerRadiusAttribKey, single(value)) + member x.FrameCornerRadius(value: double) = x.WithAttribute(ViewAttributes.FrameCornerRadiusAttribKey, single(value)) /// Adjusts the HasShadow property in the visual element - member x.HasShadow(value: bool) = x.WithAttribute(View._HasShadowAttribKey, (value)) + member x.HasShadow(value: bool) = x.WithAttribute(ViewAttributes.HasShadowAttribKey, (value)) /// Adjusts the ImageSource property in the visual element - member x.ImageSource(value: obj) = x.WithAttribute(View._ImageSourceAttribKey, (value)) + member x.ImageSource(value: obj) = x.WithAttribute(ViewAttributes.ImageSourceAttribKey, (value)) /// Adjusts the Aspect property in the visual element - member x.Aspect(value: Xamarin.Forms.Aspect) = x.WithAttribute(View._AspectAttribKey, (value)) + member x.Aspect(value: Xamarin.Forms.Aspect) = x.WithAttribute(ViewAttributes.AspectAttribKey, (value)) /// Adjusts the IsOpaque property in the visual element - member x.IsOpaque(value: bool) = x.WithAttribute(View._IsOpaqueAttribKey, (value)) + member x.IsOpaque(value: bool) = x.WithAttribute(ViewAttributes.IsOpaqueAttribKey, (value)) /// Adjusts the ImageButtonCommand property in the visual element - member x.ImageButtonCommand(value: unit -> unit) = x.WithAttribute(View._ImageButtonCommandAttribKey, (value)) + member x.ImageButtonCommand(value: unit -> unit) = x.WithAttribute(ViewAttributes.ImageButtonCommandAttribKey, (value)) /// Adjusts the ImageButtonCornerRadius property in the visual element - member x.ImageButtonCornerRadius(value: int) = x.WithAttribute(View._ImageButtonCornerRadiusAttribKey, (value)) + member x.ImageButtonCornerRadius(value: int) = x.WithAttribute(ViewAttributes.ImageButtonCornerRadiusAttribKey, (value)) /// Adjusts the Clicked property in the visual element - member x.Clicked(value: System.EventArgs -> unit) = x.WithAttribute(View._ClickedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.Clicked(value: System.EventArgs -> unit) = x.WithAttribute(ViewAttributes.ClickedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the Pressed property in the visual element - member x.Pressed(value: System.EventArgs -> unit) = x.WithAttribute(View._PressedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.Pressed(value: System.EventArgs -> unit) = x.WithAttribute(ViewAttributes.PressedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the Released property in the visual element - member x.Released(value: System.EventArgs -> unit) = x.WithAttribute(View._ReleasedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.Released(value: System.EventArgs -> unit) = x.WithAttribute(ViewAttributes.ReleasedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the Keyboard property in the visual element - member x.Keyboard(value: Xamarin.Forms.Keyboard) = x.WithAttribute(View._KeyboardAttribKey, (value)) + member x.Keyboard(value: Xamarin.Forms.Keyboard) = x.WithAttribute(ViewAttributes.KeyboardAttribKey, (value)) /// Adjusts the EditorCompleted property in the visual element - member x.EditorCompleted(value: string -> unit) = x.WithAttribute(View._EditorCompletedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.Editor).Text))(value)) + member x.EditorCompleted(value: string -> unit) = x.WithAttribute(ViewAttributes.EditorCompletedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.Editor).Text))(value)) /// Adjusts the TextChanged property in the visual element - member x.TextChanged(value: Xamarin.Forms.TextChangedEventArgs -> unit) = x.WithAttribute(View._TextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.TextChanged(value: Xamarin.Forms.TextChangedEventArgs -> unit) = x.WithAttribute(ViewAttributes.TextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the AutoSize property in the visual element - member x.AutoSize(value: Xamarin.Forms.EditorAutoSizeOption) = x.WithAttribute(View._AutoSizeAttribKey, (value)) + member x.AutoSize(value: Xamarin.Forms.EditorAutoSizeOption) = x.WithAttribute(ViewAttributes.AutoSizeAttribKey, (value)) /// Adjusts the IsPassword property in the visual element - member x.IsPassword(value: bool) = x.WithAttribute(View._IsPasswordAttribKey, (value)) + member x.IsPassword(value: bool) = x.WithAttribute(ViewAttributes.IsPasswordAttribKey, (value)) /// Adjusts the EntryCompleted property in the visual element - member x.EntryCompleted(value: string -> unit) = x.WithAttribute(View._EntryCompletedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.Entry).Text))(value)) + member x.EntryCompleted(value: string -> unit) = x.WithAttribute(ViewAttributes.EntryCompletedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.Entry).Text))(value)) /// Adjusts the IsTextPredictionEnabled property in the visual element - member x.IsTextPredictionEnabled(value: bool) = x.WithAttribute(View._IsTextPredictionEnabledAttribKey, (value)) + member x.IsTextPredictionEnabled(value: bool) = x.WithAttribute(ViewAttributes.IsTextPredictionEnabledAttribKey, (value)) /// Adjusts the ReturnType property in the visual element - member x.ReturnType(value: Xamarin.Forms.ReturnType) = x.WithAttribute(View._ReturnTypeAttribKey, (value)) + member x.ReturnType(value: Xamarin.Forms.ReturnType) = x.WithAttribute(ViewAttributes.ReturnTypeAttribKey, (value)) /// Adjusts the ReturnCommand property in the visual element - member x.ReturnCommand(value: unit -> unit) = x.WithAttribute(View._ReturnCommandAttribKey, makeCommand(value)) + member x.ReturnCommand(value: unit -> unit) = x.WithAttribute(ViewAttributes.ReturnCommandAttribKey, makeCommand(value)) /// Adjusts the CursorPosition property in the visual element - member x.CursorPosition(value: int) = x.WithAttribute(View._CursorPositionAttribKey, (value)) + member x.CursorPosition(value: int) = x.WithAttribute(ViewAttributes.CursorPositionAttribKey, (value)) /// Adjusts the SelectionLength property in the visual element - member x.SelectionLength(value: int) = x.WithAttribute(View._SelectionLengthAttribKey, (value)) + member x.SelectionLength(value: int) = x.WithAttribute(ViewAttributes.SelectionLengthAttribKey, (value)) /// Adjusts the Label property in the visual element - member x.Label(value: string) = x.WithAttribute(View._LabelAttribKey, (value)) + member x.Label(value: string) = x.WithAttribute(ViewAttributes.LabelAttribKey, (value)) /// Adjusts the EntryCellTextChanged property in the visual element - member x.EntryCellTextChanged(value: Xamarin.Forms.TextChangedEventArgs -> unit) = x.WithAttribute(View._EntryCellTextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.EntryCellTextChanged(value: Xamarin.Forms.TextChangedEventArgs -> unit) = x.WithAttribute(ViewAttributes.EntryCellTextChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the VerticalTextAlignment property in the visual element - member x.VerticalTextAlignment(value: Xamarin.Forms.TextAlignment) = x.WithAttribute(View._VerticalTextAlignmentAttribKey, (value)) + member x.VerticalTextAlignment(value: Xamarin.Forms.TextAlignment) = x.WithAttribute(ViewAttributes.VerticalTextAlignmentAttribKey, (value)) /// Adjusts the FormattedText property in the visual element - member x.FormattedText(value: ViewElement) = x.WithAttribute(View._FormattedTextAttribKey, (value)) + member x.FormattedText(value: ViewElement) = x.WithAttribute(ViewAttributes.FormattedTextAttribKey, (value)) /// Adjusts the LineBreakMode property in the visual element - member x.LineBreakMode(value: Xamarin.Forms.LineBreakMode) = x.WithAttribute(View._LineBreakModeAttribKey, (value)) + member x.LineBreakMode(value: Xamarin.Forms.LineBreakMode) = x.WithAttribute(ViewAttributes.LineBreakModeAttribKey, (value)) /// Adjusts the LineHeight property in the visual element - member x.LineHeight(value: double) = x.WithAttribute(View._LineHeightAttribKey, (value)) + member x.LineHeight(value: double) = x.WithAttribute(ViewAttributes.LineHeightAttribKey, (value)) /// Adjusts the MaxLines property in the visual element - member x.MaxLines(value: int) = x.WithAttribute(View._MaxLinesAttribKey, (value)) + member x.MaxLines(value: int) = x.WithAttribute(ViewAttributes.MaxLinesAttribKey, (value)) /// Adjusts the TextDecorations property in the visual element - member x.TextDecorations(value: Xamarin.Forms.TextDecorations) = x.WithAttribute(View._TextDecorationsAttribKey, (value)) + member x.TextDecorations(value: Xamarin.Forms.TextDecorations) = x.WithAttribute(ViewAttributes.TextDecorationsAttribKey, (value)) /// Adjusts the StackOrientation property in the visual element - member x.StackOrientation(value: Xamarin.Forms.StackOrientation) = x.WithAttribute(View._StackOrientationAttribKey, (value)) + member x.StackOrientation(value: Xamarin.Forms.StackOrientation) = x.WithAttribute(ViewAttributes.StackOrientationAttribKey, (value)) /// Adjusts the Spacing property in the visual element - member x.Spacing(value: double) = x.WithAttribute(View._SpacingAttribKey, (value)) + member x.Spacing(value: double) = x.WithAttribute(ViewAttributes.SpacingAttribKey, (value)) /// Adjusts the ForegroundColor property in the visual element - member x.ForegroundColor(value: Xamarin.Forms.Color) = x.WithAttribute(View._ForegroundColorAttribKey, (value)) + member x.ForegroundColor(value: Xamarin.Forms.Color) = x.WithAttribute(ViewAttributes.ForegroundColorAttribKey, (value)) /// Adjusts the PropertyChanged property in the visual element - member x.PropertyChanged(value: System.ComponentModel.PropertyChangedEventArgs -> unit) = x.WithAttribute(View._PropertyChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.PropertyChanged(value: System.ComponentModel.PropertyChangedEventArgs -> unit) = x.WithAttribute(ViewAttributes.PropertyChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the Spans property in the visual element - member x.Spans(value: ViewElement[]) = x.WithAttribute(View._SpansAttribKey, (value)) + member x.Spans(value: ViewElement[]) = x.WithAttribute(ViewAttributes.SpansAttribKey, (value)) /// Adjusts the Time property in the visual element - member x.Time(value: System.TimeSpan) = x.WithAttribute(View._TimeAttribKey, (value)) + member x.Time(value: System.TimeSpan) = x.WithAttribute(ViewAttributes.TimeAttribKey, (value)) /// Adjusts the WebSource property in the visual element - member x.WebSource(value: Xamarin.Forms.WebViewSource) = x.WithAttribute(View._WebSourceAttribKey, (value)) + member x.WebSource(value: Xamarin.Forms.WebViewSource) = x.WithAttribute(ViewAttributes.WebSourceAttribKey, (value)) /// Adjusts the Reload property in the visual element - member x.Reload(value: bool) = x.WithAttribute(View._ReloadAttribKey, (value)) + member x.Reload(value: bool) = x.WithAttribute(ViewAttributes.ReloadAttribKey, (value)) /// Adjusts the Navigated property in the visual element - member x.Navigated(value: Xamarin.Forms.WebNavigatedEventArgs -> unit) = x.WithAttribute(View._NavigatedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.Navigated(value: Xamarin.Forms.WebNavigatedEventArgs -> unit) = x.WithAttribute(ViewAttributes.NavigatedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the Navigating property in the visual element - member x.Navigating(value: Xamarin.Forms.WebNavigatingEventArgs -> unit) = x.WithAttribute(View._NavigatingAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.Navigating(value: Xamarin.Forms.WebNavigatingEventArgs -> unit) = x.WithAttribute(ViewAttributes.NavigatingAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the ReloadRequested property in the visual element - member x.ReloadRequested(value: System.EventArgs -> unit) = x.WithAttribute(View._ReloadRequestedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.ReloadRequested(value: System.EventArgs -> unit) = x.WithAttribute(ViewAttributes.ReloadRequestedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) /// Adjusts the BackgroundImage property in the visual element - member x.BackgroundImage(value: string) = x.WithAttribute(View._BackgroundImageAttribKey, (value)) + member x.BackgroundImage(value: string) = x.WithAttribute(ViewAttributes.BackgroundImageAttribKey, (value)) /// Adjusts the Icon property in the visual element - member x.Icon(value: string) = x.WithAttribute(View._IconAttribKey, (value)) + member x.Icon(value: string) = x.WithAttribute(ViewAttributes.IconAttribKey, (value)) /// Adjusts the IsBusy property in the visual element - member x.IsBusy(value: bool) = x.WithAttribute(View._IsBusyAttribKey, (value)) + member x.IsBusy(value: bool) = x.WithAttribute(ViewAttributes.IsBusyAttribKey, (value)) /// Adjusts the ToolbarItems property in the visual element - member x.ToolbarItems(value: ViewElement list) = x.WithAttribute(View._ToolbarItemsAttribKey, Array.ofList(value)) + member x.ToolbarItems(value: ViewElement list) = x.WithAttribute(ViewAttributes.ToolbarItemsAttribKey, Array.ofList(value)) /// Adjusts the UseSafeArea property in the visual element - member x.UseSafeArea(value: bool) = x.WithAttribute(View._UseSafeAreaAttribKey, (value)) + member x.UseSafeArea(value: bool) = x.WithAttribute(ViewAttributes.UseSafeAreaAttribKey, (value)) /// Adjusts the Page_Appearing property in the visual element - member x.Page_Appearing(value: unit -> unit) = x.WithAttribute(View._Page_AppearingAttribKey, (fun f -> System.EventHandler(fun _sender _args -> f ()))(value)) + member x.Page_Appearing(value: unit -> unit) = x.WithAttribute(ViewAttributes.Page_AppearingAttribKey, (fun f -> System.EventHandler(fun _sender _args -> f ()))(value)) /// Adjusts the Page_Disappearing property in the visual element - member x.Page_Disappearing(value: unit -> unit) = x.WithAttribute(View._Page_DisappearingAttribKey, (fun f -> System.EventHandler(fun _sender _args -> f ()))(value)) + member x.Page_Disappearing(value: unit -> unit) = x.WithAttribute(ViewAttributes.Page_DisappearingAttribKey, (fun f -> System.EventHandler(fun _sender _args -> f ()))(value)) /// Adjusts the Page_LayoutChanged property in the visual element - member x.Page_LayoutChanged(value: unit -> unit) = x.WithAttribute(View._Page_LayoutChangedAttribKey, (fun f -> System.EventHandler(fun _sender _args -> f ()))(value)) + member x.Page_LayoutChanged(value: unit -> unit) = x.WithAttribute(ViewAttributes.Page_LayoutChangedAttribKey, (fun f -> System.EventHandler(fun _sender _args -> f ()))(value)) /// Adjusts the CarouselPage_CurrentPage property in the visual element - member x.CarouselPage_CurrentPage(value: int) = x.WithAttribute(View._CarouselPage_CurrentPageAttribKey, (value)) + member x.CarouselPage_CurrentPage(value: int) = x.WithAttribute(ViewAttributes.CarouselPage_CurrentPageAttribKey, (value)) /// Adjusts the CarouselPage_CurrentPageChanged property in the visual element - member x.CarouselPage_CurrentPageChanged(value: int option -> unit) = x.WithAttribute(View._CarouselPage_CurrentPageChangedAttribKey, makeCurrentPageChanged(value)) + member x.CarouselPage_CurrentPageChanged(value: int option -> unit) = x.WithAttribute(ViewAttributes.CarouselPage_CurrentPageChangedAttribKey, makeCurrentPageChanged(value)) /// Adjusts the Pages property in the visual element - member x.Pages(value: ViewElement list) = x.WithAttribute(View._PagesAttribKey, Array.ofList(value)) + member x.Pages(value: ViewElement list) = x.WithAttribute(ViewAttributes.PagesAttribKey, Array.ofList(value)) /// Adjusts the BackButtonTitle property in the visual element - member x.BackButtonTitle(value: string) = x.WithAttribute(View._BackButtonTitleAttribKey, (value)) + member x.BackButtonTitle(value: string) = x.WithAttribute(ViewAttributes.BackButtonTitleAttribKey, (value)) /// Adjusts the HasBackButton property in the visual element - member x.HasBackButton(value: bool) = x.WithAttribute(View._HasBackButtonAttribKey, (value)) + member x.HasBackButton(value: bool) = x.WithAttribute(ViewAttributes.HasBackButtonAttribKey, (value)) /// Adjusts the HasNavigationBar property in the visual element - member x.HasNavigationBar(value: bool) = x.WithAttribute(View._HasNavigationBarAttribKey, (value)) + member x.HasNavigationBar(value: bool) = x.WithAttribute(ViewAttributes.HasNavigationBarAttribKey, (value)) /// Adjusts the TitleIcon property in the visual element - member x.TitleIcon(value: string) = x.WithAttribute(View._TitleIconAttribKey, (value)) + member x.TitleIcon(value: string) = x.WithAttribute(ViewAttributes.TitleIconAttribKey, (value)) /// Adjusts the TitleView property in the visual element - member x.TitleView(value: ViewElement) = x.WithAttribute(View._TitleViewAttribKey, (value)) + member x.TitleView(value: ViewElement) = x.WithAttribute(ViewAttributes.TitleViewAttribKey, (value)) /// Adjusts the BarBackgroundColor property in the visual element - member x.BarBackgroundColor(value: Xamarin.Forms.Color) = x.WithAttribute(View._BarBackgroundColorAttribKey, (value)) + member x.BarBackgroundColor(value: Xamarin.Forms.Color) = x.WithAttribute(ViewAttributes.BarBackgroundColorAttribKey, (value)) /// Adjusts the BarTextColor property in the visual element - member x.BarTextColor(value: Xamarin.Forms.Color) = x.WithAttribute(View._BarTextColorAttribKey, (value)) + member x.BarTextColor(value: Xamarin.Forms.Color) = x.WithAttribute(ViewAttributes.BarTextColorAttribKey, (value)) /// Adjusts the Popped property in the visual element - member x.Popped(value: Xamarin.Forms.NavigationEventArgs -> unit) = x.WithAttribute(View._PoppedAttribKey, (fun f -> System.EventHandler(fun sender args -> f args))(value)) + member x.Popped(value: Xamarin.Forms.NavigationEventArgs -> unit) = x.WithAttribute(ViewAttributes.PoppedAttribKey, (fun f -> System.EventHandler(fun sender args -> f args))(value)) /// Adjusts the PoppedToRoot property in the visual element - member x.PoppedToRoot(value: Xamarin.Forms.NavigationEventArgs -> unit) = x.WithAttribute(View._PoppedToRootAttribKey, (fun f -> System.EventHandler(fun sender args -> f args))(value)) + member x.PoppedToRoot(value: Xamarin.Forms.NavigationEventArgs -> unit) = x.WithAttribute(ViewAttributes.PoppedToRootAttribKey, (fun f -> System.EventHandler(fun sender args -> f args))(value)) /// Adjusts the Pushed property in the visual element - member x.Pushed(value: Xamarin.Forms.NavigationEventArgs -> unit) = x.WithAttribute(View._PushedAttribKey, (fun f -> System.EventHandler(fun sender args -> f args))(value)) + member x.Pushed(value: Xamarin.Forms.NavigationEventArgs -> unit) = x.WithAttribute(ViewAttributes.PushedAttribKey, (fun f -> System.EventHandler(fun sender args -> f args))(value)) /// Adjusts the TabbedPage_CurrentPage property in the visual element - member x.TabbedPage_CurrentPage(value: int) = x.WithAttribute(View._TabbedPage_CurrentPageAttribKey, (value)) + member x.TabbedPage_CurrentPage(value: int) = x.WithAttribute(ViewAttributes.TabbedPage_CurrentPageAttribKey, (value)) /// Adjusts the TabbedPage_CurrentPageChanged property in the visual element - member x.TabbedPage_CurrentPageChanged(value: int option -> unit) = x.WithAttribute(View._TabbedPage_CurrentPageChangedAttribKey, makeCurrentPageChanged(value)) + member x.TabbedPage_CurrentPageChanged(value: int option -> unit) = x.WithAttribute(ViewAttributes.TabbedPage_CurrentPageChangedAttribKey, makeCurrentPageChanged(value)) /// Adjusts the OnSizeAllocatedCallback property in the visual element - member x.OnSizeAllocatedCallback(value: (double * double) -> unit) = x.WithAttribute(View._OnSizeAllocatedCallbackAttribKey, (fun f -> FSharp.Control.Handler<_>(fun _sender args -> f args))(value)) + member x.OnSizeAllocatedCallback(value: (double * double) -> unit) = x.WithAttribute(ViewAttributes.OnSizeAllocatedCallbackAttribKey, (fun f -> FSharp.Control.Handler<_>(fun _sender args -> f args))(value)) /// Adjusts the Master property in the visual element - member x.Master(value: ViewElement) = x.WithAttribute(View._MasterAttribKey, (value)) + member x.Master(value: ViewElement) = x.WithAttribute(ViewAttributes.MasterAttribKey, (value)) /// Adjusts the Detail property in the visual element - member x.Detail(value: ViewElement) = x.WithAttribute(View._DetailAttribKey, (value)) + member x.Detail(value: ViewElement) = x.WithAttribute(ViewAttributes.DetailAttribKey, (value)) /// Adjusts the IsGestureEnabled property in the visual element - member x.IsGestureEnabled(value: bool) = x.WithAttribute(View._IsGestureEnabledAttribKey, (value)) + member x.IsGestureEnabled(value: bool) = x.WithAttribute(ViewAttributes.IsGestureEnabledAttribKey, (value)) /// Adjusts the IsPresented property in the visual element - member x.IsPresented(value: bool) = x.WithAttribute(View._IsPresentedAttribKey, (value)) + member x.IsPresented(value: bool) = x.WithAttribute(ViewAttributes.IsPresentedAttribKey, (value)) /// Adjusts the MasterBehavior property in the visual element - member x.MasterBehavior(value: Xamarin.Forms.MasterBehavior) = x.WithAttribute(View._MasterBehaviorAttribKey, (value)) + member x.MasterBehavior(value: Xamarin.Forms.MasterBehavior) = x.WithAttribute(ViewAttributes.MasterBehaviorAttribKey, (value)) /// Adjusts the IsPresentedChanged property in the visual element - member x.IsPresentedChanged(value: bool -> unit) = x.WithAttribute(View._IsPresentedChangedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.MasterDetailPage).IsPresented))(value)) + member x.IsPresentedChanged(value: bool -> unit) = x.WithAttribute(ViewAttributes.IsPresentedChangedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (sender :?> Xamarin.Forms.MasterDetailPage).IsPresented))(value)) /// Adjusts the Accelerator property in the visual element - member x.Accelerator(value: string) = x.WithAttribute(View._AcceleratorAttribKey, (value)) + member x.Accelerator(value: string) = x.WithAttribute(ViewAttributes.AcceleratorAttribKey, (value)) /// Adjusts the TextDetail property in the visual element - member x.TextDetail(value: string) = x.WithAttribute(View._TextDetailAttribKey, (value)) + member x.TextDetail(value: string) = x.WithAttribute(ViewAttributes.TextDetailAttribKey, (value)) /// Adjusts the TextDetailColor property in the visual element - member x.TextDetailColor(value: Xamarin.Forms.Color) = x.WithAttribute(View._TextDetailColorAttribKey, (value)) + member x.TextDetailColor(value: Xamarin.Forms.Color) = x.WithAttribute(ViewAttributes.TextDetailColorAttribKey, (value)) /// Adjusts the TextCellCommand property in the visual element - member x.TextCellCommand(value: unit -> unit) = x.WithAttribute(View._TextCellCommandAttribKey, (value)) + member x.TextCellCommand(value: unit -> unit) = x.WithAttribute(ViewAttributes.TextCellCommandAttribKey, (value)) /// Adjusts the TextCellCanExecute property in the visual element - member x.TextCellCanExecute(value: bool) = x.WithAttribute(View._TextCellCanExecuteAttribKey, (value)) + member x.TextCellCanExecute(value: bool) = x.WithAttribute(ViewAttributes.TextCellCanExecuteAttribKey, (value)) /// Adjusts the Order property in the visual element - member x.Order(value: Xamarin.Forms.ToolbarItemOrder) = x.WithAttribute(View._OrderAttribKey, (value)) + member x.Order(value: Xamarin.Forms.ToolbarItemOrder) = x.WithAttribute(ViewAttributes.OrderAttribKey, (value)) /// Adjusts the Priority property in the visual element - member x.Priority(value: int) = x.WithAttribute(View._PriorityAttribKey, (value)) + member x.Priority(value: int) = x.WithAttribute(ViewAttributes.PriorityAttribKey, (value)) /// Adjusts the View property in the visual element - member x.View(value: ViewElement) = x.WithAttribute(View._ViewAttribKey, (value)) + member x.View(value: ViewElement) = x.WithAttribute(ViewAttributes.ViewAttribKey, (value)) /// Adjusts the ListViewItems property in the visual element - member x.ListViewItems(value: seq) = x.WithAttribute(View._ListViewItemsAttribKey, (value)) + member x.ListViewItems(value: seq) = x.WithAttribute(ViewAttributes.ListViewItemsAttribKey, (value)) /// Adjusts the Footer property in the visual element - member x.Footer(value: System.Object) = x.WithAttribute(View._FooterAttribKey, (value)) + member x.Footer(value: System.Object) = x.WithAttribute(ViewAttributes.FooterAttribKey, (value)) /// Adjusts the Header property in the visual element - member x.Header(value: System.Object) = x.WithAttribute(View._HeaderAttribKey, (value)) + member x.Header(value: System.Object) = x.WithAttribute(ViewAttributes.HeaderAttribKey, (value)) /// Adjusts the HeaderTemplate property in the visual element - member x.HeaderTemplate(value: Xamarin.Forms.DataTemplate) = x.WithAttribute(View._HeaderTemplateAttribKey, (value)) + member x.HeaderTemplate(value: Xamarin.Forms.DataTemplate) = x.WithAttribute(ViewAttributes.HeaderTemplateAttribKey, (value)) /// Adjusts the IsGroupingEnabled property in the visual element - member x.IsGroupingEnabled(value: bool) = x.WithAttribute(View._IsGroupingEnabledAttribKey, (value)) + member x.IsGroupingEnabled(value: bool) = x.WithAttribute(ViewAttributes.IsGroupingEnabledAttribKey, (value)) /// Adjusts the IsPullToRefreshEnabled property in the visual element - member x.IsPullToRefreshEnabled(value: bool) = x.WithAttribute(View._IsPullToRefreshEnabledAttribKey, (value)) + member x.IsPullToRefreshEnabled(value: bool) = x.WithAttribute(ViewAttributes.IsPullToRefreshEnabledAttribKey, (value)) /// Adjusts the IsRefreshing property in the visual element - member x.IsRefreshing(value: bool) = x.WithAttribute(View._IsRefreshingAttribKey, (value)) + member x.IsRefreshing(value: bool) = x.WithAttribute(ViewAttributes.IsRefreshingAttribKey, (value)) /// Adjusts the RefreshCommand property in the visual element - member x.RefreshCommand(value: unit -> unit) = x.WithAttribute(View._RefreshCommandAttribKey, makeCommand(value)) + member x.RefreshCommand(value: unit -> unit) = x.WithAttribute(ViewAttributes.RefreshCommandAttribKey, makeCommand(value)) /// Adjusts the ListView_SelectedItem property in the visual element - member x.ListView_SelectedItem(value: int option) = x.WithAttribute(View._ListView_SelectedItemAttribKey, (value)) + member x.ListView_SelectedItem(value: int option) = x.WithAttribute(ViewAttributes.ListView_SelectedItemAttribKey, (value)) /// Adjusts the ListView_SeparatorVisibility property in the visual element - member x.ListView_SeparatorVisibility(value: Xamarin.Forms.SeparatorVisibility) = x.WithAttribute(View._ListView_SeparatorVisibilityAttribKey, (value)) + member x.ListView_SeparatorVisibility(value: Xamarin.Forms.SeparatorVisibility) = x.WithAttribute(ViewAttributes.ListView_SeparatorVisibilityAttribKey, (value)) /// Adjusts the ListView_SeparatorColor property in the visual element - member x.ListView_SeparatorColor(value: Xamarin.Forms.Color) = x.WithAttribute(View._ListView_SeparatorColorAttribKey, (value)) + member x.ListView_SeparatorColor(value: Xamarin.Forms.Color) = x.WithAttribute(ViewAttributes.ListView_SeparatorColorAttribKey, (value)) /// Adjusts the ListView_ItemAppearing property in the visual element - member x.ListView_ItemAppearing(value: int -> unit) = x.WithAttribute(View._ListView_ItemAppearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.Item).Value))(value)) + member x.ListView_ItemAppearing(value: int -> unit) = x.WithAttribute(ViewAttributes.ListView_ItemAppearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.Item).Value))(value)) /// Adjusts the ListView_ItemDisappearing property in the visual element - member x.ListView_ItemDisappearing(value: int -> unit) = x.WithAttribute(View._ListView_ItemDisappearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.Item).Value))(value)) + member x.ListView_ItemDisappearing(value: int -> unit) = x.WithAttribute(ViewAttributes.ListView_ItemDisappearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.Item).Value))(value)) /// Adjusts the ListView_ItemSelected property in the visual element - member x.ListView_ItemSelected(value: int option -> unit) = x.WithAttribute(View._ListView_ItemSelectedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.SelectedItem)))(value)) + member x.ListView_ItemSelected(value: int option -> unit) = x.WithAttribute(ViewAttributes.ListView_ItemSelectedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.SelectedItem)))(value)) /// Adjusts the ListView_ItemTapped property in the visual element - member x.ListView_ItemTapped(value: int -> unit) = x.WithAttribute(View._ListView_ItemTappedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.Item).Value))(value)) + member x.ListView_ItemTapped(value: int -> unit) = x.WithAttribute(ViewAttributes.ListView_ItemTappedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindListViewItem sender args.Item).Value))(value)) /// Adjusts the ListView_Refreshing property in the visual element - member x.ListView_Refreshing(value: unit -> unit) = x.WithAttribute(View._ListView_RefreshingAttribKey, (fun f -> System.EventHandler(fun sender args -> f ()))(value)) + member x.ListView_Refreshing(value: unit -> unit) = x.WithAttribute(ViewAttributes.ListView_RefreshingAttribKey, (fun f -> System.EventHandler(fun sender args -> f ()))(value)) /// Adjusts the SelectionMode property in the visual element - member x.SelectionMode(value: Xamarin.Forms.ListViewSelectionMode) = x.WithAttribute(View._SelectionModeAttribKey, (value)) + member x.SelectionMode(value: Xamarin.Forms.ListViewSelectionMode) = x.WithAttribute(ViewAttributes.SelectionModeAttribKey, (value)) /// Adjusts the ListViewGrouped_ItemsSource property in the visual element - member x.ListViewGrouped_ItemsSource(value: (string * ViewElement * ViewElement list) list) = x.WithAttribute(View._ListViewGrouped_ItemsSourceAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun (g, e, l) -> (g, e, Array.ofList l)))(value)) + member x.ListViewGrouped_ItemsSource(value: (string * ViewElement * ViewElement list) list) = x.WithAttribute(ViewAttributes.ListViewGrouped_ItemsSourceAttribKey, (fun es -> es |> Array.ofList |> Array.map (fun (g, e, l) -> (g, e, Array.ofList l)))(value)) /// Adjusts the ListViewGrouped_ShowJumpList property in the visual element - member x.ListViewGrouped_ShowJumpList(value: bool) = x.WithAttribute(View._ListViewGrouped_ShowJumpListAttribKey, (value)) + member x.ListViewGrouped_ShowJumpList(value: bool) = x.WithAttribute(ViewAttributes.ListViewGrouped_ShowJumpListAttribKey, (value)) /// Adjusts the ListViewGrouped_SelectedItem property in the visual element - member x.ListViewGrouped_SelectedItem(value: (int * int) option) = x.WithAttribute(View._ListViewGrouped_SelectedItemAttribKey, (value)) + member x.ListViewGrouped_SelectedItem(value: (int * int) option) = x.WithAttribute(ViewAttributes.ListViewGrouped_SelectedItemAttribKey, (value)) /// Adjusts the SeparatorVisibility property in the visual element - member x.SeparatorVisibility(value: Xamarin.Forms.SeparatorVisibility) = x.WithAttribute(View._SeparatorVisibilityAttribKey, (value)) + member x.SeparatorVisibility(value: Xamarin.Forms.SeparatorVisibility) = x.WithAttribute(ViewAttributes.SeparatorVisibilityAttribKey, (value)) /// Adjusts the SeparatorColor property in the visual element - member x.SeparatorColor(value: Xamarin.Forms.Color) = x.WithAttribute(View._SeparatorColorAttribKey, (value)) + member x.SeparatorColor(value: Xamarin.Forms.Color) = x.WithAttribute(ViewAttributes.SeparatorColorAttribKey, (value)) /// Adjusts the ListViewGrouped_ItemAppearing property in the visual element - member x.ListViewGrouped_ItemAppearing(value: int * int option -> unit) = x.WithAttribute(View._ListViewGrouped_ItemAppearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItemOrGroupItem sender args.Item).Value))(value)) + member x.ListViewGrouped_ItemAppearing(value: int * int option -> unit) = x.WithAttribute(ViewAttributes.ListViewGrouped_ItemAppearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItemOrGroupItem sender args.Item).Value))(value)) /// Adjusts the ListViewGrouped_ItemDisappearing property in the visual element - member x.ListViewGrouped_ItemDisappearing(value: int * int option -> unit) = x.WithAttribute(View._ListViewGrouped_ItemDisappearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItemOrGroupItem sender args.Item).Value))(value)) + member x.ListViewGrouped_ItemDisappearing(value: int * int option -> unit) = x.WithAttribute(ViewAttributes.ListViewGrouped_ItemDisappearingAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItemOrGroupItem sender args.Item).Value))(value)) /// Adjusts the ListViewGrouped_ItemSelected property in the visual element - member x.ListViewGrouped_ItemSelected(value: (int * int) option -> unit) = x.WithAttribute(View._ListViewGrouped_ItemSelectedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItem sender args.SelectedItem)))(value)) + member x.ListViewGrouped_ItemSelected(value: (int * int) option -> unit) = x.WithAttribute(ViewAttributes.ListViewGrouped_ItemSelectedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItem sender args.SelectedItem)))(value)) /// Adjusts the ListViewGrouped_ItemTapped property in the visual element - member x.ListViewGrouped_ItemTapped(value: int * int -> unit) = x.WithAttribute(View._ListViewGrouped_ItemTappedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItem sender args.Item).Value))(value)) + member x.ListViewGrouped_ItemTapped(value: int * int -> unit) = x.WithAttribute(ViewAttributes.ListViewGrouped_ItemTappedAttribKey, (fun f -> System.EventHandler(fun sender args -> f (tryFindGroupedListViewItem sender args.Item).Value))(value)) /// Adjusts the Refreshing property in the visual element - member x.Refreshing(value: unit -> unit) = x.WithAttribute(View._RefreshingAttribKey, (fun f -> System.EventHandler(fun sender args -> f ()))(value)) - + member x.Refreshing(value: unit -> unit) = x.WithAttribute(ViewAttributes.RefreshingAttribKey, (fun f -> System.EventHandler(fun sender args -> f ()))(value)) + + member x.With(?classId: string, ?styleId: string, ?automationId: string, ?anchorX: double, ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, ?heightRequest: double, ?inputTransparent: bool, ?isEnabled: bool, ?isVisible: bool, + ?minimumHeightRequest: double, ?minimumWidthRequest: double, ?opacity: double, ?rotation: double, ?rotationX: double, + ?rotationY: double, ?scale: double, ?style: Xamarin.Forms.Style, ?styleClass: obj, ?translationX: double, + ?translationY: double, ?widthRequest: double, ?resources: (string * obj) list, ?styles: Xamarin.Forms.Style list, ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, ?scaleX: double, ?scaleY: double, ?tabIndex: int, ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, ?margin: obj, ?gestureRecognizers: ViewElement list, ?touchPoints: int, ?panUpdated: Xamarin.Forms.PanUpdatedEventArgs -> unit, + ?command: unit -> unit, ?numberOfTapsRequired: int, ?numberOfClicksRequired: int, ?buttons: Xamarin.Forms.ButtonsMask, ?isPinching: bool, + ?pinchUpdated: Xamarin.Forms.PinchGestureUpdatedEventArgs -> unit, ?swipeGestureRecognizerDirection: Xamarin.Forms.SwipeDirection, ?threshold: System.UInt32, ?swiped: Xamarin.Forms.SwipedEventArgs -> unit, ?color: Xamarin.Forms.Color, + ?isRunning: bool, ?boxViewCornerRadius: Xamarin.Forms.CornerRadius, ?progress: double, ?isClippedToBounds: bool, ?padding: obj, + ?content: ViewElement, ?scrollOrientation: Xamarin.Forms.ScrollOrientation, ?horizontalScrollBarVisibility: Xamarin.Forms.ScrollBarVisibility, ?verticalScrollBarVisibility: Xamarin.Forms.ScrollBarVisibility, ?cancelButtonColor: Xamarin.Forms.Color, + ?fontFamily: string, ?fontAttributes: Xamarin.Forms.FontAttributes, ?fontSize: obj, ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, ?placeholder: string, + ?placeholderColor: Xamarin.Forms.Color, ?searchBarCommand: string -> unit, ?searchBarCanExecute: bool, ?text: string, ?textColor: Xamarin.Forms.Color, + ?searchBarTextChanged: Xamarin.Forms.TextChangedEventArgs -> unit, ?buttonCommand: unit -> unit, ?buttonCanExecute: bool, ?borderColor: Xamarin.Forms.Color, ?borderWidth: double, + ?commandParameter: System.Object, ?contentLayout: Xamarin.Forms.Button.ButtonContentLayout, ?buttonCornerRadius: int, ?buttonImageSource: string, ?minimumMaximum: float * float, + ?value: double, ?valueChanged: Xamarin.Forms.ValueChangedEventArgs -> unit, ?increment: double, ?isToggled: bool, ?toggled: Xamarin.Forms.ToggledEventArgs -> unit, + ?onColor: Xamarin.Forms.Color, ?height: double, ?on: bool, ?onChanged: Xamarin.Forms.ToggledEventArgs -> unit, ?intent: Xamarin.Forms.TableIntent, + ?hasUnevenRows: bool, ?rowHeight: int, ?tableRoot: (string * ViewElement list) list, ?rowDefinitionHeight: obj, ?columnDefinitionWidth: obj, + ?gridRowDefinitions: obj list, ?gridColumnDefinitions: obj list, ?rowSpacing: double, ?columnSpacing: double, ?children: ViewElement list, + ?gridRow: int, ?gridRowSpan: int, ?gridColumn: int, ?gridColumnSpan: int, ?layoutBounds: Xamarin.Forms.Rectangle, + ?layoutFlags: Xamarin.Forms.AbsoluteLayoutFlags, ?boundsConstraint: Xamarin.Forms.BoundsConstraint, ?heightConstraint: Xamarin.Forms.Constraint, ?widthConstraint: Xamarin.Forms.Constraint, ?xConstraint: Xamarin.Forms.Constraint, + ?yConstraint: Xamarin.Forms.Constraint, ?alignContent: Xamarin.Forms.FlexAlignContent, ?alignItems: Xamarin.Forms.FlexAlignItems, ?flexLayoutDirection: Xamarin.Forms.FlexDirection, ?position: Xamarin.Forms.FlexPosition, + ?wrap: Xamarin.Forms.FlexWrap, ?justifyContent: Xamarin.Forms.FlexJustify, ?flexAlignSelf: Xamarin.Forms.FlexAlignSelf, ?flexOrder: int, ?flexBasis: Xamarin.Forms.FlexBasis, + ?flexGrow: double, ?flexShrink: double, ?date: System.DateTime, ?format: string, ?minimumDate: System.DateTime, + ?maximumDate: System.DateTime, ?dateSelected: Xamarin.Forms.DateChangedEventArgs -> unit, ?pickerItemsSource: seq<'T>, ?selectedIndex: int, ?title: string, + ?selectedIndexChanged: (int * 'T option) -> unit, ?frameCornerRadius: double, ?hasShadow: bool, ?imageSource: obj, ?aspect: Xamarin.Forms.Aspect, + ?isOpaque: bool, ?imageButtonCommand: unit -> unit, ?imageButtonCornerRadius: int, ?clicked: System.EventArgs -> unit, ?pressed: System.EventArgs -> unit, + ?released: System.EventArgs -> unit, ?keyboard: Xamarin.Forms.Keyboard, ?editorCompleted: string -> unit, ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, ?autoSize: Xamarin.Forms.EditorAutoSizeOption, + ?isPassword: bool, ?entryCompleted: string -> unit, ?isTextPredictionEnabled: bool, ?returnType: Xamarin.Forms.ReturnType, ?returnCommand: unit -> unit, + ?cursorPosition: int, ?selectionLength: int, ?label: string, ?entryCellTextChanged: Xamarin.Forms.TextChangedEventArgs -> unit, ?verticalTextAlignment: Xamarin.Forms.TextAlignment, + ?formattedText: ViewElement, ?lineBreakMode: Xamarin.Forms.LineBreakMode, ?lineHeight: double, ?maxLines: int, ?textDecorations: Xamarin.Forms.TextDecorations, + ?stackOrientation: Xamarin.Forms.StackOrientation, ?spacing: double, ?foregroundColor: Xamarin.Forms.Color, ?propertyChanged: System.ComponentModel.PropertyChangedEventArgs -> unit, ?spans: ViewElement[], + ?time: System.TimeSpan, ?webSource: Xamarin.Forms.WebViewSource, ?reload: bool, ?navigated: Xamarin.Forms.WebNavigatedEventArgs -> unit, ?navigating: Xamarin.Forms.WebNavigatingEventArgs -> unit, + ?reloadRequested: System.EventArgs -> unit, ?backgroundImage: string, ?icon: string, ?isBusy: bool, ?toolbarItems: ViewElement list, + ?useSafeArea: bool, ?page_Appearing: unit -> unit, ?page_Disappearing: unit -> unit, ?page_LayoutChanged: unit -> unit, ?carouselPage_CurrentPage: int, + ?carouselPage_CurrentPageChanged: int option -> unit, ?pages: ViewElement list, ?backButtonTitle: string, ?hasBackButton: bool, ?hasNavigationBar: bool, + ?titleIcon: string, ?titleView: ViewElement, ?barBackgroundColor: Xamarin.Forms.Color, ?barTextColor: Xamarin.Forms.Color, ?popped: Xamarin.Forms.NavigationEventArgs -> unit, + ?poppedToRoot: Xamarin.Forms.NavigationEventArgs -> unit, ?pushed: Xamarin.Forms.NavigationEventArgs -> unit, ?tabbedPage_CurrentPage: int, ?tabbedPage_CurrentPageChanged: int option -> unit, ?onSizeAllocatedCallback: (double * double) -> unit, + ?master: ViewElement, ?detail: ViewElement, ?isGestureEnabled: bool, ?isPresented: bool, ?masterBehavior: Xamarin.Forms.MasterBehavior, + ?isPresentedChanged: bool -> unit, ?accelerator: string, ?textDetail: string, ?textDetailColor: Xamarin.Forms.Color, ?textCellCommand: unit -> unit, + ?textCellCanExecute: bool, ?order: Xamarin.Forms.ToolbarItemOrder, ?priority: int, ?view: ViewElement, ?listViewItems: seq, + ?footer: System.Object, ?header: System.Object, ?headerTemplate: Xamarin.Forms.DataTemplate, ?isGroupingEnabled: bool, ?isPullToRefreshEnabled: bool, + ?isRefreshing: bool, ?refreshCommand: unit -> unit, ?listView_SelectedItem: int option, ?listView_SeparatorVisibility: Xamarin.Forms.SeparatorVisibility, ?listView_SeparatorColor: Xamarin.Forms.Color, + ?listView_ItemAppearing: int -> unit, ?listView_ItemDisappearing: int -> unit, ?listView_ItemSelected: int option -> unit, ?listView_ItemTapped: int -> unit, ?listView_Refreshing: unit -> unit, + ?selectionMode: Xamarin.Forms.ListViewSelectionMode, ?listViewGrouped_ItemsSource: (string * ViewElement * ViewElement list) list, ?listViewGrouped_ShowJumpList: bool, ?listViewGrouped_SelectedItem: (int * int) option, ?separatorVisibility: Xamarin.Forms.SeparatorVisibility, + ?separatorColor: Xamarin.Forms.Color, ?listViewGrouped_ItemAppearing: int * int option -> unit, ?listViewGrouped_ItemDisappearing: int * int option -> unit, ?listViewGrouped_ItemSelected: (int * int) option -> unit, ?listViewGrouped_ItemTapped: int * int -> unit, + ?refreshing: unit -> unit) = + let x = match classId with None -> x | Some opt -> x.ClassId(opt) + let x = match styleId with None -> x | Some opt -> x.StyleId(opt) + let x = match automationId with None -> x | Some opt -> x.AutomationId(opt) + let x = match anchorX with None -> x | Some opt -> x.AnchorX(opt) + let x = match anchorY with None -> x | Some opt -> x.AnchorY(opt) + let x = match backgroundColor with None -> x | Some opt -> x.BackgroundColor(opt) + let x = match heightRequest with None -> x | Some opt -> x.HeightRequest(opt) + let x = match inputTransparent with None -> x | Some opt -> x.InputTransparent(opt) + let x = match isEnabled with None -> x | Some opt -> x.IsEnabled(opt) + let x = match isVisible with None -> x | Some opt -> x.IsVisible(opt) + let x = match minimumHeightRequest with None -> x | Some opt -> x.MinimumHeightRequest(opt) + let x = match minimumWidthRequest with None -> x | Some opt -> x.MinimumWidthRequest(opt) + let x = match opacity with None -> x | Some opt -> x.Opacity(opt) + let x = match rotation with None -> x | Some opt -> x.Rotation(opt) + let x = match rotationX with None -> x | Some opt -> x.RotationX(opt) + let x = match rotationY with None -> x | Some opt -> x.RotationY(opt) + let x = match scale with None -> x | Some opt -> x.Scale(opt) + let x = match style with None -> x | Some opt -> x.Style(opt) + let x = match styleClass with None -> x | Some opt -> x.StyleClass(opt) + let x = match translationX with None -> x | Some opt -> x.TranslationX(opt) + let x = match translationY with None -> x | Some opt -> x.TranslationY(opt) + let x = match widthRequest with None -> x | Some opt -> x.WidthRequest(opt) + let x = match resources with None -> x | Some opt -> x.Resources(opt) + let x = match styles with None -> x | Some opt -> x.Styles(opt) + let x = match styleSheets with None -> x | Some opt -> x.StyleSheets(opt) + let x = match isTabStop with None -> x | Some opt -> x.IsTabStop(opt) + let x = match scaleX with None -> x | Some opt -> x.ScaleX(opt) + let x = match scaleY with None -> x | Some opt -> x.ScaleY(opt) + let x = match tabIndex with None -> x | Some opt -> x.TabIndex(opt) + let x = match horizontalOptions with None -> x | Some opt -> x.HorizontalOptions(opt) + let x = match verticalOptions with None -> x | Some opt -> x.VerticalOptions(opt) + let x = match margin with None -> x | Some opt -> x.Margin(opt) + let x = match gestureRecognizers with None -> x | Some opt -> x.GestureRecognizers(opt) + let x = match touchPoints with None -> x | Some opt -> x.TouchPoints(opt) + let x = match panUpdated with None -> x | Some opt -> x.PanUpdated(opt) + let x = match command with None -> x | Some opt -> x.Command(opt) + let x = match numberOfTapsRequired with None -> x | Some opt -> x.NumberOfTapsRequired(opt) + let x = match numberOfClicksRequired with None -> x | Some opt -> x.NumberOfClicksRequired(opt) + let x = match buttons with None -> x | Some opt -> x.Buttons(opt) + let x = match isPinching with None -> x | Some opt -> x.IsPinching(opt) + let x = match pinchUpdated with None -> x | Some opt -> x.PinchUpdated(opt) + let x = match swipeGestureRecognizerDirection with None -> x | Some opt -> x.SwipeGestureRecognizerDirection(opt) + let x = match threshold with None -> x | Some opt -> x.Threshold(opt) + let x = match swiped with None -> x | Some opt -> x.Swiped(opt) + let x = match color with None -> x | Some opt -> x.Color(opt) + let x = match isRunning with None -> x | Some opt -> x.IsRunning(opt) + let x = match boxViewCornerRadius with None -> x | Some opt -> x.BoxViewCornerRadius(opt) + let x = match progress with None -> x | Some opt -> x.Progress(opt) + let x = match isClippedToBounds with None -> x | Some opt -> x.IsClippedToBounds(opt) + let x = match padding with None -> x | Some opt -> x.Padding(opt) + let x = match content with None -> x | Some opt -> x.Content(opt) + let x = match scrollOrientation with None -> x | Some opt -> x.ScrollOrientation(opt) + let x = match horizontalScrollBarVisibility with None -> x | Some opt -> x.HorizontalScrollBarVisibility(opt) + let x = match verticalScrollBarVisibility with None -> x | Some opt -> x.VerticalScrollBarVisibility(opt) + let x = match cancelButtonColor with None -> x | Some opt -> x.CancelButtonColor(opt) + let x = match fontFamily with None -> x | Some opt -> x.FontFamily(opt) + let x = match fontAttributes with None -> x | Some opt -> x.FontAttributes(opt) + let x = match fontSize with None -> x | Some opt -> x.FontSize(opt) + let x = match horizontalTextAlignment with None -> x | Some opt -> x.HorizontalTextAlignment(opt) + let x = match placeholder with None -> x | Some opt -> x.Placeholder(opt) + let x = match placeholderColor with None -> x | Some opt -> x.PlaceholderColor(opt) + let x = match searchBarCommand with None -> x | Some opt -> x.SearchBarCommand(opt) + let x = match searchBarCanExecute with None -> x | Some opt -> x.SearchBarCanExecute(opt) + let x = match text with None -> x | Some opt -> x.Text(opt) + let x = match textColor with None -> x | Some opt -> x.TextColor(opt) + let x = match searchBarTextChanged with None -> x | Some opt -> x.SearchBarTextChanged(opt) + let x = match buttonCommand with None -> x | Some opt -> x.ButtonCommand(opt) + let x = match buttonCanExecute with None -> x | Some opt -> x.ButtonCanExecute(opt) + let x = match borderColor with None -> x | Some opt -> x.BorderColor(opt) + let x = match borderWidth with None -> x | Some opt -> x.BorderWidth(opt) + let x = match commandParameter with None -> x | Some opt -> x.CommandParameter(opt) + let x = match contentLayout with None -> x | Some opt -> x.ContentLayout(opt) + let x = match buttonCornerRadius with None -> x | Some opt -> x.ButtonCornerRadius(opt) + let x = match buttonImageSource with None -> x | Some opt -> x.ButtonImageSource(opt) + let x = match minimumMaximum with None -> x | Some opt -> x.MinimumMaximum(opt) + let x = match value with None -> x | Some opt -> x.Value(opt) + let x = match valueChanged with None -> x | Some opt -> x.ValueChanged(opt) + let x = match increment with None -> x | Some opt -> x.Increment(opt) + let x = match isToggled with None -> x | Some opt -> x.IsToggled(opt) + let x = match toggled with None -> x | Some opt -> x.Toggled(opt) + let x = match onColor with None -> x | Some opt -> x.OnColor(opt) + let x = match height with None -> x | Some opt -> x.Height(opt) + let x = match on with None -> x | Some opt -> x.On(opt) + let x = match onChanged with None -> x | Some opt -> x.OnChanged(opt) + let x = match intent with None -> x | Some opt -> x.Intent(opt) + let x = match hasUnevenRows with None -> x | Some opt -> x.HasUnevenRows(opt) + let x = match rowHeight with None -> x | Some opt -> x.RowHeight(opt) + let x = match tableRoot with None -> x | Some opt -> x.TableRoot(opt) + let x = match rowDefinitionHeight with None -> x | Some opt -> x.RowDefinitionHeight(opt) + let x = match columnDefinitionWidth with None -> x | Some opt -> x.ColumnDefinitionWidth(opt) + let x = match gridRowDefinitions with None -> x | Some opt -> x.GridRowDefinitions(opt) + let x = match gridColumnDefinitions with None -> x | Some opt -> x.GridColumnDefinitions(opt) + let x = match rowSpacing with None -> x | Some opt -> x.RowSpacing(opt) + let x = match columnSpacing with None -> x | Some opt -> x.ColumnSpacing(opt) + let x = match children with None -> x | Some opt -> x.Children(opt) + let x = match gridRow with None -> x | Some opt -> x.GridRow(opt) + let x = match gridRowSpan with None -> x | Some opt -> x.GridRowSpan(opt) + let x = match gridColumn with None -> x | Some opt -> x.GridColumn(opt) + let x = match gridColumnSpan with None -> x | Some opt -> x.GridColumnSpan(opt) + let x = match layoutBounds with None -> x | Some opt -> x.LayoutBounds(opt) + let x = match layoutFlags with None -> x | Some opt -> x.LayoutFlags(opt) + let x = match boundsConstraint with None -> x | Some opt -> x.BoundsConstraint(opt) + let x = match heightConstraint with None -> x | Some opt -> x.HeightConstraint(opt) + let x = match widthConstraint with None -> x | Some opt -> x.WidthConstraint(opt) + let x = match xConstraint with None -> x | Some opt -> x.XConstraint(opt) + let x = match yConstraint with None -> x | Some opt -> x.YConstraint(opt) + let x = match alignContent with None -> x | Some opt -> x.AlignContent(opt) + let x = match alignItems with None -> x | Some opt -> x.AlignItems(opt) + let x = match flexLayoutDirection with None -> x | Some opt -> x.FlexLayoutDirection(opt) + let x = match position with None -> x | Some opt -> x.Position(opt) + let x = match wrap with None -> x | Some opt -> x.Wrap(opt) + let x = match justifyContent with None -> x | Some opt -> x.JustifyContent(opt) + let x = match flexAlignSelf with None -> x | Some opt -> x.FlexAlignSelf(opt) + let x = match flexOrder with None -> x | Some opt -> x.FlexOrder(opt) + let x = match flexBasis with None -> x | Some opt -> x.FlexBasis(opt) + let x = match flexGrow with None -> x | Some opt -> x.FlexGrow(opt) + let x = match flexShrink with None -> x | Some opt -> x.FlexShrink(opt) + let x = match date with None -> x | Some opt -> x.Date(opt) + let x = match format with None -> x | Some opt -> x.Format(opt) + let x = match minimumDate with None -> x | Some opt -> x.MinimumDate(opt) + let x = match maximumDate with None -> x | Some opt -> x.MaximumDate(opt) + let x = match dateSelected with None -> x | Some opt -> x.DateSelected(opt) + let x = match pickerItemsSource with None -> x | Some opt -> x.PickerItemsSource(opt) + let x = match selectedIndex with None -> x | Some opt -> x.SelectedIndex(opt) + let x = match title with None -> x | Some opt -> x.Title(opt) + let x = match selectedIndexChanged with None -> x | Some opt -> x.SelectedIndexChanged(opt) + let x = match frameCornerRadius with None -> x | Some opt -> x.FrameCornerRadius(opt) + let x = match hasShadow with None -> x | Some opt -> x.HasShadow(opt) + let x = match imageSource with None -> x | Some opt -> x.ImageSource(opt) + let x = match aspect with None -> x | Some opt -> x.Aspect(opt) + let x = match isOpaque with None -> x | Some opt -> x.IsOpaque(opt) + let x = match imageButtonCommand with None -> x | Some opt -> x.ImageButtonCommand(opt) + let x = match imageButtonCornerRadius with None -> x | Some opt -> x.ImageButtonCornerRadius(opt) + let x = match clicked with None -> x | Some opt -> x.Clicked(opt) + let x = match pressed with None -> x | Some opt -> x.Pressed(opt) + let x = match released with None -> x | Some opt -> x.Released(opt) + let x = match keyboard with None -> x | Some opt -> x.Keyboard(opt) + let x = match editorCompleted with None -> x | Some opt -> x.EditorCompleted(opt) + let x = match textChanged with None -> x | Some opt -> x.TextChanged(opt) + let x = match autoSize with None -> x | Some opt -> x.AutoSize(opt) + let x = match isPassword with None -> x | Some opt -> x.IsPassword(opt) + let x = match entryCompleted with None -> x | Some opt -> x.EntryCompleted(opt) + let x = match isTextPredictionEnabled with None -> x | Some opt -> x.IsTextPredictionEnabled(opt) + let x = match returnType with None -> x | Some opt -> x.ReturnType(opt) + let x = match returnCommand with None -> x | Some opt -> x.ReturnCommand(opt) + let x = match cursorPosition with None -> x | Some opt -> x.CursorPosition(opt) + let x = match selectionLength with None -> x | Some opt -> x.SelectionLength(opt) + let x = match label with None -> x | Some opt -> x.Label(opt) + let x = match entryCellTextChanged with None -> x | Some opt -> x.EntryCellTextChanged(opt) + let x = match verticalTextAlignment with None -> x | Some opt -> x.VerticalTextAlignment(opt) + let x = match formattedText with None -> x | Some opt -> x.FormattedText(opt) + let x = match lineBreakMode with None -> x | Some opt -> x.LineBreakMode(opt) + let x = match lineHeight with None -> x | Some opt -> x.LineHeight(opt) + let x = match maxLines with None -> x | Some opt -> x.MaxLines(opt) + let x = match textDecorations with None -> x | Some opt -> x.TextDecorations(opt) + let x = match stackOrientation with None -> x | Some opt -> x.StackOrientation(opt) + let x = match spacing with None -> x | Some opt -> x.Spacing(opt) + let x = match foregroundColor with None -> x | Some opt -> x.ForegroundColor(opt) + let x = match propertyChanged with None -> x | Some opt -> x.PropertyChanged(opt) + let x = match spans with None -> x | Some opt -> x.Spans(opt) + let x = match time with None -> x | Some opt -> x.Time(opt) + let x = match webSource with None -> x | Some opt -> x.WebSource(opt) + let x = match reload with None -> x | Some opt -> x.Reload(opt) + let x = match navigated with None -> x | Some opt -> x.Navigated(opt) + let x = match navigating with None -> x | Some opt -> x.Navigating(opt) + let x = match reloadRequested with None -> x | Some opt -> x.ReloadRequested(opt) + let x = match backgroundImage with None -> x | Some opt -> x.BackgroundImage(opt) + let x = match icon with None -> x | Some opt -> x.Icon(opt) + let x = match isBusy with None -> x | Some opt -> x.IsBusy(opt) + let x = match toolbarItems with None -> x | Some opt -> x.ToolbarItems(opt) + let x = match useSafeArea with None -> x | Some opt -> x.UseSafeArea(opt) + let x = match page_Appearing with None -> x | Some opt -> x.Page_Appearing(opt) + let x = match page_Disappearing with None -> x | Some opt -> x.Page_Disappearing(opt) + let x = match page_LayoutChanged with None -> x | Some opt -> x.Page_LayoutChanged(opt) + let x = match carouselPage_CurrentPage with None -> x | Some opt -> x.CarouselPage_CurrentPage(opt) + let x = match carouselPage_CurrentPageChanged with None -> x | Some opt -> x.CarouselPage_CurrentPageChanged(opt) + let x = match pages with None -> x | Some opt -> x.Pages(opt) + let x = match backButtonTitle with None -> x | Some opt -> x.BackButtonTitle(opt) + let x = match hasBackButton with None -> x | Some opt -> x.HasBackButton(opt) + let x = match hasNavigationBar with None -> x | Some opt -> x.HasNavigationBar(opt) + let x = match titleIcon with None -> x | Some opt -> x.TitleIcon(opt) + let x = match titleView with None -> x | Some opt -> x.TitleView(opt) + let x = match barBackgroundColor with None -> x | Some opt -> x.BarBackgroundColor(opt) + let x = match barTextColor with None -> x | Some opt -> x.BarTextColor(opt) + let x = match popped with None -> x | Some opt -> x.Popped(opt) + let x = match poppedToRoot with None -> x | Some opt -> x.PoppedToRoot(opt) + let x = match pushed with None -> x | Some opt -> x.Pushed(opt) + let x = match tabbedPage_CurrentPage with None -> x | Some opt -> x.TabbedPage_CurrentPage(opt) + let x = match tabbedPage_CurrentPageChanged with None -> x | Some opt -> x.TabbedPage_CurrentPageChanged(opt) + let x = match onSizeAllocatedCallback with None -> x | Some opt -> x.OnSizeAllocatedCallback(opt) + let x = match master with None -> x | Some opt -> x.Master(opt) + let x = match detail with None -> x | Some opt -> x.Detail(opt) + let x = match isGestureEnabled with None -> x | Some opt -> x.IsGestureEnabled(opt) + let x = match isPresented with None -> x | Some opt -> x.IsPresented(opt) + let x = match masterBehavior with None -> x | Some opt -> x.MasterBehavior(opt) + let x = match isPresentedChanged with None -> x | Some opt -> x.IsPresentedChanged(opt) + let x = match accelerator with None -> x | Some opt -> x.Accelerator(opt) + let x = match textDetail with None -> x | Some opt -> x.TextDetail(opt) + let x = match textDetailColor with None -> x | Some opt -> x.TextDetailColor(opt) + let x = match textCellCommand with None -> x | Some opt -> x.TextCellCommand(opt) + let x = match textCellCanExecute with None -> x | Some opt -> x.TextCellCanExecute(opt) + let x = match order with None -> x | Some opt -> x.Order(opt) + let x = match priority with None -> x | Some opt -> x.Priority(opt) + let x = match view with None -> x | Some opt -> x.View(opt) + let x = match listViewItems with None -> x | Some opt -> x.ListViewItems(opt) + let x = match footer with None -> x | Some opt -> x.Footer(opt) + let x = match header with None -> x | Some opt -> x.Header(opt) + let x = match headerTemplate with None -> x | Some opt -> x.HeaderTemplate(opt) + let x = match isGroupingEnabled with None -> x | Some opt -> x.IsGroupingEnabled(opt) + let x = match isPullToRefreshEnabled with None -> x | Some opt -> x.IsPullToRefreshEnabled(opt) + let x = match isRefreshing with None -> x | Some opt -> x.IsRefreshing(opt) + let x = match refreshCommand with None -> x | Some opt -> x.RefreshCommand(opt) + let x = match listView_SelectedItem with None -> x | Some opt -> x.ListView_SelectedItem(opt) + let x = match listView_SeparatorVisibility with None -> x | Some opt -> x.ListView_SeparatorVisibility(opt) + let x = match listView_SeparatorColor with None -> x | Some opt -> x.ListView_SeparatorColor(opt) + let x = match listView_ItemAppearing with None -> x | Some opt -> x.ListView_ItemAppearing(opt) + let x = match listView_ItemDisappearing with None -> x | Some opt -> x.ListView_ItemDisappearing(opt) + let x = match listView_ItemSelected with None -> x | Some opt -> x.ListView_ItemSelected(opt) + let x = match listView_ItemTapped with None -> x | Some opt -> x.ListView_ItemTapped(opt) + let x = match listView_Refreshing with None -> x | Some opt -> x.ListView_Refreshing(opt) + let x = match selectionMode with None -> x | Some opt -> x.SelectionMode(opt) + let x = match listViewGrouped_ItemsSource with None -> x | Some opt -> x.ListViewGrouped_ItemsSource(opt) + let x = match listViewGrouped_ShowJumpList with None -> x | Some opt -> x.ListViewGrouped_ShowJumpList(opt) + let x = match listViewGrouped_SelectedItem with None -> x | Some opt -> x.ListViewGrouped_SelectedItem(opt) + let x = match separatorVisibility with None -> x | Some opt -> x.SeparatorVisibility(opt) + let x = match separatorColor with None -> x | Some opt -> x.SeparatorColor(opt) + let x = match listViewGrouped_ItemAppearing with None -> x | Some opt -> x.ListViewGrouped_ItemAppearing(opt) + let x = match listViewGrouped_ItemDisappearing with None -> x | Some opt -> x.ListViewGrouped_ItemDisappearing(opt) + let x = match listViewGrouped_ItemSelected with None -> x | Some opt -> x.ListViewGrouped_ItemSelected(opt) + let x = match listViewGrouped_ItemTapped with None -> x | Some opt -> x.ListViewGrouped_ItemTapped(opt) + let x = match refreshing with None -> x | Some opt -> x.Refreshing(opt) + x /// Adjusts the ClassId property in the visual element let classId (value: string) (x: ViewElement) = x.ClassId(value) - /// Adjusts the StyleId property in the visual element let styleId (value: string) (x: ViewElement) = x.StyleId(value) - /// Adjusts the AutomationId property in the visual element let automationId (value: string) (x: ViewElement) = x.AutomationId(value) - /// Adjusts the AnchorX property in the visual element let anchorX (value: double) (x: ViewElement) = x.AnchorX(value) - /// Adjusts the AnchorY property in the visual element let anchorY (value: double) (x: ViewElement) = x.AnchorY(value) - /// Adjusts the BackgroundColor property in the visual element let backgroundColor (value: Xamarin.Forms.Color) (x: ViewElement) = x.BackgroundColor(value) - /// Adjusts the HeightRequest property in the visual element let heightRequest (value: double) (x: ViewElement) = x.HeightRequest(value) - /// Adjusts the InputTransparent property in the visual element let inputTransparent (value: bool) (x: ViewElement) = x.InputTransparent(value) - /// Adjusts the IsEnabled property in the visual element let isEnabled (value: bool) (x: ViewElement) = x.IsEnabled(value) - /// Adjusts the IsVisible property in the visual element let isVisible (value: bool) (x: ViewElement) = x.IsVisible(value) - /// Adjusts the MinimumHeightRequest property in the visual element let minimumHeightRequest (value: double) (x: ViewElement) = x.MinimumHeightRequest(value) - /// Adjusts the MinimumWidthRequest property in the visual element let minimumWidthRequest (value: double) (x: ViewElement) = x.MinimumWidthRequest(value) - /// Adjusts the Opacity property in the visual element let opacity (value: double) (x: ViewElement) = x.Opacity(value) - /// Adjusts the Rotation property in the visual element let rotation (value: double) (x: ViewElement) = x.Rotation(value) - /// Adjusts the RotationX property in the visual element let rotationX (value: double) (x: ViewElement) = x.RotationX(value) - /// Adjusts the RotationY property in the visual element let rotationY (value: double) (x: ViewElement) = x.RotationY(value) - /// Adjusts the Scale property in the visual element let scale (value: double) (x: ViewElement) = x.Scale(value) - /// Adjusts the Style property in the visual element let style (value: Xamarin.Forms.Style) (x: ViewElement) = x.Style(value) - /// Adjusts the StyleClass property in the visual element let styleClass (value: obj) (x: ViewElement) = x.StyleClass(value) - /// Adjusts the TranslationX property in the visual element let translationX (value: double) (x: ViewElement) = x.TranslationX(value) - /// Adjusts the TranslationY property in the visual element let translationY (value: double) (x: ViewElement) = x.TranslationY(value) - /// Adjusts the WidthRequest property in the visual element let widthRequest (value: double) (x: ViewElement) = x.WidthRequest(value) - /// Adjusts the Resources property in the visual element let resources (value: (string * obj) list) (x: ViewElement) = x.Resources(value) - /// Adjusts the Styles property in the visual element let styles (value: Xamarin.Forms.Style list) (x: ViewElement) = x.Styles(value) - /// Adjusts the StyleSheets property in the visual element let styleSheets (value: Xamarin.Forms.StyleSheets.StyleSheet list) (x: ViewElement) = x.StyleSheets(value) - /// Adjusts the IsTabStop property in the visual element let isTabStop (value: bool) (x: ViewElement) = x.IsTabStop(value) - /// Adjusts the ScaleX property in the visual element let scaleX (value: double) (x: ViewElement) = x.ScaleX(value) - /// Adjusts the ScaleY property in the visual element let scaleY (value: double) (x: ViewElement) = x.ScaleY(value) - /// Adjusts the TabIndex property in the visual element let tabIndex (value: int) (x: ViewElement) = x.TabIndex(value) - /// Adjusts the HorizontalOptions property in the visual element let horizontalOptions (value: Xamarin.Forms.LayoutOptions) (x: ViewElement) = x.HorizontalOptions(value) - /// Adjusts the VerticalOptions property in the visual element let verticalOptions (value: Xamarin.Forms.LayoutOptions) (x: ViewElement) = x.VerticalOptions(value) - /// Adjusts the Margin property in the visual element let margin (value: obj) (x: ViewElement) = x.Margin(value) - /// Adjusts the GestureRecognizers property in the visual element let gestureRecognizers (value: ViewElement list) (x: ViewElement) = x.GestureRecognizers(value) - /// Adjusts the TouchPoints property in the visual element let touchPoints (value: int) (x: ViewElement) = x.TouchPoints(value) - /// Adjusts the PanUpdated property in the visual element let panUpdated (value: Xamarin.Forms.PanUpdatedEventArgs -> unit) (x: ViewElement) = x.PanUpdated(value) - /// Adjusts the Command property in the visual element let command (value: unit -> unit) (x: ViewElement) = x.Command(value) - /// Adjusts the NumberOfTapsRequired property in the visual element let numberOfTapsRequired (value: int) (x: ViewElement) = x.NumberOfTapsRequired(value) - /// Adjusts the NumberOfClicksRequired property in the visual element let numberOfClicksRequired (value: int) (x: ViewElement) = x.NumberOfClicksRequired(value) - /// Adjusts the Buttons property in the visual element let buttons (value: Xamarin.Forms.ButtonsMask) (x: ViewElement) = x.Buttons(value) - /// Adjusts the IsPinching property in the visual element let isPinching (value: bool) (x: ViewElement) = x.IsPinching(value) - /// Adjusts the PinchUpdated property in the visual element let pinchUpdated (value: Xamarin.Forms.PinchGestureUpdatedEventArgs -> unit) (x: ViewElement) = x.PinchUpdated(value) - /// Adjusts the SwipeGestureRecognizerDirection property in the visual element let swipeGestureRecognizerDirection (value: Xamarin.Forms.SwipeDirection) (x: ViewElement) = x.SwipeGestureRecognizerDirection(value) - /// Adjusts the Threshold property in the visual element let threshold (value: System.UInt32) (x: ViewElement) = x.Threshold(value) - /// Adjusts the Swiped property in the visual element let swiped (value: Xamarin.Forms.SwipedEventArgs -> unit) (x: ViewElement) = x.Swiped(value) - /// Adjusts the Color property in the visual element let color (value: Xamarin.Forms.Color) (x: ViewElement) = x.Color(value) - /// Adjusts the IsRunning property in the visual element let isRunning (value: bool) (x: ViewElement) = x.IsRunning(value) - /// Adjusts the BoxViewCornerRadius property in the visual element let boxViewCornerRadius (value: Xamarin.Forms.CornerRadius) (x: ViewElement) = x.BoxViewCornerRadius(value) - /// Adjusts the Progress property in the visual element let progress (value: double) (x: ViewElement) = x.Progress(value) - /// Adjusts the IsClippedToBounds property in the visual element let isClippedToBounds (value: bool) (x: ViewElement) = x.IsClippedToBounds(value) - /// Adjusts the Padding property in the visual element let padding (value: obj) (x: ViewElement) = x.Padding(value) - /// Adjusts the Content property in the visual element let content (value: ViewElement) (x: ViewElement) = x.Content(value) - /// Adjusts the ScrollOrientation property in the visual element let scrollOrientation (value: Xamarin.Forms.ScrollOrientation) (x: ViewElement) = x.ScrollOrientation(value) - /// Adjusts the HorizontalScrollBarVisibility property in the visual element let horizontalScrollBarVisibility (value: Xamarin.Forms.ScrollBarVisibility) (x: ViewElement) = x.HorizontalScrollBarVisibility(value) - /// Adjusts the VerticalScrollBarVisibility property in the visual element let verticalScrollBarVisibility (value: Xamarin.Forms.ScrollBarVisibility) (x: ViewElement) = x.VerticalScrollBarVisibility(value) - /// Adjusts the CancelButtonColor property in the visual element let cancelButtonColor (value: Xamarin.Forms.Color) (x: ViewElement) = x.CancelButtonColor(value) - /// Adjusts the FontFamily property in the visual element let fontFamily (value: string) (x: ViewElement) = x.FontFamily(value) - /// Adjusts the FontAttributes property in the visual element let fontAttributes (value: Xamarin.Forms.FontAttributes) (x: ViewElement) = x.FontAttributes(value) - /// Adjusts the FontSize property in the visual element let fontSize (value: obj) (x: ViewElement) = x.FontSize(value) - /// Adjusts the HorizontalTextAlignment property in the visual element let horizontalTextAlignment (value: Xamarin.Forms.TextAlignment) (x: ViewElement) = x.HorizontalTextAlignment(value) - /// Adjusts the Placeholder property in the visual element let placeholder (value: string) (x: ViewElement) = x.Placeholder(value) - /// Adjusts the PlaceholderColor property in the visual element let placeholderColor (value: Xamarin.Forms.Color) (x: ViewElement) = x.PlaceholderColor(value) - /// Adjusts the SearchBarCommand property in the visual element let searchBarCommand (value: string -> unit) (x: ViewElement) = x.SearchBarCommand(value) - /// Adjusts the SearchBarCanExecute property in the visual element let searchBarCanExecute (value: bool) (x: ViewElement) = x.SearchBarCanExecute(value) - /// Adjusts the Text property in the visual element let text (value: string) (x: ViewElement) = x.Text(value) - /// Adjusts the TextColor property in the visual element let textColor (value: Xamarin.Forms.Color) (x: ViewElement) = x.TextColor(value) - /// Adjusts the SearchBarTextChanged property in the visual element let searchBarTextChanged (value: Xamarin.Forms.TextChangedEventArgs -> unit) (x: ViewElement) = x.SearchBarTextChanged(value) - /// Adjusts the ButtonCommand property in the visual element let buttonCommand (value: unit -> unit) (x: ViewElement) = x.ButtonCommand(value) - /// Adjusts the ButtonCanExecute property in the visual element let buttonCanExecute (value: bool) (x: ViewElement) = x.ButtonCanExecute(value) - /// Adjusts the BorderColor property in the visual element let borderColor (value: Xamarin.Forms.Color) (x: ViewElement) = x.BorderColor(value) - /// Adjusts the BorderWidth property in the visual element let borderWidth (value: double) (x: ViewElement) = x.BorderWidth(value) - /// Adjusts the CommandParameter property in the visual element let commandParameter (value: System.Object) (x: ViewElement) = x.CommandParameter(value) - /// Adjusts the ContentLayout property in the visual element let contentLayout (value: Xamarin.Forms.Button.ButtonContentLayout) (x: ViewElement) = x.ContentLayout(value) - /// Adjusts the ButtonCornerRadius property in the visual element let buttonCornerRadius (value: int) (x: ViewElement) = x.ButtonCornerRadius(value) - /// Adjusts the ButtonImageSource property in the visual element let buttonImageSource (value: string) (x: ViewElement) = x.ButtonImageSource(value) - /// Adjusts the MinimumMaximum property in the visual element let minimumMaximum (value: float * float) (x: ViewElement) = x.MinimumMaximum(value) - /// Adjusts the Value property in the visual element let value (value: double) (x: ViewElement) = x.Value(value) - /// Adjusts the ValueChanged property in the visual element let valueChanged (value: Xamarin.Forms.ValueChangedEventArgs -> unit) (x: ViewElement) = x.ValueChanged(value) - /// Adjusts the Increment property in the visual element let increment (value: double) (x: ViewElement) = x.Increment(value) - /// Adjusts the IsToggled property in the visual element let isToggled (value: bool) (x: ViewElement) = x.IsToggled(value) - /// Adjusts the Toggled property in the visual element let toggled (value: Xamarin.Forms.ToggledEventArgs -> unit) (x: ViewElement) = x.Toggled(value) - /// Adjusts the OnColor property in the visual element let onColor (value: Xamarin.Forms.Color) (x: ViewElement) = x.OnColor(value) - /// Adjusts the Height property in the visual element let height (value: double) (x: ViewElement) = x.Height(value) - /// Adjusts the On property in the visual element let on (value: bool) (x: ViewElement) = x.On(value) - /// Adjusts the OnChanged property in the visual element let onChanged (value: Xamarin.Forms.ToggledEventArgs -> unit) (x: ViewElement) = x.OnChanged(value) - /// Adjusts the Intent property in the visual element let intent (value: Xamarin.Forms.TableIntent) (x: ViewElement) = x.Intent(value) - /// Adjusts the HasUnevenRows property in the visual element let hasUnevenRows (value: bool) (x: ViewElement) = x.HasUnevenRows(value) - /// Adjusts the RowHeight property in the visual element let rowHeight (value: int) (x: ViewElement) = x.RowHeight(value) - /// Adjusts the TableRoot property in the visual element let tableRoot (value: (string * ViewElement list) list) (x: ViewElement) = x.TableRoot(value) - /// Adjusts the RowDefinitionHeight property in the visual element let rowDefinitionHeight (value: obj) (x: ViewElement) = x.RowDefinitionHeight(value) - /// Adjusts the ColumnDefinitionWidth property in the visual element let columnDefinitionWidth (value: obj) (x: ViewElement) = x.ColumnDefinitionWidth(value) - /// Adjusts the GridRowDefinitions property in the visual element let gridRowDefinitions (value: obj list) (x: ViewElement) = x.GridRowDefinitions(value) - /// Adjusts the GridColumnDefinitions property in the visual element let gridColumnDefinitions (value: obj list) (x: ViewElement) = x.GridColumnDefinitions(value) - /// Adjusts the RowSpacing property in the visual element let rowSpacing (value: double) (x: ViewElement) = x.RowSpacing(value) - /// Adjusts the ColumnSpacing property in the visual element let columnSpacing (value: double) (x: ViewElement) = x.ColumnSpacing(value) - /// Adjusts the Children property in the visual element let children (value: ViewElement list) (x: ViewElement) = x.Children(value) - /// Adjusts the GridRow property in the visual element let gridRow (value: int) (x: ViewElement) = x.GridRow(value) - /// Adjusts the GridRowSpan property in the visual element let gridRowSpan (value: int) (x: ViewElement) = x.GridRowSpan(value) - /// Adjusts the GridColumn property in the visual element let gridColumn (value: int) (x: ViewElement) = x.GridColumn(value) - /// Adjusts the GridColumnSpan property in the visual element let gridColumnSpan (value: int) (x: ViewElement) = x.GridColumnSpan(value) - /// Adjusts the LayoutBounds property in the visual element let layoutBounds (value: Xamarin.Forms.Rectangle) (x: ViewElement) = x.LayoutBounds(value) - /// Adjusts the LayoutFlags property in the visual element let layoutFlags (value: Xamarin.Forms.AbsoluteLayoutFlags) (x: ViewElement) = x.LayoutFlags(value) - /// Adjusts the BoundsConstraint property in the visual element let boundsConstraint (value: Xamarin.Forms.BoundsConstraint) (x: ViewElement) = x.BoundsConstraint(value) - /// Adjusts the HeightConstraint property in the visual element let heightConstraint (value: Xamarin.Forms.Constraint) (x: ViewElement) = x.HeightConstraint(value) - /// Adjusts the WidthConstraint property in the visual element let widthConstraint (value: Xamarin.Forms.Constraint) (x: ViewElement) = x.WidthConstraint(value) - /// Adjusts the XConstraint property in the visual element let xConstraint (value: Xamarin.Forms.Constraint) (x: ViewElement) = x.XConstraint(value) - /// Adjusts the YConstraint property in the visual element let yConstraint (value: Xamarin.Forms.Constraint) (x: ViewElement) = x.YConstraint(value) - /// Adjusts the AlignContent property in the visual element let alignContent (value: Xamarin.Forms.FlexAlignContent) (x: ViewElement) = x.AlignContent(value) - /// Adjusts the AlignItems property in the visual element let alignItems (value: Xamarin.Forms.FlexAlignItems) (x: ViewElement) = x.AlignItems(value) - /// Adjusts the FlexLayoutDirection property in the visual element let flexLayoutDirection (value: Xamarin.Forms.FlexDirection) (x: ViewElement) = x.FlexLayoutDirection(value) - /// Adjusts the Position property in the visual element let position (value: Xamarin.Forms.FlexPosition) (x: ViewElement) = x.Position(value) - /// Adjusts the Wrap property in the visual element let wrap (value: Xamarin.Forms.FlexWrap) (x: ViewElement) = x.Wrap(value) - /// Adjusts the JustifyContent property in the visual element let justifyContent (value: Xamarin.Forms.FlexJustify) (x: ViewElement) = x.JustifyContent(value) - /// Adjusts the FlexAlignSelf property in the visual element let flexAlignSelf (value: Xamarin.Forms.FlexAlignSelf) (x: ViewElement) = x.FlexAlignSelf(value) - /// Adjusts the FlexOrder property in the visual element let flexOrder (value: int) (x: ViewElement) = x.FlexOrder(value) - /// Adjusts the FlexBasis property in the visual element let flexBasis (value: Xamarin.Forms.FlexBasis) (x: ViewElement) = x.FlexBasis(value) - /// Adjusts the FlexGrow property in the visual element let flexGrow (value: double) (x: ViewElement) = x.FlexGrow(value) - /// Adjusts the FlexShrink property in the visual element let flexShrink (value: double) (x: ViewElement) = x.FlexShrink(value) - /// Adjusts the Date property in the visual element let date (value: System.DateTime) (x: ViewElement) = x.Date(value) - /// Adjusts the Format property in the visual element let format (value: string) (x: ViewElement) = x.Format(value) - /// Adjusts the MinimumDate property in the visual element let minimumDate (value: System.DateTime) (x: ViewElement) = x.MinimumDate(value) - /// Adjusts the MaximumDate property in the visual element let maximumDate (value: System.DateTime) (x: ViewElement) = x.MaximumDate(value) - /// Adjusts the DateSelected property in the visual element let dateSelected (value: Xamarin.Forms.DateChangedEventArgs -> unit) (x: ViewElement) = x.DateSelected(value) - /// Adjusts the PickerItemsSource property in the visual element let pickerItemsSource (value: seq<'T>) (x: ViewElement) = x.PickerItemsSource(value) - /// Adjusts the SelectedIndex property in the visual element let selectedIndex (value: int) (x: ViewElement) = x.SelectedIndex(value) - /// Adjusts the Title property in the visual element let title (value: string) (x: ViewElement) = x.Title(value) - /// Adjusts the SelectedIndexChanged property in the visual element let selectedIndexChanged (value: (int * 'T option) -> unit) (x: ViewElement) = x.SelectedIndexChanged(value) - /// Adjusts the FrameCornerRadius property in the visual element let frameCornerRadius (value: double) (x: ViewElement) = x.FrameCornerRadius(value) - /// Adjusts the HasShadow property in the visual element let hasShadow (value: bool) (x: ViewElement) = x.HasShadow(value) - /// Adjusts the ImageSource property in the visual element let imageSource (value: obj) (x: ViewElement) = x.ImageSource(value) - /// Adjusts the Aspect property in the visual element let aspect (value: Xamarin.Forms.Aspect) (x: ViewElement) = x.Aspect(value) - /// Adjusts the IsOpaque property in the visual element let isOpaque (value: bool) (x: ViewElement) = x.IsOpaque(value) - /// Adjusts the ImageButtonCommand property in the visual element let imageButtonCommand (value: unit -> unit) (x: ViewElement) = x.ImageButtonCommand(value) - /// Adjusts the ImageButtonCornerRadius property in the visual element let imageButtonCornerRadius (value: int) (x: ViewElement) = x.ImageButtonCornerRadius(value) - /// Adjusts the Clicked property in the visual element let clicked (value: System.EventArgs -> unit) (x: ViewElement) = x.Clicked(value) - /// Adjusts the Pressed property in the visual element let pressed (value: System.EventArgs -> unit) (x: ViewElement) = x.Pressed(value) - /// Adjusts the Released property in the visual element let released (value: System.EventArgs -> unit) (x: ViewElement) = x.Released(value) - /// Adjusts the Keyboard property in the visual element let keyboard (value: Xamarin.Forms.Keyboard) (x: ViewElement) = x.Keyboard(value) - /// Adjusts the EditorCompleted property in the visual element let editorCompleted (value: string -> unit) (x: ViewElement) = x.EditorCompleted(value) - /// Adjusts the TextChanged property in the visual element let textChanged (value: Xamarin.Forms.TextChangedEventArgs -> unit) (x: ViewElement) = x.TextChanged(value) - /// Adjusts the AutoSize property in the visual element let autoSize (value: Xamarin.Forms.EditorAutoSizeOption) (x: ViewElement) = x.AutoSize(value) - /// Adjusts the IsPassword property in the visual element let isPassword (value: bool) (x: ViewElement) = x.IsPassword(value) - /// Adjusts the EntryCompleted property in the visual element let entryCompleted (value: string -> unit) (x: ViewElement) = x.EntryCompleted(value) - /// Adjusts the IsTextPredictionEnabled property in the visual element let isTextPredictionEnabled (value: bool) (x: ViewElement) = x.IsTextPredictionEnabled(value) - /// Adjusts the ReturnType property in the visual element let returnType (value: Xamarin.Forms.ReturnType) (x: ViewElement) = x.ReturnType(value) - /// Adjusts the ReturnCommand property in the visual element let returnCommand (value: unit -> unit) (x: ViewElement) = x.ReturnCommand(value) - /// Adjusts the CursorPosition property in the visual element let cursorPosition (value: int) (x: ViewElement) = x.CursorPosition(value) - /// Adjusts the SelectionLength property in the visual element let selectionLength (value: int) (x: ViewElement) = x.SelectionLength(value) - /// Adjusts the Label property in the visual element let label (value: string) (x: ViewElement) = x.Label(value) - /// Adjusts the EntryCellTextChanged property in the visual element let entryCellTextChanged (value: Xamarin.Forms.TextChangedEventArgs -> unit) (x: ViewElement) = x.EntryCellTextChanged(value) - /// Adjusts the VerticalTextAlignment property in the visual element let verticalTextAlignment (value: Xamarin.Forms.TextAlignment) (x: ViewElement) = x.VerticalTextAlignment(value) - /// Adjusts the FormattedText property in the visual element let formattedText (value: ViewElement) (x: ViewElement) = x.FormattedText(value) - /// Adjusts the LineBreakMode property in the visual element let lineBreakMode (value: Xamarin.Forms.LineBreakMode) (x: ViewElement) = x.LineBreakMode(value) - /// Adjusts the LineHeight property in the visual element let lineHeight (value: double) (x: ViewElement) = x.LineHeight(value) - /// Adjusts the MaxLines property in the visual element let maxLines (value: int) (x: ViewElement) = x.MaxLines(value) - /// Adjusts the TextDecorations property in the visual element let textDecorations (value: Xamarin.Forms.TextDecorations) (x: ViewElement) = x.TextDecorations(value) - /// Adjusts the StackOrientation property in the visual element let stackOrientation (value: Xamarin.Forms.StackOrientation) (x: ViewElement) = x.StackOrientation(value) - /// Adjusts the Spacing property in the visual element let spacing (value: double) (x: ViewElement) = x.Spacing(value) - /// Adjusts the ForegroundColor property in the visual element let foregroundColor (value: Xamarin.Forms.Color) (x: ViewElement) = x.ForegroundColor(value) - /// Adjusts the PropertyChanged property in the visual element let propertyChanged (value: System.ComponentModel.PropertyChangedEventArgs -> unit) (x: ViewElement) = x.PropertyChanged(value) - /// Adjusts the Spans property in the visual element let spans (value: ViewElement[]) (x: ViewElement) = x.Spans(value) - /// Adjusts the Time property in the visual element let time (value: System.TimeSpan) (x: ViewElement) = x.Time(value) - /// Adjusts the WebSource property in the visual element let webSource (value: Xamarin.Forms.WebViewSource) (x: ViewElement) = x.WebSource(value) - /// Adjusts the Reload property in the visual element let reload (value: bool) (x: ViewElement) = x.Reload(value) - /// Adjusts the Navigated property in the visual element let navigated (value: Xamarin.Forms.WebNavigatedEventArgs -> unit) (x: ViewElement) = x.Navigated(value) - /// Adjusts the Navigating property in the visual element let navigating (value: Xamarin.Forms.WebNavigatingEventArgs -> unit) (x: ViewElement) = x.Navigating(value) - /// Adjusts the ReloadRequested property in the visual element let reloadRequested (value: System.EventArgs -> unit) (x: ViewElement) = x.ReloadRequested(value) - /// Adjusts the BackgroundImage property in the visual element let backgroundImage (value: string) (x: ViewElement) = x.BackgroundImage(value) - /// Adjusts the Icon property in the visual element let icon (value: string) (x: ViewElement) = x.Icon(value) - /// Adjusts the IsBusy property in the visual element let isBusy (value: bool) (x: ViewElement) = x.IsBusy(value) - /// Adjusts the ToolbarItems property in the visual element let toolbarItems (value: ViewElement list) (x: ViewElement) = x.ToolbarItems(value) - /// Adjusts the UseSafeArea property in the visual element let useSafeArea (value: bool) (x: ViewElement) = x.UseSafeArea(value) - /// Adjusts the Page_Appearing property in the visual element let page_Appearing (value: unit -> unit) (x: ViewElement) = x.Page_Appearing(value) - /// Adjusts the Page_Disappearing property in the visual element let page_Disappearing (value: unit -> unit) (x: ViewElement) = x.Page_Disappearing(value) - /// Adjusts the Page_LayoutChanged property in the visual element let page_LayoutChanged (value: unit -> unit) (x: ViewElement) = x.Page_LayoutChanged(value) - /// Adjusts the CarouselPage_CurrentPage property in the visual element let carouselPage_CurrentPage (value: int) (x: ViewElement) = x.CarouselPage_CurrentPage(value) - /// Adjusts the CarouselPage_CurrentPageChanged property in the visual element let carouselPage_CurrentPageChanged (value: int option -> unit) (x: ViewElement) = x.CarouselPage_CurrentPageChanged(value) - /// Adjusts the Pages property in the visual element let pages (value: ViewElement list) (x: ViewElement) = x.Pages(value) - /// Adjusts the BackButtonTitle property in the visual element let backButtonTitle (value: string) (x: ViewElement) = x.BackButtonTitle(value) - /// Adjusts the HasBackButton property in the visual element let hasBackButton (value: bool) (x: ViewElement) = x.HasBackButton(value) - /// Adjusts the HasNavigationBar property in the visual element let hasNavigationBar (value: bool) (x: ViewElement) = x.HasNavigationBar(value) - /// Adjusts the TitleIcon property in the visual element let titleIcon (value: string) (x: ViewElement) = x.TitleIcon(value) - /// Adjusts the TitleView property in the visual element let titleView (value: ViewElement) (x: ViewElement) = x.TitleView(value) - /// Adjusts the BarBackgroundColor property in the visual element let barBackgroundColor (value: Xamarin.Forms.Color) (x: ViewElement) = x.BarBackgroundColor(value) - /// Adjusts the BarTextColor property in the visual element let barTextColor (value: Xamarin.Forms.Color) (x: ViewElement) = x.BarTextColor(value) - /// Adjusts the Popped property in the visual element let popped (value: Xamarin.Forms.NavigationEventArgs -> unit) (x: ViewElement) = x.Popped(value) - /// Adjusts the PoppedToRoot property in the visual element let poppedToRoot (value: Xamarin.Forms.NavigationEventArgs -> unit) (x: ViewElement) = x.PoppedToRoot(value) - /// Adjusts the Pushed property in the visual element let pushed (value: Xamarin.Forms.NavigationEventArgs -> unit) (x: ViewElement) = x.Pushed(value) - /// Adjusts the TabbedPage_CurrentPage property in the visual element let tabbedPage_CurrentPage (value: int) (x: ViewElement) = x.TabbedPage_CurrentPage(value) - /// Adjusts the TabbedPage_CurrentPageChanged property in the visual element let tabbedPage_CurrentPageChanged (value: int option -> unit) (x: ViewElement) = x.TabbedPage_CurrentPageChanged(value) - /// Adjusts the OnSizeAllocatedCallback property in the visual element let onSizeAllocatedCallback (value: (double * double) -> unit) (x: ViewElement) = x.OnSizeAllocatedCallback(value) - /// Adjusts the Master property in the visual element let master (value: ViewElement) (x: ViewElement) = x.Master(value) - /// Adjusts the Detail property in the visual element let detail (value: ViewElement) (x: ViewElement) = x.Detail(value) - /// Adjusts the IsGestureEnabled property in the visual element let isGestureEnabled (value: bool) (x: ViewElement) = x.IsGestureEnabled(value) - /// Adjusts the IsPresented property in the visual element let isPresented (value: bool) (x: ViewElement) = x.IsPresented(value) - /// Adjusts the MasterBehavior property in the visual element let masterBehavior (value: Xamarin.Forms.MasterBehavior) (x: ViewElement) = x.MasterBehavior(value) - /// Adjusts the IsPresentedChanged property in the visual element let isPresentedChanged (value: bool -> unit) (x: ViewElement) = x.IsPresentedChanged(value) - /// Adjusts the Accelerator property in the visual element let accelerator (value: string) (x: ViewElement) = x.Accelerator(value) - /// Adjusts the TextDetail property in the visual element let textDetail (value: string) (x: ViewElement) = x.TextDetail(value) - /// Adjusts the TextDetailColor property in the visual element let textDetailColor (value: Xamarin.Forms.Color) (x: ViewElement) = x.TextDetailColor(value) - /// Adjusts the TextCellCommand property in the visual element let textCellCommand (value: unit -> unit) (x: ViewElement) = x.TextCellCommand(value) - /// Adjusts the TextCellCanExecute property in the visual element let textCellCanExecute (value: bool) (x: ViewElement) = x.TextCellCanExecute(value) - /// Adjusts the Order property in the visual element let order (value: Xamarin.Forms.ToolbarItemOrder) (x: ViewElement) = x.Order(value) - /// Adjusts the Priority property in the visual element let priority (value: int) (x: ViewElement) = x.Priority(value) - /// Adjusts the View property in the visual element let view (value: ViewElement) (x: ViewElement) = x.View(value) - /// Adjusts the ListViewItems property in the visual element let listViewItems (value: seq) (x: ViewElement) = x.ListViewItems(value) - /// Adjusts the Footer property in the visual element let footer (value: System.Object) (x: ViewElement) = x.Footer(value) - /// Adjusts the Header property in the visual element let header (value: System.Object) (x: ViewElement) = x.Header(value) - /// Adjusts the HeaderTemplate property in the visual element let headerTemplate (value: Xamarin.Forms.DataTemplate) (x: ViewElement) = x.HeaderTemplate(value) - /// Adjusts the IsGroupingEnabled property in the visual element let isGroupingEnabled (value: bool) (x: ViewElement) = x.IsGroupingEnabled(value) - /// Adjusts the IsPullToRefreshEnabled property in the visual element let isPullToRefreshEnabled (value: bool) (x: ViewElement) = x.IsPullToRefreshEnabled(value) - /// Adjusts the IsRefreshing property in the visual element let isRefreshing (value: bool) (x: ViewElement) = x.IsRefreshing(value) - /// Adjusts the RefreshCommand property in the visual element let refreshCommand (value: unit -> unit) (x: ViewElement) = x.RefreshCommand(value) - /// Adjusts the ListView_SelectedItem property in the visual element let listView_SelectedItem (value: int option) (x: ViewElement) = x.ListView_SelectedItem(value) - /// Adjusts the ListView_SeparatorVisibility property in the visual element let listView_SeparatorVisibility (value: Xamarin.Forms.SeparatorVisibility) (x: ViewElement) = x.ListView_SeparatorVisibility(value) - /// Adjusts the ListView_SeparatorColor property in the visual element let listView_SeparatorColor (value: Xamarin.Forms.Color) (x: ViewElement) = x.ListView_SeparatorColor(value) - /// Adjusts the ListView_ItemAppearing property in the visual element let listView_ItemAppearing (value: int -> unit) (x: ViewElement) = x.ListView_ItemAppearing(value) - /// Adjusts the ListView_ItemDisappearing property in the visual element let listView_ItemDisappearing (value: int -> unit) (x: ViewElement) = x.ListView_ItemDisappearing(value) - /// Adjusts the ListView_ItemSelected property in the visual element let listView_ItemSelected (value: int option -> unit) (x: ViewElement) = x.ListView_ItemSelected(value) - /// Adjusts the ListView_ItemTapped property in the visual element let listView_ItemTapped (value: int -> unit) (x: ViewElement) = x.ListView_ItemTapped(value) - /// Adjusts the ListView_Refreshing property in the visual element let listView_Refreshing (value: unit -> unit) (x: ViewElement) = x.ListView_Refreshing(value) - /// Adjusts the SelectionMode property in the visual element let selectionMode (value: Xamarin.Forms.ListViewSelectionMode) (x: ViewElement) = x.SelectionMode(value) - /// Adjusts the ListViewGrouped_ItemsSource property in the visual element let listViewGrouped_ItemsSource (value: (string * ViewElement * ViewElement list) list) (x: ViewElement) = x.ListViewGrouped_ItemsSource(value) - /// Adjusts the ListViewGrouped_ShowJumpList property in the visual element let listViewGrouped_ShowJumpList (value: bool) (x: ViewElement) = x.ListViewGrouped_ShowJumpList(value) - /// Adjusts the ListViewGrouped_SelectedItem property in the visual element let listViewGrouped_SelectedItem (value: (int * int) option) (x: ViewElement) = x.ListViewGrouped_SelectedItem(value) - /// Adjusts the SeparatorVisibility property in the visual element let separatorVisibility (value: Xamarin.Forms.SeparatorVisibility) (x: ViewElement) = x.SeparatorVisibility(value) - /// Adjusts the SeparatorColor property in the visual element let separatorColor (value: Xamarin.Forms.Color) (x: ViewElement) = x.SeparatorColor(value) - /// Adjusts the ListViewGrouped_ItemAppearing property in the visual element let listViewGrouped_ItemAppearing (value: int * int option -> unit) (x: ViewElement) = x.ListViewGrouped_ItemAppearing(value) - /// Adjusts the ListViewGrouped_ItemDisappearing property in the visual element let listViewGrouped_ItemDisappearing (value: int * int option -> unit) (x: ViewElement) = x.ListViewGrouped_ItemDisappearing(value) - /// Adjusts the ListViewGrouped_ItemSelected property in the visual element let listViewGrouped_ItemSelected (value: (int * int) option -> unit) (x: ViewElement) = x.ListViewGrouped_ItemSelected(value) - /// Adjusts the ListViewGrouped_ItemTapped property in the visual element let listViewGrouped_ItemTapped (value: int * int -> unit) (x: ViewElement) = x.ListViewGrouped_ItemTapped(value) - /// Adjusts the Refreshing property in the visual element let refreshing (value: unit -> unit) (x: ViewElement) = x.Refreshing(value) diff --git a/tests/Generator.Tests/CodeGeneratorPreparationTests.fs b/tests/Generator.Tests/CodeGeneratorPreparationTests.fs new file mode 100644 index 000000000..2ca48ac32 --- /dev/null +++ b/tests/Generator.Tests/CodeGeneratorPreparationTests.fs @@ -0,0 +1,263 @@ +// Copyright 2018 Fabulous contributors. See LICENSE.md for license. +namespace Generator.Tests + +open NUnit.Framework +open FsUnit +open Fabulous.Generator +open Fabulous.Generator.CodeGeneratorPreparation +open Fabulous.Generator.CodeGeneratorModels + +module ``CodeGeneratorPreparation Tests`` = + let preparedType = + { Name = "PreparedTypeName" + FullName = "PreparedTypeFullName" + BaseName = Some "PreparedTypeBaseName" + CustomTypeFullName = "PreparedTypeCustomTypeFullName" + HasCustomConstructor = false + Members = + [| { Name = "Member1Name" + UniqueName = "Member1UniqueName" + LowerShortName = "Member1LowerShortName" + LowerUniqueName = "Member1LowerUniqueName" + InputType = "Member1InputType" + ModelType = "Member1ModelType" + ConvToModel = "Member1ConvToModel" + DefaultValue = "Member1DefaultValue" + ConvToValue = "Member1ConvToValue" + UpdateCode = "Member1UpdateCode" + ElementTypeFullName = None + BoundType = None + IsParameter = true + IsImmediateMember = false + AttachedMembers = [||] } + { Name = "Member2Name" + UniqueName = "Member2UniqueName" + LowerShortName = "Member2LowerShortName" + LowerUniqueName = "Member2LowerUniqueName" + InputType = "Member2InputType" + ModelType = "Member2ModelType" + ConvToModel = "Member2ConvToModel" + DefaultValue = "Member2DefaultValue" + ConvToValue = "Member2ConvToValue" + UpdateCode = "Member2UpdateCode" + ElementTypeFullName = Some "Member2ElementTypeNameFullName" + BoundType = Some { Name = "Member2BoundTypeName"; FullName = "Member2BoundTypeFullName" } + IsParameter = false + IsImmediateMember = true + AttachedMembers = + [| { Name = "Member2AttachedMember1Name" + UniqueName = "Member2AttachedMember1UniqueName" + LowerShortName = "Member2AttachedMember1LowerShortName" + LowerUniqueName = "Member2AttachedMember1LowerUniqueName" + InputType = "Member2AttachedMember1InputType" + ModelType = "Member2AttachedMember1ModelType" + ConvToModel = "Member2AttachedMember1ConvToModel" + DefaultValue = "Member2AttachedMember1DefaultValue" + ConvToValue = "Member2AttachedMember1ConvToValue" + UpdateCode = "Member2AttachedMember1UpdateCode" + ElementTypeFullName = None + BoundType = None + IsParameter = false + IsImmediateMember = true + AttachedMembers = [||] } |] } |] } + + let preparedTypes = [| preparedType |] + + [] + let ``extractAttributes should return a valid array of unique attribute names``() = + let expected = [| "Member1UniqueName"; "Member2UniqueName"; "Member2AttachedMember1UniqueName" |] + + preparedTypes |> CodeGeneratorPreparation.extractAttributes |> should equal expected + + + [] + let ``toProtoData should return the name of the type``() = + preparedType |> CodeGeneratorPreparation.toProtoData |> should equal "PreparedTypeName" + + [] + let ``toBuildData should return a valid BuildData``() = + let expectedBuildData = + { Name = "PreparedTypeName" + BaseName = Some "PreparedTypeBaseName" + Members = + [| { Name = "Member1LowerShortName" + UniqueName = "Member1UniqueName" + InputType = "Member1InputType" + ConvToModel = "Member1ConvToModel" + IsInherited = true } + { Name = "Member2LowerShortName" + UniqueName = "Member2UniqueName" + InputType = "Member2InputType" + ConvToModel = "Member2ConvToModel" + IsInherited = false } |] } + + preparedType |> CodeGeneratorPreparation.toBuildData |> should equal expectedBuildData + + [] + let ``toCreateData should return a valid CreateData``() = + let expectedCreateData = + { Name = "PreparedTypeName" + FullName = "PreparedTypeFullName" + HasCustomConstructor = false + TypeToInstantiate = "PreparedTypeCustomTypeFullName" + Parameters = [| "Member1LowerShortName" |] } + + preparedType |> CodeGeneratorPreparation.toCreateData |> should equal expectedCreateData + + [] + let ``toUpdateData should return a valid UpdateData``() = + let knownTypes = [| "KnownType1"; "KnownType2" |] + + let expectedUpdateData = + { Name = "PreparedTypeName" + FullName = "PreparedTypeFullName" + BaseName = Some "PreparedTypeBaseName" + KnownTypes = knownTypes + ImmediateMembers = + [| { Name = "Member2Name" + UniqueName = "Member2UniqueName" + ModelType = "Member2ModelType" + DefaultValue = "Member2DefaultValue" + ConvToValue = "Member2ConvToValue" + UpdateCode = "Member2UpdateCode" + ElementTypeFullName = Some "Member2ElementTypeNameFullName" + IsParameter = false + BoundType = Some { Name = "Member2BoundTypeName"; FullName = "Member2BoundTypeFullName" } + Attached = + [| { Name = "Member2AttachedMember1Name" + UniqueName = "Member2AttachedMember1UniqueName" + ModelType = "Member2AttachedMember1ModelType" + DefaultValue = "Member2AttachedMember1DefaultValue" + ConvToValue = "Member2AttachedMember1ConvToValue" + UpdateCode = "Member2AttachedMember1UpdateCode" + ElementTypeFullName = None + IsParameter = false + BoundType = None + Attached = [||] } |] } |] } + + preparedType |> CodeGeneratorPreparation.toUpdateData knownTypes |> should equal expectedUpdateData + + [] + let ``toConstructData should return a valid ConstructData``() = + let expectedConstructData : ConstructData = + { Name = "PreparedTypeName" + FullName = "PreparedTypeFullName" + Members = + [| { LowerShortName = "Member1LowerShortName" + InputType = "Member1InputType" } + { LowerShortName = "Member2LowerShortName" + InputType = "Member2InputType" } |] } + + preparedType |> CodeGeneratorPreparation.toConstructData |> should equal expectedConstructData + + [] + let ``toBuilderData should return a valid BuilderData``() = + let knownTypes = [| "KnownType1"; "KnownType2" |] + + let expectedBuildData = + { Name = "PreparedTypeName" + BaseName = Some "PreparedTypeBaseName" + Members = + [| { Name = "Member1LowerShortName" + UniqueName = "Member1UniqueName" + InputType = "Member1InputType" + ConvToModel = "Member1ConvToModel" + IsInherited = true } + { Name = "Member2LowerShortName" + UniqueName = "Member2UniqueName" + InputType = "Member2InputType" + ConvToModel = "Member2ConvToModel" + IsInherited = false } |] } + let expectedCreateData = + { Name = "PreparedTypeName" + FullName = "PreparedTypeFullName" + HasCustomConstructor = false + TypeToInstantiate = "PreparedTypeCustomTypeFullName" + Parameters = [| "Member1LowerShortName" |] } + let expectedUpdateData = + { Name = "PreparedTypeName" + FullName = "PreparedTypeFullName" + BaseName = Some "PreparedTypeBaseName" + KnownTypes = knownTypes + ImmediateMembers = + [| { Name = "Member2Name" + UniqueName = "Member2UniqueName" + ModelType = "Member2ModelType" + DefaultValue = "Member2DefaultValue" + ConvToValue = "Member2ConvToValue" + UpdateCode = "Member2UpdateCode" + ElementTypeFullName = Some "Member2ElementTypeNameFullName" + IsParameter = false + BoundType = Some { Name = "Member2BoundTypeName"; FullName = "Member2BoundTypeFullName" } + Attached = + [| { Name = "Member2AttachedMember1Name" + UniqueName = "Member2AttachedMember1UniqueName" + ModelType = "Member2AttachedMember1ModelType" + DefaultValue = "Member2AttachedMember1DefaultValue" + ConvToValue = "Member2AttachedMember1ConvToValue" + UpdateCode = "Member2AttachedMember1UpdateCode" + ElementTypeFullName = None + IsParameter = false + BoundType = None + Attached = [||] } |] } |] } + let expectedConstructData : ConstructData = + { Name = "PreparedTypeName" + FullName = "PreparedTypeFullName" + Members = + [| { LowerShortName = "Member1LowerShortName" + InputType = "Member1InputType" } + { LowerShortName = "Member2LowerShortName" + InputType = "Member2InputType" } |] } + let expectedBuilderData = + { Build = expectedBuildData + Create = expectedCreateData + Update = expectedUpdateData + Construct = expectedConstructData } + + preparedType |> CodeGeneratorPreparation.toBuilderData knownTypes |> should equal expectedBuilderData + + [] + let ``toViewerData should return a valid ViewerData``() = + let expectedViewerData : ViewerData = + { Name = "PreparedTypeName" + FullName = "PreparedTypeFullName" + BaseName = Some "PreparedTypeBaseName" + Members = + [| { Name = "Member2Name" + UniqueName = "Member2UniqueName" } |]} + + preparedType |> CodeGeneratorPreparation.toViewerData |> should equal expectedViewerData + + [] + let ``toConstructorData should return a valid ConstructorData``() = + let expectedConstructorData = + { Name = "PreparedTypeName" + FullName = "PreparedTypeFullName" + Members = + [| { LowerShortName = "Member1LowerShortName" + InputType = "Member1InputType" } + { LowerShortName = "Member2LowerShortName" + InputType = "Member2InputType" } |]} + + preparedType |> CodeGeneratorPreparation.toConstructorData |> should equal expectedConstructorData + + [] + let ``getViewExtensionsData should return a valid array of ViewExtensionsData``() = + let expected = + [| { LowerShortName = "Member1LowerShortName" + LowerUniqueName = "Member1LowerUniqueName" + UniqueName = "Member1UniqueName" + InputType = "Member1InputType" + ConvToModel = "Member1ConvToModel" } + { LowerShortName = "Member2LowerShortName" + LowerUniqueName = "Member2LowerUniqueName" + UniqueName = "Member2UniqueName" + InputType = "Member2InputType" + ConvToModel = "Member2ConvToModel" } + { LowerShortName = "Member2AttachedMember1LowerShortName" + LowerUniqueName = "Member2AttachedMember1LowerUniqueName" + UniqueName = "Member2AttachedMember1UniqueName" + InputType = "Member2AttachedMember1InputType" + ConvToModel = "Member2AttachedMember1ConvToModel" } |] + + preparedTypes |> CodeGeneratorPreparation.getViewExtensionsData |> should equal expected \ No newline at end of file diff --git a/tests/Generator.Tests/CodeGeneratorTests.fs b/tests/Generator.Tests/CodeGeneratorTests.fs index 17949e021..c9f947b34 100644 --- a/tests/Generator.Tests/CodeGeneratorTests.fs +++ b/tests/Generator.Tests/CodeGeneratorTests.fs @@ -10,21 +10,25 @@ module ``CodeGenerator Tests`` = let testFunc func data (expectedStr: string) = let expected = expectedStr.Replace("\r\n", "\n").Substring(1) use w = new StringWriter() - func data w + func data w |> ignore let actual = w.ToString().Replace("\r\n", "\n") actual |> should equal expected - let testGenerateNamespaceAndClass = testFunc generateNamespaceAndClass + let testGenerateNamespace = testFunc generateNamespace let testGenerateAttributes = testFunc generateAttributes + let testGenerateProto = testFunc generateProto let testGenerateBuildFunction = testFunc generateBuildFunction + let testGenerateCreateFunction = testFunc generateCreateFunction let testGenerateUpdateFunction = testFunc generateUpdateFunction - let testGenerateConstructor = testFunc generateConstructor - let testGenerateProto = testFunc generateProto + let testGenerateConstruct = testFunc generateConstruct + let testGenerateBuilders = testFunc generateBuilders + let testGenerateViewers = testFunc generateViewers + let testGenerateConstructors = testFunc generateConstructors let testGenerateViewExtensions = testFunc generateViewExtensions [] - let ``generateNamespaceAndClass should generate the namespace and View type``() = - testGenerateNamespaceAndClass + let ``testGenerateNamespace should generate the namespace``() = + testGenerateNamespace "Fabulous.DynamicViews" """ // Copyright 2018 Fabulous contributors. See LICENSE.md for license. @@ -34,19 +38,32 @@ namespace Fabulous.DynamicViews #nowarn "66" // cast always holds #nowarn "67" // cast always holds -type View() = """ [] let ``generateAttributes should generate the attributes``() = testGenerateAttributes [| "Property1" - "Property2" |] + "Property2" + "ElementCreated" |] """ - [] - static member val _Property1AttribKey : AttributeKey<_> = AttributeKey<_>("Property1") - [] - static member val _Property2AttribKey : AttributeKey<_> = AttributeKey<_>("Property2") +module ViewAttributes = + let Property1AttribKey : AttributeKey<_> = AttributeKey<_>("Property1") + let Property2AttribKey : AttributeKey<_> = AttributeKey<_>("Property2") + let ElementCreatedAttribKey : AttributeKey<(obj -> unit)> = AttributeKey<(obj -> unit)>("ElementCreated") + +""" + + [] + let ``generateProto should generate the Proto properties``() = + testGenerateProto + [| "Type1" + "Type2" |] + """ +type ViewProto() = + static member val ProtoType1 : ViewElement option = None with get, set + static member val ProtoType2 : ViewElement option = None with get, set + """ [] @@ -57,10 +74,10 @@ type View() = Members = [| |] } """ /// Builds the attributes for a View in the view - [] static member inline BuildView(attribCount: int) = let attribBuilder = new AttributesBuilder(attribCount) attribBuilder + """ [] @@ -71,10 +88,10 @@ type View() = Members = [| |] } """ /// Builds the attributes for a Button in the view - [] static member inline BuildButton(attribCount: int) = - let attribBuilder = View.BuildView(attribCount) + let attribBuilder = ViewBuilders.BuildView(attribCount) attribBuilder + """ [] @@ -85,15 +102,15 @@ type View() = Members = [| { Name = "text"; UniqueName = "Text"; InputType = "string"; ConvToModel = ""; IsInherited = false } |] } """ /// Builds the attributes for a Button in the view - [] static member inline BuildButton(attribCount: int, ?text: string) = let attribCount = match text with Some _ -> attribCount + 1 | None -> attribCount let attribBuilder = new AttributesBuilder(attribCount) - match text with None -> () | Some v -> attribBuilder.Add(View._TextAttribKey, (v)) + match text with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextAttribKey, (v)) attribBuilder + """ [] @@ -104,11 +121,11 @@ type View() = Members = [| { Name = "id"; UniqueName = "Id"; InputType = "string"; ConvToModel = ""; IsInherited = true } |] } """ /// Builds the attributes for a Button in the view - [] static member inline BuildButton(attribCount: int, ?id: string) = - let attribBuilder = View.BuildView(attribCount, ?id=id) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?id=id) attribBuilder + """ [] @@ -116,17 +133,15 @@ type View() = testGenerateBuildFunction { Name = "Slider" BaseName = Some "View" - Members = [| - { Name = "minimumMaximum"; UniqueName = "MinimumMaximum"; InputType = "float * float"; ConvToModel = ""; IsInherited = false } - { Name = "value"; UniqueName = "Value"; InputType = "double"; ConvToModel = ""; IsInherited = false } - { Name = "valueChanged"; UniqueName = "ValueChanged"; InputType = "Xamarin.Forms.ValueChangedEventArgs -> unit"; ConvToModel = "(fun f -> System.EventHandler(fun _sender args -> f args))"; IsInherited = false } - { Name = "horizontalOptions"; UniqueName = "HorizontalOptions"; InputType = "Xamarin.Forms.LayoutOptions"; ConvToModel = ""; IsInherited = true } - { Name = "verticalOptions"; UniqueName = "VerticalOptions"; InputType = "Xamarin.Forms.LayoutOptions"; ConvToModel = ""; IsInherited = true } - { Name = "margin"; UniqueName = "Margin"; InputType = "obj"; ConvToModel = ""; IsInherited = true } - |] } + Members = + [| { Name = "minimumMaximum"; UniqueName = "MinimumMaximum"; InputType = "float * float"; ConvToModel = ""; IsInherited = false } + { Name = "value"; UniqueName = "Value"; InputType = "double"; ConvToModel = ""; IsInherited = false } + { Name = "valueChanged"; UniqueName = "ValueChanged"; InputType = "Xamarin.Forms.ValueChangedEventArgs -> unit"; ConvToModel = "(fun f -> System.EventHandler(fun _sender args -> f args))"; IsInherited = false } + { Name = "horizontalOptions"; UniqueName = "HorizontalOptions"; InputType = "Xamarin.Forms.LayoutOptions"; ConvToModel = ""; IsInherited = true } + { Name = "verticalOptions"; UniqueName = "VerticalOptions"; InputType = "Xamarin.Forms.LayoutOptions"; ConvToModel = ""; IsInherited = true } + { Name = "margin"; UniqueName = "Margin"; InputType = "obj"; ConvToModel = ""; IsInherited = true } |] } """ /// Builds the attributes for a Slider in the view - [] static member inline BuildSlider(attribCount: int, ?minimumMaximum: float * float, ?value: double, @@ -139,11 +154,64 @@ type View() = let attribCount = match value with Some _ -> attribCount + 1 | None -> attribCount let attribCount = match valueChanged with Some _ -> attribCount + 1 | None -> attribCount - let attribBuilder = View.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin) - match minimumMaximum with None -> () | Some v -> attribBuilder.Add(View._MinimumMaximumAttribKey, (v)) - match value with None -> () | Some v -> attribBuilder.Add(View._ValueAttribKey, (v)) - match valueChanged with None -> () | Some v -> attribBuilder.Add(View._ValueChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) + let attribBuilder = ViewBuilders.BuildView(attribCount, ?horizontalOptions=horizontalOptions, ?verticalOptions=verticalOptions, ?margin=margin) + match minimumMaximum with None -> () | Some v -> attribBuilder.Add(ViewAttributes.MinimumMaximumAttribKey, (v)) + match value with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ValueAttribKey, (v)) + match valueChanged with None -> () | Some v -> attribBuilder.Add(ViewAttributes.ValueChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(v)) attribBuilder + +""" + + [] + let ``generateCreateFunction should generate a create function with a custom constructor``() = + testGenerateCreateFunction + { Name = "ListView" + FullName = "Xamarin.Forms.ListView" + HasCustomConstructor = true + TypeToInstantiate = "Fabulous.DynamicViews.CustomListView" + Parameters = [||] } + """ + static member val CreateFuncListView : (unit -> Xamarin.Forms.ListView) = (fun () -> ViewBuilders.CreateListView()) + + static member CreateListView () : Xamarin.Forms.ListView = + failwith "can't create Xamarin.Forms.ListView" + +""" + + [] + let ``generateCreateFunction should generate a create function with no parameter``() = + testGenerateCreateFunction + { Name = "ListView" + FullName = "Xamarin.Forms.ListView" + HasCustomConstructor = false + TypeToInstantiate = "Fabulous.DynamicViews.CustomListView" + Parameters = [||] } + """ + static member val CreateFuncListView : (unit -> Xamarin.Forms.ListView) = (fun () -> ViewBuilders.CreateListView()) + + static member CreateListView () : Xamarin.Forms.ListView = + upcast (new Fabulous.DynamicViews.CustomListView()) + +""" + + // TODO : The related part makes little sense and it was really used, it would fail to compile. We need to investigate this. + [] + let ``generateCreateFunction should generate a create function with parameters``() = + testGenerateCreateFunction + { Name = "ListView" + FullName = "Xamarin.Forms.ListView" + HasCustomConstructor = false + TypeToInstantiate = "Fabulous.DynamicViews.CustomListView" + Parameters = [| "parameter1"; "parameter2" |] } + """ + static member val CreateFuncListView : (unit -> Xamarin.Forms.ListView) = (fun () -> ViewBuilders.CreateListView()) + + static member CreateListView () : Xamarin.Forms.ListView = + match parameter1, parameter2 with + | Some parameter1, Some parameter2 -> + upcast (new Fabulous.DynamicViews.CustomListView(parameter1, parameter2)) + | _ -> upcast (new Fabulous.DynamicViews.CustomListView()) + """ [] @@ -155,14 +223,14 @@ type View() = ImmediateMembers = [| |] KnownTypes = [| |] } """ - [] - static member val UpdateFuncIGestureRecognizer = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.IGestureRecognizer) -> View.UpdateIGestureRecognizer (prevOpt, curr, target)) + static member val UpdateFuncIGestureRecognizer = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.IGestureRecognizer) -> ViewBuilders.UpdateIGestureRecognizer (prevOpt, curr, target)) - [] static member UpdateIGestureRecognizer (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.IGestureRecognizer) = ignore prevOpt ignore curr ignore target + """ [] @@ -174,17 +242,17 @@ type View() = ImmediateMembers = [| |] KnownTypes = [| |] } """ - [] - static member val UpdateFuncTemplatedView = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TemplatedView) -> View.UpdateTemplatedView (prevOpt, curr, target)) + static member val UpdateFuncTemplatedView = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.TemplatedView) -> ViewBuilders.UpdateTemplatedView (prevOpt, curr, target)) - [] static member UpdateTemplatedView (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.TemplatedView) = // update the inherited Layout element - let baseElement = (if View.ProtoLayout.IsNone then View.ProtoLayout <- Some (View.Layout())); View.ProtoLayout.Value + let baseElement = (if ViewProto.ProtoLayout.IsNone then ViewProto.ProtoLayout <- Some (ViewBuilders.ConstructLayout())); ViewProto.ProtoLayout.Value baseElement.UpdateInherited (prevOpt, curr, target) ignore prevOpt ignore curr ignore target + """ [] @@ -193,33 +261,31 @@ type View() = { Name = "ListView" FullName = "Xamarin.Forms.ListView" BaseName = Some "View" - ImmediateMembers = [| - // Parameter - { Name = "Parameter"; UniqueName = "ListViewParameter"; ModelType = "bool"; DefaultValue = "false"; ConvToValue = ""; UpdateCode = ""; ElementTypeFullName = None; IsParameter = true; BoundType = None; Attached = [| |] } - // Collection property (no attached property - no UpdateCode - no ConvToValue) - { Name = "Collection"; UniqueName = "ListViewCollection"; ModelType = "bool list"; DefaultValue = "[]"; ConvToValue = ""; UpdateCode = ""; ElementTypeFullName = Some "bool"; IsParameter = false; BoundType = None; Attached = [| |] } - // Member with a known type (no UpdateCode - no ConvToValue) - { Name = "Content"; UniqueName = "ListViewContent"; ModelType = "Xamarin.Forms.View"; DefaultValue = "null"; ConvToValue = ""; UpdateCode = ""; ElementTypeFullName = None; IsParameter = false; BoundType = Some ("View", "Xamarin.Forms.View"); Attached = [| |] } - // Event (no UpdateCode - no ConvToValue) - { Name = "Event"; UniqueName = "ListViewEvent"; ModelType = "System.EventHandler"; DefaultValue = ""; ConvToValue = ""; UpdateCode = ""; ElementTypeFullName = None; IsParameter = false; BoundType = Some ("System.EventHandler", "System.EventHandler"); Attached = [| |] } - // Event with one generic type (no UpdateCode - no ConvToValue) - { Name = "ItemSelected"; UniqueName = "ListViewItemSelected"; ModelType = "System.EventHandler"; DefaultValue = ""; ConvToValue = ""; UpdateCode = ""; ElementTypeFullName = None; IsParameter = false; BoundType = Some ("System.EventHandler`1", "System.EventHandler"); Attached = [| |] } - // Member with custom UpdateCode - { Name = "Items"; UniqueName = "ListViewItems"; ModelType = "seq"; DefaultValue = ""; ConvToValue = ""; UpdateCode = "updateListViewItems"; ElementTypeFullName = Some "ViewElement"; IsParameter = false; BoundType = Some ("seq", "seq"); Attached = [| |] } - // Member with custom ConvToValue - { Name = "MemberConvToValue"; UniqueName = "ListViewMemberConvToValue"; ModelType = "string"; DefaultValue = "false"; ConvToValue = "bool"; UpdateCode = ""; ElementTypeFullName = None; IsParameter = false; BoundType = Some ("string", "System.String"); Attached = [| |] } - // Member (no UpdateCode - no ConvToValue) - { Name = "Member"; UniqueName = "ListViewMember"; ModelType = "bool"; DefaultValue = "false"; ConvToValue = ""; UpdateCode = ""; ElementTypeFullName = None; IsParameter = false; BoundType = Some ("bool", "System.Boolean"); Attached = [| |] } - |] + ImmediateMembers = + [| // Parameter + { Name = "Parameter"; UniqueName = "ListViewParameter"; ModelType = "bool"; DefaultValue = "false"; ConvToValue = ""; UpdateCode = ""; ElementTypeFullName = None; IsParameter = true; BoundType = None; Attached = [| |] } + // Collection property (no attached property - no UpdateCode - no ConvToValue) + { Name = "Collection"; UniqueName = "ListViewCollection"; ModelType = "bool list"; DefaultValue = "[]"; ConvToValue = ""; UpdateCode = ""; ElementTypeFullName = Some "bool"; IsParameter = false; BoundType = None; Attached = [| |] } + // Member with a known type (no UpdateCode - no ConvToValue) + { Name = "Content"; UniqueName = "ListViewContent"; ModelType = "Xamarin.Forms.View"; DefaultValue = "null"; ConvToValue = ""; UpdateCode = ""; ElementTypeFullName = None; IsParameter = false; BoundType = Some { Name = "View"; FullName = "Xamarin.Forms.View" }; Attached = [| |] } + // Event (no UpdateCode - no ConvToValue) + { Name = "Event"; UniqueName = "ListViewEvent"; ModelType = "System.EventHandler"; DefaultValue = ""; ConvToValue = ""; UpdateCode = ""; ElementTypeFullName = None; IsParameter = false; BoundType = Some { Name = "System.EventHandler"; FullName = "System.EventHandler" }; Attached = [| |] } + // Event with one generic type (no UpdateCode - no ConvToValue) + { Name = "ItemSelected"; UniqueName = "ListViewItemSelected"; ModelType = "System.EventHandler"; DefaultValue = ""; ConvToValue = ""; UpdateCode = ""; ElementTypeFullName = None; IsParameter = false; BoundType = Some { Name = "System.EventHandler`1"; FullName = "System.EventHandler" }; Attached = [| |] } + // Member with custom UpdateCode + { Name = "Items"; UniqueName = "ListViewItems"; ModelType = "seq"; DefaultValue = ""; ConvToValue = ""; UpdateCode = "updateListViewItems"; ElementTypeFullName = Some "ViewElement"; IsParameter = false; BoundType = Some { Name = "seq"; FullName = "seq" }; Attached = [| |] } + // Member with custom ConvToValue + { Name = "MemberConvToValue"; UniqueName = "ListViewMemberConvToValue"; ModelType = "string"; DefaultValue = "false"; ConvToValue = "bool"; UpdateCode = ""; ElementTypeFullName = None; IsParameter = false; BoundType = Some { Name = "string"; FullName = "System.String" }; Attached = [| |] } + // Member (no UpdateCode - no ConvToValue) + { Name = "Member"; UniqueName = "ListViewMember"; ModelType = "bool"; DefaultValue = "false"; ConvToValue = ""; UpdateCode = ""; ElementTypeFullName = None; IsParameter = false; BoundType = Some { Name = "bool"; FullName = "System.Boolean" }; Attached = [| |] } |] KnownTypes = [| "Xamarin.Forms.View" |] } """ - [] - static member val UpdateFuncListView = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ListView) -> View.UpdateListView (prevOpt, curr, target)) + static member val UpdateFuncListView = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.ListView) -> ViewBuilders.UpdateListView (prevOpt, curr, target)) - [] static member UpdateListView (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.ListView) = // update the inherited View element - let baseElement = (if View.ProtoView.IsNone then View.ProtoView <- Some (View.View())); View.ProtoView.Value + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value baseElement.UpdateInherited (prevOpt, curr, target) let mutable prevListViewParameterOpt = ValueNone let mutable currListViewParameterOpt = ValueNone @@ -238,41 +304,41 @@ type View() = let mutable prevListViewMemberOpt = ValueNone let mutable currListViewMemberOpt = ValueNone for kvp in curr.AttributesKeyed do - if kvp.Key = View._ListViewParameterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewParameterAttribKey.KeyValue then currListViewParameterOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._ListViewCollectionAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewCollectionAttribKey.KeyValue then currListViewCollectionOpt <- ValueSome (kvp.Value :?> bool list) - if kvp.Key = View._ListViewContentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewContentAttribKey.KeyValue then currListViewContentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.View) - if kvp.Key = View._ListViewEventAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewEventAttribKey.KeyValue then currListViewEventOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListViewItemSelectedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewItemSelectedAttribKey.KeyValue then currListViewItemSelectedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListViewItemsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewItemsAttribKey.KeyValue then currListViewItemsOpt <- ValueSome (kvp.Value :?> seq) - if kvp.Key = View._ListViewMemberConvToValueAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewMemberConvToValueAttribKey.KeyValue then currListViewMemberConvToValueOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._ListViewMemberAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewMemberAttribKey.KeyValue then currListViewMemberOpt <- ValueSome (kvp.Value :?> bool) match prevOpt with | ValueNone -> () | ValueSome prev -> for kvp in prev.AttributesKeyed do - if kvp.Key = View._ListViewParameterAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewParameterAttribKey.KeyValue then prevListViewParameterOpt <- ValueSome (kvp.Value :?> bool) - if kvp.Key = View._ListViewCollectionAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewCollectionAttribKey.KeyValue then prevListViewCollectionOpt <- ValueSome (kvp.Value :?> bool list) - if kvp.Key = View._ListViewContentAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewContentAttribKey.KeyValue then prevListViewContentOpt <- ValueSome (kvp.Value :?> Xamarin.Forms.View) - if kvp.Key = View._ListViewEventAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewEventAttribKey.KeyValue then prevListViewEventOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListViewItemSelectedAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewItemSelectedAttribKey.KeyValue then prevListViewItemSelectedOpt <- ValueSome (kvp.Value :?> System.EventHandler) - if kvp.Key = View._ListViewItemsAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewItemsAttribKey.KeyValue then prevListViewItemsOpt <- ValueSome (kvp.Value :?> seq) - if kvp.Key = View._ListViewMemberConvToValueAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewMemberConvToValueAttribKey.KeyValue then prevListViewMemberConvToValueOpt <- ValueSome (kvp.Value :?> string) - if kvp.Key = View._ListViewMemberAttribKey.KeyValue then + if kvp.Key = ViewAttributes.ListViewMemberAttribKey.KeyValue then prevListViewMemberOpt <- ValueSome (kvp.Value :?> bool) updateCollectionGeneric prevListViewCollectionOpt currListViewCollectionOpt target.Collection (fun (x:ViewElement) -> x.Create() :?> bool) @@ -312,69 +378,233 @@ type View() = | _, ValueSome currValue -> target.Member <- currValue | ValueSome _, ValueNone -> target.Member <- false | ValueNone, ValueNone -> () + """ [] - let ``generateConstructor should generate a constructor for a type with no member``() = - testGenerateConstructor + let ``generateConstruct should generate a construct function for a type with no member``() = + testGenerateConstruct { Name = "View" FullName = "Xamarin.Forms.View" - Members = [| - |]} + Members = [| |]} """ - /// Describes a View in the view - static member inline View() = + static member ConstructView() = - let attribBuilder = View.BuildView(0) + let attribBuilder = ViewBuilders.BuildView(0) + + ViewElement.Create(ViewBuilders.CreateFuncView, ViewBuilders.UpdateFuncView, attribBuilder) - ViewElement.Create(View.CreateFuncView, View.UpdateFuncView, attribBuilder) """ [] - let ``generateConstructor should generate a constructor for a type with members``() = - testGenerateConstructor + let ``generateConstruct should generate a construct function for a type with members``() = + testGenerateConstruct { Name = "Button" FullName = "Xamarin.Forms.Button" - Members = [| - "text", "string" - "canExecute", "bool" - "created", "" - "ref", "" - |]} + Members = + [| { LowerShortName = "text"; InputType = "string" } + { LowerShortName = "canExecute"; InputType = "bool" } + { LowerShortName = "created"; InputType = "" } + { LowerShortName = "ref"; InputType = "" } |] } """ - /// Describes a Button in the view - static member inline Button(?text: string, - ?canExecute: bool, - ?created: (Xamarin.Forms.Button -> unit), - ?ref: ViewRef) = + static member ConstructButton(?text: string, + ?canExecute: bool, + ?created: (Xamarin.Forms.Button -> unit), + ?ref: ViewRef) = - let attribBuilder = View.BuildButton(0, + let attribBuilder = ViewBuilders.BuildButton(0, ?text=text, ?canExecute=canExecute, ?created=(match created with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox target))), ?ref=(match ref with None -> None | Some (ref: ViewRef) -> Some ref.Unbox)) - ViewElement.Create(View.CreateFuncButton, View.UpdateFuncButton, attribBuilder) + ViewElement.Create(ViewBuilders.CreateFuncButton, ViewBuilders.UpdateFuncButton, attribBuilder) + """ + [] + let ``generateBuilders should generate all builder parts in a specific order``() = + let buildData : Fabulous.Generator.CodeGeneratorModels.BuildData = + { Name = "Button" + BaseName = Some "View" + Members = + [| { Name = "text"; UniqueName = "Text"; InputType = "string"; ConvToModel = ""; IsInherited = false } |] } + + let createData : Fabulous.Generator.CodeGeneratorModels.CreateData = + { Name = "Button" + FullName = "Xamarin.Forms.Button" + HasCustomConstructor = false + TypeToInstantiate = "Xamarin.Forms.Button" + Parameters = [||] } + + let updateData : Fabulous.Generator.CodeGeneratorModels.UpdateData = + { Name = "Button" + FullName = "Xamarin.Forms.Button" + BaseName = Some "View" + ImmediateMembers = + [| { Name = "Text" + UniqueName = "Text" + ModelType = "string" + DefaultValue = "null" + ConvToValue = "" + UpdateCode = "" + ElementTypeFullName = None + IsParameter = false + BoundType = None + Attached = [||] } |] + KnownTypes = [| |] } + + let constructData : Fabulous.Generator.CodeGeneratorModels.ConstructData = + { Name = "Button" + FullName = "Xamarin.Forms.Button" + Members = + [| { LowerShortName = "text" + InputType = "string" } |] } + + let buttonBuilderData : Fabulous.Generator.CodeGeneratorModels.BuilderData = + { Build = buildData + Create = createData + Update = updateData + Construct = constructData } + + testGenerateBuilders + [| buttonBuilderData |] + """ +type ViewBuilders() = + /// Builds the attributes for a Button in the view + static member inline BuildButton(attribCount: int, + ?text: string) = + + let attribCount = match text with Some _ -> attribCount + 1 | None -> attribCount + + let attribBuilder = ViewBuilders.BuildView(attribCount) + match text with None -> () | Some v -> attribBuilder.Add(ViewAttributes.TextAttribKey, (v)) + attribBuilder + + static member val CreateFuncButton : (unit -> Xamarin.Forms.Button) = (fun () -> ViewBuilders.CreateButton()) + + static member CreateButton () : Xamarin.Forms.Button = + upcast (new Xamarin.Forms.Button()) + + static member val UpdateFuncButton = + (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: Xamarin.Forms.Button) -> ViewBuilders.UpdateButton (prevOpt, curr, target)) + + static member UpdateButton (prevOpt: ViewElement voption, curr: ViewElement, target: Xamarin.Forms.Button) = + // update the inherited View element + let baseElement = (if ViewProto.ProtoView.IsNone then ViewProto.ProtoView <- Some (ViewBuilders.ConstructView())); ViewProto.ProtoView.Value + baseElement.UpdateInherited (prevOpt, curr, target) + let mutable prevTextOpt = ValueNone + let mutable currTextOpt = ValueNone + for kvp in curr.AttributesKeyed do + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then + currTextOpt <- ValueSome (kvp.Value :?> string) + match prevOpt with + | ValueNone -> () + | ValueSome prev -> + for kvp in prev.AttributesKeyed do + if kvp.Key = ViewAttributes.TextAttribKey.KeyValue then + prevTextOpt <- ValueSome (kvp.Value :?> string) + match prevTextOpt, currTextOpt with + | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () + | _, ValueSome currValue -> target.Text <- currValue + | ValueSome _, ValueNone -> target.Text <- null + | ValueNone, ValueNone -> () + + static member ConstructButton(?text: string) = + + let attribBuilder = ViewBuilders.BuildButton(0, + ?text=text) + + ViewElement.Create(ViewBuilders.CreateFuncButton, ViewBuilders.UpdateFuncButton, attribBuilder) + +""" [] - let ``generateProto should generate a static property``() = - testGenerateProto - "Button" + let ``generateViewers should generate helpers to help extract data from ViewElement``() = + testGenerateViewers + [| { Name = "Button" + FullName = "Xamarin.Forms.Button" + BaseName = None + Members = + [| { Name = "Text" + UniqueName = "ButtonText" } + { Name = "Command" + UniqueName = "ButtonCommand" } + { Name = "Ref" + UniqueName = "Ref" } + { Name = "Created" + UniqueName = "Created" } |] } + { Name = "Label" + FullName = "Xamarin.Forms.Label" + BaseName = Some "Element" + Members = + [| { Name = "Text" + UniqueName = "LabelText" } |] } |] """ - [] - static member val ProtoButton : ViewElement option = None with get, set +/// Viewer that allows to read the properties of a ViewElement representing a Button +type ButtonViewer(element: ViewElement) = + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Button' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Text property + member this.Text = element.GetAttributeKeyed(ViewAttributes.ButtonTextAttribKey) + /// Get the value of the Command property + member this.Command = element.GetAttributeKeyed(ViewAttributes.ButtonCommandAttribKey) + +/// Viewer that allows to read the properties of a ViewElement representing a Label +type LabelViewer(element: ViewElement) = + inherit ElementViewer(element) + do if not ((typeof).IsAssignableFrom(element.TargetType)) then failwithf "A ViewElement assignable to type 'Xamarin.Forms.Label' is expected, but '%s' was provided." element.TargetType.FullName + /// Get the value of the Text property + member this.Text = element.GetAttributeKeyed(ViewAttributes.LabelTextAttribKey) + +""" + + [] + let ``generateConstructors should generate constructors``() = + testGenerateConstructors + [| { Name = "Button" + FullName = "Xamarin.Forms.Button" + Members = + [| { LowerShortName = "text" + InputType = "string" } + { LowerShortName = "command" + InputType = "unit -> unit" } + { LowerShortName = "ref" + InputType = "" } + { LowerShortName = "created" + InputType = "" } |] } + { Name = "Label" + FullName = "Xamarin.Forms.Label" + Members = + [| { LowerShortName = "text" + InputType = "string" } |] } |] + """ +type View() = + /// Describes a Button in the view + static member inline Button(?text: string, + ?command: unit -> unit, + ?ref: ViewRef, + ?created: (Xamarin.Forms.Button -> unit)) = + + ViewBuilders.ConstructButton(?text=text, + ?command=command, + ?ref=ref, + ?created=created) + + /// Describes a Label in the view + static member inline Label(?text: string) = + + ViewBuilders.ConstructLabel(?text=text) + + """ [] let ``generateViewExtensions should generate helpers``() = testGenerateViewExtensions - { Members = - [| { LowerShortName = "created"; LowerUniqueName = "created"; UniqueName = "Created"; InputType = "Xamarin.Forms.Slider -> unit"; ConvToModel = "" } - { LowerShortName = "ref"; LowerUniqueName = "ref"; UniqueName = "Ref"; InputType = "ViewRef"; ConvToModel = "" } - { LowerShortName = "minimumMaximum"; LowerUniqueName = "minimumMaximum"; UniqueName = "MinimumMaximum"; InputType = "float * float"; ConvToModel = "" } - { LowerShortName = "valueChanged"; LowerUniqueName = "sliderValueChanged"; UniqueName = "SliderValueChanged"; InputType = "Xamarin.Forms.ValueChangedEventArgs -> unit"; ConvToModel = "(fun f -> System.EventHandler(fun _sender args -> f args))" } |]} + [| { LowerShortName = "created"; LowerUniqueName = "created"; UniqueName = "Created"; InputType = "Xamarin.Forms.Slider -> unit"; ConvToModel = "" } + { LowerShortName = "ref"; LowerUniqueName = "ref"; UniqueName = "Ref"; InputType = "ViewRef"; ConvToModel = "" } + { LowerShortName = "minimumMaximum"; LowerUniqueName = "minimumMaximum"; UniqueName = "MinimumMaximum"; InputType = "float * float"; ConvToModel = "" } + { LowerShortName = "valueChanged"; LowerUniqueName = "sliderValueChanged"; UniqueName = "SliderValueChanged"; InputType = "Xamarin.Forms.ValueChangedEventArgs -> unit"; ConvToModel = "(fun f -> System.EventHandler(fun _sender args -> f args))" } |] """ [] module ViewElementExtensions = @@ -382,15 +612,18 @@ module ViewElementExtensions = type ViewElement with /// Adjusts the MinimumMaximum property in the visual element - member x.MinimumMaximum(value: float * float) = x.WithAttribute(View._MinimumMaximumAttribKey, (value)) + member x.MinimumMaximum(value: float * float) = x.WithAttribute(ViewAttributes.MinimumMaximumAttribKey, (value)) /// Adjusts the SliderValueChanged property in the visual element - member x.SliderValueChanged(value: Xamarin.Forms.ValueChangedEventArgs -> unit) = x.WithAttribute(View._SliderValueChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.SliderValueChanged(value: Xamarin.Forms.ValueChangedEventArgs -> unit) = x.WithAttribute(ViewAttributes.SliderValueChangedAttribKey, (fun f -> System.EventHandler(fun _sender args -> f args))(value)) + member x.With(?minimumMaximum: float * float, ?sliderValueChanged: Xamarin.Forms.ValueChangedEventArgs -> unit) = + let x = match minimumMaximum with None -> x | Some opt -> x.MinimumMaximum(opt) + let x = match sliderValueChanged with None -> x | Some opt -> x.SliderValueChanged(opt) + x /// Adjusts the MinimumMaximum property in the visual element let minimumMaximum (value: float * float) (x: ViewElement) = x.MinimumMaximum(value) - /// Adjusts the SliderValueChanged property in the visual element let sliderValueChanged (value: Xamarin.Forms.ValueChangedEventArgs -> unit) (x: ViewElement) = x.SliderValueChanged(value) """ \ No newline at end of file diff --git a/tests/Generator.Tests/Generator.Tests.fsproj b/tests/Generator.Tests/Generator.Tests.fsproj index cb59edc16..70c77b8cc 100644 --- a/tests/Generator.Tests/Generator.Tests.fsproj +++ b/tests/Generator.Tests/Generator.Tests.fsproj @@ -8,6 +8,7 @@ + diff --git a/tools/Generator/AssemblyResolver.fs b/tools/Generator/AssemblyResolver.fs index 93c15929a..0412fc5c1 100644 --- a/tools/Generator/AssemblyResolver.fs +++ b/tools/Generator/AssemblyResolver.fs @@ -1,4 +1,4 @@ -// Copyright 2018 Fabulous contributors. See LICENSE.md for license. +// Copyright 2018 Fabulous contributors. See LICENSE.md for license. namespace Fabulous.Generator open Mono.Cecil @@ -7,7 +7,6 @@ open System.Collections.Generic module AssemblyResolver = type RegistrableResolver() = inherit BaseAssemblyResolver() - let cache = Dictionary() override this.Resolve(name) = @@ -18,18 +17,17 @@ module AssemblyResolver = cache.[name.FullName] <- assembly assembly - member this.RegisterAssembly(assembly: AssemblyDefinition): unit = + member this.RegisterAssembly(assembly : AssemblyDefinition) : unit = match cache.ContainsKey(assembly.Name.FullName) with | true -> () - | false -> - cache.[assembly.Name.FullName] <- assembly + | false -> cache.[assembly.Name.FullName] <- assembly member this.Dispose(disposing) = cache.Values |> Seq.iter (fun asm -> asm.Dispose()) cache.Clear() base.Dispose() - let loadAssembly (resolver: RegistrableResolver) (path: string) = + let loadAssembly (resolver : RegistrableResolver) (path : string) = let readerParameters = ReaderParameters() readerParameters.AssemblyResolver <- resolver let assembly = AssemblyDefinition.ReadAssembly(path, readerParameters) diff --git a/tools/Generator/CodeGenerator.Models.fs b/tools/Generator/CodeGenerator.Models.fs new file mode 100644 index 000000000..1a4cd71b0 --- /dev/null +++ b/tools/Generator/CodeGenerator.Models.fs @@ -0,0 +1,94 @@ +namespace Fabulous.Generator + +module CodeGeneratorModels = + type BoundType = + { Name: string + FullName: string } + + type ConstructType = + { LowerShortName: string + InputType: string } + + type ConstructorType = + { LowerShortName: string + InputType: string } + + type BuildMember = + { Name : string + UniqueName : string + InputType : string + ConvToModel : string + IsInherited : bool } + + type BuildData = + { Name : string + BaseName : string option + Members : BuildMember [] } + + type CreateData = + { Name : string + FullName : string + HasCustomConstructor : bool + TypeToInstantiate : string + Parameters : string [] } + + type UpdateMember = + { Name : string + UniqueName : string + ModelType : string + DefaultValue : string + ConvToValue : string + UpdateCode : string + ElementTypeFullName : string option + IsParameter : bool + BoundType : BoundType option + Attached : UpdateMember [] } + + type UpdateData = + { Name : string + FullName : string + BaseName : string option + ImmediateMembers : UpdateMember [] + KnownTypes : string [] } + + type ConstructData = + { Name : string + FullName : string + Members : ConstructType [] } + + type BuilderData = + { Build : BuildData + Create : CreateData + Update : UpdateData + Construct : ConstructData } + + type ViewerMember = + { Name : string + UniqueName : string } + + type ViewerData = + { Name : string + FullName : string + BaseName: string option + Members : ViewerMember [] } + + type ConstructorData = + { Name : string + FullName : string + Members : ConstructorType [] } + + type ViewExtensionsData = + { LowerShortName : string + LowerUniqueName : string + UniqueName : string + InputType : string + ConvToModel : string } + + type GeneratorData = + { Namespace : string + Attributes : string [] + Proto : string [] + Builders : BuilderData [] + Viewers : ViewerData [] + Constructors : ConstructorData [] + ViewExtensions : ViewExtensionsData [] } diff --git a/tools/Generator/CodeGenerator.Preparation.fs b/tools/Generator/CodeGenerator.Preparation.fs new file mode 100644 index 000000000..169c3f74b --- /dev/null +++ b/tools/Generator/CodeGenerator.Preparation.fs @@ -0,0 +1,237 @@ +namespace Fabulous.Generator + +open Fabulous.Generator.Models +open Fabulous.Generator.Helpers +open Fabulous.Generator.Resolvers +open Fabulous.Generator.CodeGeneratorModels +open System.Collections.Generic +open System.Linq +open Mono.Cecil + +module CodeGeneratorPreparation = + type PreparedMember = + { Name : string + UniqueName : string + LowerShortName : string + LowerUniqueName : string + InputType : string + ModelType : string + ConvToModel : string + DefaultValue : string + ConvToValue : string + UpdateCode : string + ElementTypeFullName : string option + BoundType : BoundType option + IsParameter : bool + IsImmediateMember : bool + AttachedMembers : PreparedMember [] } + + type PreparedType = + { Name : string + FullName : string + BaseName : string option + CustomTypeFullName : string + HasCustomConstructor : bool + Members : PreparedMember [] } + + let rec toPreparedMember isImmediateMember (bindings, memberResolutions, hierarchy) (m : MemberBinding) = + { Name = m.Name + UniqueName = m.BoundUniqueName + LowerShortName = m.LowerBoundShortName + LowerUniqueName = m.LowerBoundUniqueName + InputType = getInputType (m, bindings, memberResolutions, hierarchy) + ModelType = getModelType (m, bindings, memberResolutions, hierarchy) + ConvToModel = getValueOrDefault "" m.ConvToModel + DefaultValue = m.DefaultValue + ConvToValue = m.ConvToValue + UpdateCode = m.UpdateCode + ElementTypeFullName = getElementTypeFullName (m, memberResolutions, hierarchy) + BoundType = + tryGetBoundType memberResolutions m + |> Option.map (fun tref -> + { Name = tref.Name + FullName = tref.FullName }) + IsParameter = m.IsParam + IsImmediateMember = isImmediateMember + AttachedMembers = + if m.Attached <> null && m.Attached.Count > 0 then + m.Attached + |> Seq.map (toPreparedMember false (bindings, memberResolutions, hierarchy)) + |> Seq.toArray + else [||] } + + let extractAttributes (types : PreparedType []) = + [| for typ in types do + for m in typ.Members do + yield m.UniqueName + if (m.AttachedMembers.Length > 0) then + for ap in m.AttachedMembers do + yield ap.UniqueName |] + |> Seq.distinctBy id + |> Seq.toArray + + let toProtoData (typ : PreparedType) = typ.Name + + let toBuildData (typ : PreparedType) = + let toBuildMember (m : PreparedMember) = + { Name = m.LowerShortName + UniqueName = m.UniqueName + InputType = m.InputType + ConvToModel = m.ConvToModel + IsInherited = not m.IsImmediateMember } + { Name = typ.Name + BaseName = typ.BaseName + Members = typ.Members |> Array.map toBuildMember } + + let toCreateData (typ : PreparedType) = + { Name = typ.Name + FullName = typ.FullName + HasCustomConstructor = typ.HasCustomConstructor + TypeToInstantiate = typ.CustomTypeFullName + Parameters = + typ.Members + |> Array.filter (fun m -> m.IsParameter) + |> Array.map (fun m -> m.LowerShortName) } + + let toUpdateData knownTypes (typ : PreparedType) = + let rec toUpdateMember (m : PreparedMember) = + { Name = m.Name + UniqueName = m.UniqueName + ModelType = m.ModelType + DefaultValue = m.DefaultValue + ConvToValue = m.ConvToValue + UpdateCode = m.UpdateCode + ElementTypeFullName = m.ElementTypeFullName + IsParameter = m.IsParameter + BoundType = m.BoundType + Attached = m.AttachedMembers |> Array.map toUpdateMember } + { Name = typ.Name + FullName = typ.FullName + BaseName = typ.BaseName + KnownTypes = knownTypes + ImmediateMembers = + typ.Members + |> Array.filter (fun t -> t.IsImmediateMember) + |> Array.map toUpdateMember } + + let toConstructData (typ : PreparedType) : ConstructData = + let toConstructMember (m : PreparedMember) : ConstructType = + { LowerShortName = m.LowerShortName + InputType = m.InputType } + { Name = typ.Name + FullName = typ.FullName + Members = typ.Members |> Array.map toConstructMember } + + let toBuilderData (knownTypes : string []) (typ : PreparedType) = + { Build = typ |> toBuildData + Create = typ |> toCreateData + Update = typ |> (toUpdateData knownTypes) + Construct = typ |> toConstructData } + + let toViewerData (typ : PreparedType) : ViewerData = + let toViewerMember (m : PreparedMember) = + { Name = m.Name + UniqueName = m.UniqueName } + { Name = typ.Name + FullName = typ.FullName + BaseName = typ.BaseName + Members = typ.Members |> Array.filter (fun m -> m.IsImmediateMember) |> Array.map toViewerMember } + + let toConstructorData (typ : PreparedType) = + let toConstructorMember (m : PreparedMember) = + { LowerShortName = m.LowerShortName + InputType = m.InputType } + { Name = typ.Name + FullName = typ.FullName + Members = typ.Members |> Array.map toConstructorMember } + + let getViewExtensionsData (types : PreparedType []) = + let toViewExtensionsMember (m : PreparedMember) = + { LowerShortName = m.LowerShortName + LowerUniqueName = m.LowerUniqueName + UniqueName = m.UniqueName + InputType = m.InputType + ConvToModel = m.ConvToModel } + [| for typ in types do + if (typ.Members.Length > 0) then + for y in typ.Members do + yield y + if (y.AttachedMembers.Length > 0) then + for ap in y.AttachedMembers do + yield ap |] + |> Array.groupBy (fun y -> y.UniqueName) + |> Array.map (fun (_, members) -> members |> Array.head) + |> Array.map toViewExtensionsMember + + let getTypes (bindings : Bindings, + resolutions : IDictionary, + memberResolutions : IDictionary) = + [| for typ in bindings.Types do + let tdef = resolutions.[typ] + let nameOfCreator = getValueOrDefault tdef.Name typ.ModelName + let hierarchy = getHierarchy(tdef).ToList() + + let boundHierarchy = + hierarchy + |> Seq.choose + (fun (x, _) -> + bindings.Types + |> Seq.tryFind (fun y -> y.Name = x.FullName)) + |> Seq.toArray + + let baseTypeOpt = + if boundHierarchy.Length > 1 then Some boundHierarchy.[1] + else None + + let nameOfBaseCreatorOpt = + baseTypeOpt + |> Option.map (fun baseType -> + getValueOrDefault resolutions.[baseType].Name baseType.ModelName) + + let typeToInstantiate = + getValueOrDefault tdef.FullName typ.CustomType + + let ctor = + tdef.Methods.Where(fun x -> x.IsConstructor && x.IsPublic) + .OrderBy(fun x -> x.Parameters.Count) + .FirstOrDefault() + + let hasCustomConstructor = + (tdef.IsAbstract || ctor = null || ctor.Parameters.Count > 0) + + let inputs = (bindings, memberResolutions, hierarchy) + + let allBaseMembers = + boundHierarchy + |> Seq.skip (1) + |> Seq.collect (fun x -> x.Members) + |> Seq.toArray + |> Array.map (toPreparedMember false inputs) + + let allImmediateMembers = + typ.Members.ToArray() + |> Array.map (toPreparedMember true inputs) + + let allMembers = Array.append allImmediateMembers allBaseMembers + + yield { Name = nameOfCreator + FullName = tdef.FullName + BaseName = nameOfBaseCreatorOpt + CustomTypeFullName = typeToInstantiate + HasCustomConstructor = hasCustomConstructor + Members = allMembers } |] + + let prepareData (bindings : Bindings, + resolutions : IDictionary, + memberResolutions : IDictionary) = + + let types = getTypes (bindings, resolutions, memberResolutions) + let knownTypes = types |> Array.map (fun t -> t.FullName) + + { Namespace = bindings.OutputNamespace + Attributes = types |> extractAttributes + Proto = types |> Array.map toProtoData + Builders = types |> Array.map (toBuilderData knownTypes) + Viewers = types |> Array.map toViewerData + Constructors = types |> Array.map toConstructorData + ViewExtensions = types |> getViewExtensionsData } diff --git a/tools/Generator/CodeGenerator.fs b/tools/Generator/CodeGenerator.fs index 3f306efe0..f7b517b7e 100644 --- a/tools/Generator/CodeGenerator.fs +++ b/tools/Generator/CodeGenerator.fs @@ -1,69 +1,13 @@ // Copyright 2018 Fabulous contributors. See LICENSE.md for license. namespace Fabulous.Generator -open Fabulous.Generator.Models open Fabulous.Generator.Helpers -open Fabulous.Generator.Resolvers -open System.Collections.Generic -open System.Linq +open Fabulous.Generator.CodeGeneratorModels +open Fabulous.Generator.CodeGeneratorPreparation open System.IO -open Mono.Cecil module CodeGenerator = - type BuildMember = - { Name: string - UniqueName: string - InputType: string - ConvToModel: string - IsInherited: bool } - - type BuildData = - { Name: string - BaseName: string option - Members: BuildMember [] } - - type CreateData = - { Name: string - FullName: string - HasCustomConstructor: bool - TypeToInstantiate: string - Parameters: string [] } - - type UpdateMember = - { Name: string - UniqueName: string - ModelType: string - DefaultValue: string - ConvToValue: string - UpdateCode: string - ElementTypeFullName: string option - IsParameter: bool - BoundType: (string * string) option - Attached: UpdateMember [] } - - type UpdateData = - { Name: string - FullName: string - BaseName: string option - ImmediateMembers: UpdateMember [] - KnownTypes: string [] } - - type ConstructorData = - { Name: string - FullName: string - Members: (string * string) [] } - - type ViewExtensionsMember = - { LowerShortName: string - LowerUniqueName: string - UniqueName: string - InputType: string - ConvToModel: string } - - type ViewExtensionsData = - { Members: ViewExtensionsMember [] } - - let generateNamespaceAndClass (namespaceOfGeneratedCode: string) (w: StringWriter) = + let generateNamespace (namespaceOfGeneratedCode: string) (w: StringWriter) = w.printfn "// Copyright 2018 Fabulous contributors. See LICENSE.md for license." w.printfn "namespace %s" namespaceOfGeneratedCode w.printfn "" @@ -71,12 +15,25 @@ module CodeGenerator = w.printfn "#nowarn \"66\" // cast always holds" w.printfn "#nowarn \"67\" // cast always holds" w.printfn "" - w.printfn "type View() =" + w let generateAttributes (members: string []) (w: StringWriter) = + w.printfn "module ViewAttributes =" for m in members do - w.printfn " []" - w.printfn " static member val _%sAttribKey : AttributeKey<_> = AttributeKey<_>(\"%s\")" m m + match m with + | "ElementCreated" -> + w.printfn " let ElementCreatedAttribKey : AttributeKey<(obj -> unit)> = AttributeKey<(obj -> unit)>(\"ElementCreated\")" + | _ -> + w.printfn " let %sAttribKey : AttributeKey<_> = AttributeKey<_>(\"%s\")" m m + w.printfn "" + w + + let generateProto (types: string []) (w: StringWriter) = + w.printfn "type ViewProto() =" + for name in types do + w.printfn " static member val Proto%s : ViewElement option = None with get, set" name + w.printfn "" + w let generateBuildFunction (data: BuildData) (w: StringWriter) = let memberNewLine = "\n " + String.replicate data.Name.Length " " + " " @@ -93,10 +50,9 @@ module CodeGenerator = let immediateMembers = data.Members - |> Array.filter (fun m -> not m.IsInherited) + |> Array.filter (fun m -> not m.IsInherited) w.printfn " /// Builds the attributes for a %s in the view" data.Name - w.printfn " []" w.printfn " static member inline Build%s(attribCount: int%s) = " data.Name members if immediateMembers.Length > 0 then @@ -109,19 +65,19 @@ module CodeGenerator = | None -> w.printfn " let attribBuilder = new AttributesBuilder(attribCount)" | Some nameOfBaseCreator -> - w.printfn " let attribBuilder = View.Build%s(attribCount%s)" nameOfBaseCreator baseMembers + w.printfn " let attribBuilder = ViewBuilders.Build%s(attribCount%s)" nameOfBaseCreator baseMembers for m in immediateMembers do - w.printfn " match %s with None -> () | Some v -> attribBuilder.Add(View._%sAttribKey, %s(v)) " m.Name m.UniqueName m.ConvToModel + w.printfn " match %s with None -> () | Some v -> attribBuilder.Add(ViewAttributes.%sAttribKey, %s(v)) " m.Name m.UniqueName m.ConvToModel w.printfn " attribBuilder" + w.printfn "" + w let generateCreateFunction (data: CreateData) (w: StringWriter) = - w.printfn " []" - w.printfn " static member val CreateFunc%s : (unit -> %s) = (fun () -> View.Create%s())" data.Name data.FullName data.Name + w.printfn " static member val CreateFunc%s : (unit -> %s) = (fun () -> ViewBuilders.Create%s())" data.Name data.FullName data.Name w.printfn "" - w.printfn " []" - w.printfn " static member Create%s () : %s = " data.Name data.FullName + w.printfn " static member Create%s () : %s =" data.Name data.FullName match data.HasCustomConstructor with | true -> @@ -131,25 +87,27 @@ module CodeGenerator = | [||] -> w.printfn " upcast (new %s())" data.TypeToInstantiate | ps -> + // TODO : This part seems fishy. It's never actually used and it should fail because the parameters come out of nowhere let matchParameters = ps |> Array.reduce (fun a b -> sprintf "%s, %s" a b) - let someParameters = ps |> Array.reduce (fun a b -> sprintf "%s, Some %s" a b) + let someParameters = ps |> Array.map (fun s -> "Some " + s) |> Array.reduce (fun a b -> sprintf "%s, %s" a b) w.printfn " match %s with" matchParameters w.printfn " | %s ->" someParameters w.printfn " upcast (new %s(%s))" data.TypeToInstantiate matchParameters - w.printfn " | _ -> upcast (new %s())" data.TypeToInstantiate - - let generateUpdateFunction (data: UpdateData) (w: StringWriter) = - w.printfn " []" - w.printfn " static member val UpdateFunc%s = (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: %s) -> View.Update%s (prevOpt, curr, target)) " data.Name data.FullName data.Name + w.printfn " | _ -> upcast (new %s())" data.TypeToInstantiate + w.printfn "" + w + + let generateUpdateFunction (data: UpdateData) (w: StringWriter) = + w.printfn " static member val UpdateFunc%s =" data.Name + w.printfn " (fun (prevOpt: ViewElement voption) (curr: ViewElement) (target: %s) -> ViewBuilders.Update%s (prevOpt, curr, target)) " data.FullName data.Name w.printfn "" - w.printfn " []" w.printfn " static member Update%s (prevOpt: ViewElement voption, curr: ViewElement, target: %s) = " data.Name data.FullName match data.BaseName with | None -> () | Some nameOfBaseCreator -> w.printfn " // update the inherited %s element" nameOfBaseCreator - w.printfn " let baseElement = (if View.Proto%s.IsNone then View.Proto%s <- Some (View.%s())); View.Proto%s.Value" nameOfBaseCreator nameOfBaseCreator nameOfBaseCreator nameOfBaseCreator + w.printfn " let baseElement = (if ViewProto.Proto%s.IsNone then ViewProto.Proto%s <- Some (ViewBuilders.Construct%s())); ViewProto.Proto%s.Value" nameOfBaseCreator nameOfBaseCreator nameOfBaseCreator nameOfBaseCreator w.printfn " baseElement.UpdateInherited (prevOpt, curr, target)" if (data.ImmediateMembers.Length = 0) then @@ -162,14 +120,14 @@ module CodeGenerator = w.printfn " let mutable curr%sOpt = ValueNone" m.UniqueName w.printfn " for kvp in curr.AttributesKeyed do" for m in data.ImmediateMembers do - w.printfn " if kvp.Key = View._%sAttribKey.KeyValue then " m.UniqueName + w.printfn " if kvp.Key = ViewAttributes.%sAttribKey.KeyValue then " m.UniqueName w.printfn " curr%sOpt <- ValueSome (kvp.Value :?> %s)" m.UniqueName m.ModelType w.printfn " match prevOpt with" w.printfn " | ValueNone -> ()" w.printfn " | ValueSome prev ->" w.printfn " for kvp in prev.AttributesKeyed do" for m in data.ImmediateMembers do - w.printfn " if kvp.Key = View._%sAttribKey.KeyValue then " m.UniqueName + w.printfn " if kvp.Key = ViewAttributes.%sAttribKey.KeyValue then " m.UniqueName w.printfn " prev%sOpt <- ValueSome (kvp.Value :?> %s)" m.UniqueName m.ModelType let members = data.ImmediateMembers |> Array.filter (fun m -> not m.IsParameter) @@ -185,8 +143,8 @@ module CodeGenerator = w.printfn " (fun prevChildOpt newChild targetChild -> " for ap in m.Attached do w.printfn " // Adjust the attached properties" - w.printfn " let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed<%s>(View._%sAttribKey)" ap.ModelType ap.UniqueName - w.printfn " let childValueOpt = newChild.TryGetAttributeKeyed<%s>(View._%sAttribKey)" ap.ModelType ap.UniqueName + w.printfn " let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed<%s>(ViewAttributes.%sAttribKey)" ap.ModelType ap.UniqueName + w.printfn " let childValueOpt = newChild.TryGetAttributeKeyed<%s>(ViewAttributes.%sAttribKey)" ap.ModelType ap.UniqueName if System.String.IsNullOrWhiteSpace(ap.UpdateCode) then let apApply = getValueOrDefault "" (ap.ConvToValue + " ") w.printfn " match prevChildValueOpt, childValueOpt with" @@ -206,20 +164,20 @@ module CodeGenerator = match m.BoundType with // Check if the type of the member is in the model, if so issue recursive calls to "Create" and "UpdateIncremental" - | Some (_, fullName) when (tryFindType data.KnownTypes fullName).IsSome && not hasApply -> + | Some boundType when (tryFindType data.KnownTypes boundType.FullName).IsSome && not hasApply -> w.printfn " match prev%sOpt, curr%sOpt with" m.UniqueName m.UniqueName w.printfn " // For structured objects, dependsOn on reference equality" w.printfn " | ValueSome prevValue, ValueSome newValue when identical prevValue newValue -> ()" w.printfn " | ValueSome prevValue, ValueSome newValue when canReuseChild prevValue newValue ->" w.printfn " newValue.UpdateIncremental(prevValue, target.%s)" m.Name w.printfn " | _, ValueSome newValue ->" - w.printfn " target.%s <- (newValue.Create() :?> %s)" m.Name fullName + w.printfn " target.%s <- (newValue.Create() :?> %s)" m.Name boundType.FullName w.printfn " | ValueSome _, ValueNone ->" w.printfn " target.%s <- null" m.Name w.printfn " | ValueNone, ValueNone -> ()" // Default for delegate-typed things - | Some (name, _) when (name.EndsWith("Handler") || name.EndsWith("Handler`1") || name.EndsWith("Handler`2")) && not hasApply -> + | Some boundType when (boundType.Name.EndsWith("Handler") || boundType.Name.EndsWith("Handler`1") || boundType.Name.EndsWith("Handler`2")) && not hasApply -> w.printfn " match prev%sOpt, curr%sOpt with" m.UniqueName m.UniqueName w.printfn " | ValueSome prevValue, ValueSome currValue when identical prevValue currValue -> ()" w.printfn " | ValueSome prevValue, ValueSome currValue -> target.%s.RemoveHandler(prevValue); target.%s.AddHandler(currValue)" m.Name m.Name @@ -234,8 +192,8 @@ module CodeGenerator = w.printfn " (fun prevChildOpt newChild targetChild -> " for ap in m.Attached do w.printfn " // Adjust the attached properties" - w.printfn " let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed<%s>(View._%sAttribKey)" ap.ModelType ap.UniqueName - w.printfn " let childValueOpt = newChild.TryGetAttributeKeyed<%s>(View._%sAttribKey)" ap.ModelType ap.UniqueName + w.printfn " let prevChildValueOpt = match prevChildOpt with ValueNone -> ValueNone | ValueSome prevChild -> prevChild.TryGetAttributeKeyed<%s>(ViewAttributes.%sAttribKey)" ap.ModelType ap.UniqueName + w.printfn " let childValueOpt = newChild.TryGetAttributeKeyed<%s>(ViewAttributes.%sAttribKey)" ap.ModelType ap.UniqueName if System.String.IsNullOrWhiteSpace(ap.UpdateCode) then let apApply = getValueOrDefault "" (ap.ConvToValue + " ") @@ -255,175 +213,148 @@ module CodeGenerator = w.printfn " | _, ValueSome currValue -> target.%s <- %s currValue" m.Name update w.printfn " | ValueSome _, ValueNone -> target.%s <- %s" m.Name m.DefaultValue w.printfn " | ValueNone, ValueNone -> ()" + w.printfn "" + w - let generateConstructor (data: ConstructorData) (w: StringWriter) = - let memberNewLine = "\n " + String.replicate data.Name.Length " " + " " + let generateConstruct (data: ConstructData) (w: StringWriter) = + let memberNewLine = "\n " + String.replicate data.Name.Length " " + " " let space = "\n " let membersForConstructor = data.Members - |> Array.mapi (fun i (memberName, inputType) -> + |> Array.mapi (fun i m -> let commaSpace = if i = 0 then "" else "," + memberNewLine - match memberName with - | "created" -> sprintf "%s?%s: (%s -> unit)" commaSpace memberName data.FullName - | "ref" -> sprintf "%s?%s: ViewRef<%s>" commaSpace memberName data.FullName - | _ -> sprintf "%s?%s: %s" commaSpace memberName inputType) + match m.LowerShortName with + | "created" -> sprintf "%s?%s: (%s -> unit)" commaSpace m.LowerShortName data.FullName + | "ref" -> sprintf "%s?%s: ViewRef<%s>" commaSpace m.LowerShortName data.FullName + | _ -> sprintf "%s?%s: %s" commaSpace m.LowerShortName m.InputType) |> Array.fold (+) "" let membersForBuild = data.Members - |> Array.map (fun (memberName, _) -> - match memberName with - | "created" -> sprintf ",%s?%s=(match %s with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox<%s> target)))" space memberName memberName data.FullName - | "ref" -> sprintf ",%s?%s=(match %s with None -> None | Some (ref: ViewRef<%s>) -> Some ref.Unbox)" space memberName memberName data.FullName - | _ -> sprintf ",%s?%s=%s" space memberName memberName) + |> Array.map (fun m -> + match m.LowerShortName with + | "created" -> sprintf ",%s?%s=(match %s with None -> None | Some createdFunc -> Some (fun (target: obj) -> createdFunc (unbox<%s> target)))" space m.LowerShortName m.LowerShortName data.FullName + | "ref" -> sprintf ",%s?%s=(match %s with None -> None | Some (ref: ViewRef<%s>) -> Some ref.Unbox)" space m.LowerShortName m.LowerShortName data.FullName + | _ -> sprintf ",%s?%s=%s" space m.LowerShortName m.LowerShortName) |> Array.fold (+) "" - w.printfn " /// Describes a %s in the view" data.Name - w.printfn " static member inline %s(%s) = " data.Name membersForConstructor + w.printfn " static member Construct%s(%s) = " data.Name membersForConstructor + w.printfn "" + w.printfn " let attribBuilder = ViewBuilders.Build%s(0%s)" data.Name membersForBuild w.printfn "" - w.printfn " let attribBuilder = View.Build%s(0%s)" data.Name membersForBuild + w.printfn " ViewElement.Create<%s>(ViewBuilders.CreateFunc%s, ViewBuilders.UpdateFunc%s, attribBuilder)" data.FullName data.Name data.Name w.printfn "" - w.printfn " ViewElement.Create<%s>(View.CreateFunc%s, View.UpdateFunc%s, attribBuilder)" data.FullName data.Name data.Name - let generateProto (name: string) (w: StringWriter) = - w.printfn " []" - w.printfn " static member val Proto%s : ViewElement option = None with get, set" name + let generateBuilders (data: BuilderData []) (w: StringWriter) = + w.printfn "type ViewBuilders() =" + for typ in data do + w + |> generateBuildFunction typ.Build + |> generateCreateFunction typ.Create + |> generateUpdateFunction typ.Update + |> generateConstruct typ.Construct + w + + let generateViewers (data: ViewerData []) (w: StringWriter) = + for typ in data do + w.printfn "/// Viewer that allows to read the properties of a ViewElement representing a %s" typ.Name + w.printfn "type %sViewer(element: ViewElement) =" typ.Name + + match typ.BaseName with + | None -> () + | Some baseName -> + w.printfn " inherit %sViewer(element)" baseName + + w.printfn " do if not ((typeof<%s>).IsAssignableFrom(element.TargetType)) then failwithf \"A ViewElement assignable to type '%s' is expected, but '%%s' was provided.\" element.TargetType.FullName" typ.FullName typ.FullName + for m in typ.Members do + match m.Name with + | "Created" | "Ref" -> () + | _ -> + w.printfn " /// Get the value of the %s property" m.Name + w.printfn " member this.%s = element.GetAttributeKeyed(ViewAttributes.%sAttribKey)" m.Name m.UniqueName + w.printfn "" + w + + let generateConstructors (data: ConstructorData []) (w: StringWriter) = + w.printfn "type View() =" + + for d in data do + let memberNewLine = "\n " + String.replicate d.Name.Length " " + " " + let space = "\n " + let membersForConstructor = + d.Members + |> Array.mapi (fun i m -> + let commaSpace = if i = 0 then "" else "," + memberNewLine + match m.LowerShortName with + | "created" -> sprintf "%s?%s: (%s -> unit)" commaSpace m.LowerShortName d.FullName + | "ref" -> sprintf "%s?%s: ViewRef<%s>" commaSpace m.LowerShortName d.FullName + | _ -> sprintf "%s?%s: %s" commaSpace m.LowerShortName m.InputType) + |> Array.fold (+) "" + let membersForConstruct = + d.Members + |> Array.mapi (fun i m -> + let commaSpace = if i = 0 then "" else "," + space + sprintf "%s?%s=%s" commaSpace m.LowerShortName m.LowerShortName) + |> Array.fold (+) "" + + w.printfn " /// Describes a %s in the view" d.Name + w.printfn " static member inline %s(%s) =" d.Name membersForConstructor + w.printfn "" + w.printfn " ViewBuilders.Construct%s(%s)" d.Name membersForConstruct + w.printfn "" + w.printfn "" + w + + let generateViewExtensions (data: ViewExtensionsData []) (w: StringWriter) : StringWriter = + let newLine = "\n " - let generateViewExtensions (data: ViewExtensionsData) (w: StringWriter) = w.printfn "[]" w.printfn "module ViewElementExtensions = " w.printfn "" w.printfn " type ViewElement with" - for m in data.Members do + for m in data do match m.LowerShortName with | "created" | "ref" -> () | _ -> let conv = getValueOrDefault "" m.ConvToModel w.printfn "" w.printfn " /// Adjusts the %s property in the visual element" m.UniqueName - w.printfn " member x.%s(value: %s) = x.WithAttribute(View._%sAttribKey, %s(value))" m.UniqueName m.InputType m.UniqueName conv + w.printfn " member x.%s(value: %s) = x.WithAttribute(ViewAttributes.%sAttribKey, %s(value))" m.UniqueName m.InputType m.UniqueName conv + + let members = + data + |> Array.filter (fun m -> m.LowerShortName <> "created" && m.LowerShortName <> "ref") + |> Array.mapi (fun index m -> sprintf "%s%s?%s: %s" (if index > 0 then ", " else "") (if index > 0 && index % 5 = 0 then newLine else "") m.LowerUniqueName m.InputType) + |> Array.fold (+) "" w.printfn "" + w.printfn " member x.With(%s) =" members + for m in data do + match m.LowerShortName with + | "created" | "ref" -> () + | _ -> w.printfn " let x = match %s with None -> x | Some opt -> x.%s(opt)" m.LowerUniqueName m.UniqueName + w.printfn " x" + w.printfn "" - for m in data.Members do + for m in data do match m.LowerShortName with | "created" | "ref" -> () | _ -> - w.printfn "" w.printfn " /// Adjusts the %s property in the visual element" m.UniqueName w.printfn " let %s (value: %s) (x: ViewElement) = x.%s(value)" m.LowerUniqueName m.InputType m.UniqueName - - let generateCode (bindings: Bindings, resolutions: IDictionary, memberResolutions: IDictionary) = - let w = new StringWriter() - - let toViewExtensionsMember (m: MemberBinding) = - { LowerShortName = m.LowerBoundShortName - LowerUniqueName = m.LowerBoundUniqueName - UniqueName = m.BoundUniqueName - InputType = m.GetInputType(bindings, memberResolutions, null) - ConvToModel = m.ConvToModel } - - let allMembersInAllTypes = - [| for typ in bindings.Types do - if (typ.Members <> null) then - for y in typ.Members do - yield y - if (y.Attached <> null) then - for ap in y.Attached do - yield ap |] - |> Array.groupBy (fun y -> y.BoundUniqueName) - |> Array.map (fun (_, members) -> members |> Array.head) - - let allImmediateMembersCombined = - [| for typ in bindings.Types do - for m in typ.Members.ToList() do - yield m.BoundUniqueName - if (m.Attached <> null) then - for ap in m.Attached do - yield ap.BoundUniqueName - |] - |> Seq.distinctBy id - |> Seq.toArray - - w |> generateNamespaceAndClass bindings.OutputNamespace - w.printfn "" - w |> generateAttributes allImmediateMembersCombined - - for typ in bindings.Types do - let tdef = resolutions.[typ] - let nameOfCreator = getValueOrDefault tdef.Name typ.ModelName - let hierarchy = getHierarchy(tdef).ToList() - let boundHierarchy = hierarchy |> Seq.choose (fun (x, _) -> bindings.Types |> Seq.tryFind (fun y -> y.Name = x.FullName)) |> Seq.toArray - let baseTypeOpt = if boundHierarchy.Length > 1 then Some boundHierarchy.[1] else None - let nameOfBaseCreatorOpt = baseTypeOpt |> Option.map (fun baseType -> getValueOrDefault resolutions.[baseType].Name baseType.ModelName) - let allBaseMembers = boundHierarchy |> Seq.skip(1) |> Seq.collect (fun x -> x.Members) |> Seq.toArray - let allImmediateMembers = typ.Members.ToArray() - let allMembers = Array.append allImmediateMembers allBaseMembers - let ctor = - tdef.Methods - .Where(fun x -> x.IsConstructor && x.IsPublic) - .OrderBy(fun x -> x.Parameters.Count) - .FirstOrDefault() - - let toBuildMember isInherited (m: MemberBinding) = - { Name = m.LowerBoundShortName - UniqueName = m.BoundUniqueName - InputType = m.GetInputType(bindings, memberResolutions, hierarchy) - ConvToModel = getValueOrDefault "" m.ConvToModel - IsInherited = isInherited } - - let rec toUpdateMember (m: MemberBinding) = - { Name = m.Name - UniqueName = m.BoundUniqueName - ModelType = m.GetModelType(bindings, memberResolutions, hierarchy) - DefaultValue = m.DefaultValue - ConvToValue = m.ConvToValue - UpdateCode = m.UpdateCode - ElementTypeFullName = m.GetElementTypeFullName(memberResolutions, hierarchy) - IsParameter = m.IsParam - BoundType = tryGetBoundType memberResolutions m |> Option.map (fun tref -> (tref.Name, tref.FullName)) - Attached = - if m.Attached <> null && m.Attached.Count > 0 then - m.Attached |> Seq.map toUpdateMember |> Seq.toArray - else - [||] } - - w.printfn "" - w |> generateBuildFunction - { Name = nameOfCreator - BaseName = nameOfBaseCreatorOpt - Members = - Array.append - (allImmediateMembers |> Array.map (toBuildMember false)) - (allBaseMembers |> Array.map (toBuildMember true)) } - - w.printfn "" - w |> generateCreateFunction - { Name = nameOfCreator - FullName = tdef.FullName - HasCustomConstructor = (tdef.IsAbstract || ctor = null || ctor.Parameters.Count > 0) - TypeToInstantiate = getValueOrDefault tdef.FullName typ.CustomType - Parameters = allMembers |> Array.filter (fun m -> m.IsParam) |> Array.map (fun m -> m.LowerBoundShortName) } - - w.printfn "" - w |> generateUpdateFunction - { Name = nameOfCreator - FullName = tdef.FullName - BaseName = nameOfBaseCreatorOpt - KnownTypes = bindings.Types |> Seq.map (fun t -> t.Name) |> Seq.toArray - ImmediateMembers = allImmediateMembers |> Array.map toUpdateMember } - - w.printfn "" - w |> generateConstructor - { Name = nameOfCreator - FullName = tdef.FullName - Members = allMembers |> Array.map (fun m -> (m.LowerBoundShortName, m.GetInputType(bindings, memberResolutions, null))) } - - w.printfn "" - w |> generateProto nameOfCreator - - w.printfn "" - w |> generateViewExtensions - { Members = allMembersInAllTypes |> Array.map toViewExtensionsMember } - - w.ToString () + w + + let generateCode (bindings, resolutions, memberResolutions) = + let toString (w: StringWriter) = w.ToString() + + let data = prepareData (bindings, resolutions, memberResolutions) + use writer = new StringWriter() + writer + |> generateNamespace data.Namespace + |> generateAttributes data.Attributes + |> generateProto data.Proto + |> generateBuilders data.Builders + |> generateViewers data.Viewers + |> generateConstructors data.Constructors + |> generateViewExtensions data.ViewExtensions + |> toString diff --git a/tools/Generator/Generator.fsproj b/tools/Generator/Generator.fsproj index 535723457..8b169c2f8 100644 --- a/tools/Generator/Generator.fsproj +++ b/tools/Generator/Generator.fsproj @@ -8,6 +8,8 @@ + + diff --git a/tools/Generator/Helpers.fs b/tools/Generator/Helpers.fs index e7a5b6f41..99da83c5f 100644 --- a/tools/Generator/Helpers.fs +++ b/tools/Generator/Helpers.fs @@ -4,29 +4,46 @@ namespace Fabulous.Generator open System.IO module Helpers = - type TextWriter with + type TextWriter with member this.printf fmt = fprintf this fmt member this.printfn fmt = fprintfn this fmt - let (|NotNullOrWhitespace|_|) (str: string) = if System.String.IsNullOrWhiteSpace str then None else Some str + let (|NotNullOrWhitespace|_|) (str : string) = + if System.String.IsNullOrWhiteSpace str then None + else Some str - let getValueOrDefault defaultValue value = if System.String.IsNullOrWhiteSpace value then defaultValue else value + let getValueOrDefault defaultValue value = + if System.String.IsNullOrWhiteSpace value then defaultValue + else value - let toLowerPascalCase (str: string) = + let toLowerPascalCase (str : string) = match str with | null -> null | "" -> "" | x when x.Length = 1 -> x.ToLowerInvariant() - | x -> string (System.Char.ToLowerInvariant (x.[0])) + x.Substring (1) + | x -> string (System.Char.ToLowerInvariant(x.[0])) + x.Substring(1) let getResultErrors lst = lst - |> List.filter (fun x -> match x with Error _ -> true | Ok _ -> false) - |> List.map (fun x -> match x with Error e -> e | Ok _ -> failwith "InvalidOperation") + |> List.filter (fun x -> + match x with + | Error _ -> true + | Ok _ -> false) + |> List.map (fun x -> + match x with + | Error e -> e + | Ok _ -> failwith "InvalidOperation") let getResultOks lst = lst - |> List.filter (fun x -> match x with Ok _ -> true | Error _ -> false) - |> List.map (fun x -> match x with Ok r -> r | Error _ -> failwith "InvalidOperation") - - let tryFindType (types: string []) name = types |> Array.tryFind (fun x -> x = name) + |> List.filter (fun x -> + match x with + | Ok _ -> true + | Error _ -> false) + |> List.map (fun x -> + match x with + | Ok r -> r + | Error _ -> failwith "InvalidOperation") + + let tryFindType (types : string []) name = + types |> Array.tryFind (fun x -> x = name) diff --git a/tools/Generator/Models.fs b/tools/Generator/Models.fs index 2232f8d2a..01ab98601 100644 --- a/tools/Generator/Models.fs +++ b/tools/Generator/Models.fs @@ -6,9 +6,10 @@ open Helpers module Models = type MemberBinding() = + /// The name of the property in the target member val Name : string = null with get, set - + /// A unique name of the property in the model member val UniqueName : string = null with get, set @@ -17,9 +18,9 @@ module Models = /// The lowercase name used as a parameter in the API member val ShortName : string = null with get, set - + /// The input type type of the property as seen in the API - member val InputType : string = null with get, set + member val InputType : string = null with get, set /// The default value when applying to the target member val DefaultValue : string = null with get, set @@ -34,7 +35,7 @@ module Models = member val UpdateCode : string = null with get, set /// The type as stored in the model - member val ModelType : string = null with get, set + member val ModelType : string = null with get, set /// The element type of the collection property member val ElementType : string = null with get, set @@ -42,28 +43,22 @@ module Models = /// The attached properties for items in the collection property member val Attached : List = null with get, set - member this.BoundUniqueName : string = getValueOrDefault this.Name this.UniqueName - - member this.LowerBoundUniqueName : string = toLowerPascalCase this.BoundUniqueName - - member this.BoundShortName : string = getValueOrDefault this.Name this.ShortName - - member this.LowerBoundShortName : string = toLowerPascalCase this.BoundShortName - - type TypeBinding() = + member this.BoundUniqueName : string = + getValueOrDefault this.Name this.UniqueName + member this.LowerBoundUniqueName : string = + toLowerPascalCase this.BoundUniqueName + member this.BoundShortName : string = + getValueOrDefault this.Name this.ShortName + member this.LowerBoundShortName : string = + toLowerPascalCase this.BoundShortName + type TypeBinding() = member val Name : string = null with get, set - member val ModelName : string = null with get, set - member val CustomType : string = null with get, set + member val Members : List = null with get, set - member val Members: List = null with get, set - - type Bindings() = - - member val Assemblies : List = null with get, set - - member val Types : List = null with get, set - - member val OutputNamespace : string = null with get, set \ No newline at end of file + type Bindings() = + member val Assemblies : List = null with get, set + member val Types : List = null with get, set + member val OutputNamespace : string = null with get, set diff --git a/tools/Generator/Program.fs b/tools/Generator/Program.fs index ea0716d13..eef64a0d6 100644 --- a/tools/Generator/Program.fs +++ b/tools/Generator/Program.fs @@ -12,19 +12,21 @@ open Fabulous.Generator.CodeGenerator module Generator = [] - let Main(args: string[]) = - try + let Main(args : string []) = + try if (args.Length < 2) then - Console.Error.WriteLine("usage: generator ") + Console.Error.WriteLine ("usage: generator ") Environment.Exit(1) - + let bindingsPath = args.[0] let outputPath = args.[1] - - let bindings = JsonConvert.DeserializeObject (File.ReadAllText (bindingsPath)) - + let bindings = JsonConvert.DeserializeObject (File.ReadAllText(bindingsPath)) let getAssemblyDefinition = loadAssembly (new RegistrableResolver()) - let assemblyDefinitions = bindings.Assemblies |> Seq.map getAssemblyDefinition |> Seq.toList + + let assemblyDefinitions = + bindings.Assemblies + |> Seq.map getAssemblyDefinition + |> Seq.toList match resolveTypes assemblyDefinitions bindings.Types with | Error errors -> @@ -37,8 +39,8 @@ module Generator = | _ -> warnings |> List.iter System.Console.WriteLine let code = generateCode (bindings, resolutions, memberResolutions) - File.WriteAllText (outputPath, code) + File.WriteAllText(outputPath, code) 0 - with ex -> + with ex -> System.Console.WriteLine(ex) 1 diff --git a/tools/Generator/Resolvers.fs b/tools/Generator/Resolvers.fs index cf6714adf..8e430fd17 100644 --- a/tools/Generator/Resolvers.fs +++ b/tools/Generator/Resolvers.fs @@ -8,7 +8,7 @@ open System.Collections.Generic open System.Linq module Resolvers = - let getHierarchy (typ: TypeDefinition) = + let getHierarchy (typ : TypeDefinition) = seq { let mutable d = typ yield (d :> TypeReference, d) @@ -16,171 +16,193 @@ module Resolvers = let r = d.BaseType d <- r.Resolve() yield (r, d) - } + } - let tryResolveType (assemblyDefinitions: AssemblyDefinition list) (name: string) = + let tryResolveType (assemblyDefinitions : AssemblyDefinition list) + (name : string) = seq { for a in assemblyDefinitions do for m in a.Modules do for tdef in m.Types do - if tdef.FullName = name then - yield tdef } + if tdef.FullName = name then yield tdef + } |> Seq.tryHead let tryFindProperty typ name = let q = - seq { - for (_, tdef) in getHierarchy(typ) do + seq { + for (_, tdef) in getHierarchy (typ) do for p in tdef.Properties do - if p.Name = name then - yield p } + if p.Name = name then yield p + } q |> Seq.tryHead let tryFindEvent typ name = let q = - seq { - for (_, tdef) in getHierarchy(typ) do + seq { + for (_, tdef) in getHierarchy (typ) do for p in tdef.Events do - if p.Name = name then - yield p } + if p.Name = name then yield p + } q |> Seq.tryHead - let resolveTypes (assemblyDefinitions: AssemblyDefinition list) (types: List) : Result, string list> = + let resolveTypes (assemblyDefinitions : AssemblyDefinition list) (types : List) : Result, string list> = let results = [ for x in types do - match tryResolveType assemblyDefinitions x.Name with - | None -> yield Error (sprintf "Could not find type '%s'" x.Name) - | Some d -> yield Ok (x, d) ] - + match tryResolveType assemblyDefinitions x.Name with + | None -> + yield Error(sprintf "Could not find type '%s'" x.Name) + | Some d -> yield Ok(x, d) ] match results |> getResultErrors with - | [] -> results |> getResultOks |> dict |> Ok + | [] -> + results + |> getResultOks + |> dict + |> Ok | errors -> errors |> Error - let resolveMembers (types: List) (resolutions: IDictionary) : IDictionary * string list = + let resolveMembers (types : List) (resolutions : IDictionary) : IDictionary * string list = let results = [ for x in types do - for m in x.Members do - match tryFindProperty resolutions.[x] m.Name with - | Some p -> yield (Some (m, (p :> MemberReference)), None) - | None -> - match tryFindEvent resolutions.[x] m.Name with - | Some e -> yield (Some (m, (e :> MemberReference)), None) - | None -> - match System.String.IsNullOrWhiteSpace(m.UpdateCode) with - | true -> yield (None, Some (sprintf "Could not find member '%s' on '%s'" m.Name x.Name)) - | false -> () ] - - let memberResolutions = results |> List.map fst |> List.filter Option.isSome |> List.map Option.get |> dict - let warnings = results |> List.map snd |> List.filter Option.isSome |> List.map Option.get + for m in x.Members do + match tryFindProperty resolutions.[x] m.Name with + | Some p -> yield (Some(m, (p :> MemberReference)), None) + | None -> + match tryFindEvent resolutions.[x] m.Name with + | Some e -> + yield (Some(m, (e :> MemberReference)), None) + | None -> + match System.String.IsNullOrWhiteSpace (m.UpdateCode) with + | true -> + yield (None, Some + (sprintf + "Could not find member '%s' on '%s'" + m.Name x.Name)) + | false -> () ] + + let memberResolutions = + results + |> List.map fst + |> List.filter Option.isSome + |> List.map Option.get + |> dict + + let warnings = + results + |> List.map snd + |> List.filter Option.isSome + |> List.map Option.get + (memberResolutions, warnings) - let tryGetBoundType (memberResolutions: IDictionary) (memberBinding: MemberBinding) : TypeReference option = - if memberResolutions.ContainsKey(memberBinding) then - match memberResolutions.[memberBinding] with - | :? PropertyDefinition as p -> Some p.PropertyType - | :? EventDefinition as e -> Some e.EventType - | _ -> None - else - None - - let rec ResolveGenericParameter (tref: TypeReference, hierarchy: seq) : TypeReference option = - if (tref = null) then - None - elif not tref.IsGenericParameter then - Some tref + let tryGetBoundType (memberResolutions : IDictionary) + (memberBinding : MemberBinding) : TypeReference option = + if memberResolutions.ContainsKey(memberBinding) then + match memberResolutions.[memberBinding] with + | :? PropertyDefinition as p -> Some p.PropertyType + | :? EventDefinition as e -> Some e.EventType + | _ -> None + else None + + let rec resolveGenericParameter(tref : TypeReference, + hierarchy : seq) : TypeReference option = + if (tref = null) then None + elif not tref.IsGenericParameter then Some tref else - seq { - for (b, tdef) in hierarchy do - if b.IsGenericInstance then - let ps = tdef.GenericParameters - match ps |> Seq.tryFind (fun x -> x.Name = tref.Name) with - | Some p -> - let pi = ps.IndexOf(p) - let args = (b :?> GenericInstanceType).GenericArguments - match ResolveGenericParameter (args.[pi], hierarchy) with - | Some res -> yield res - | None -> - () - | None -> - () - } + seq { + for (b, tdef) in hierarchy do + if b.IsGenericInstance then + let ps = tdef.GenericParameters + match ps |> Seq.tryFind (fun x -> x.Name = tref.Name) with + | Some p -> + let pi = ps.IndexOf(p) + let args = + (b :?> GenericInstanceType).GenericArguments + match resolveGenericParameter(args.[pi], hierarchy) with + | Some res -> yield res + | None -> () + | None -> () + } |> Seq.tryHead - type MemberBinding with - member this.GetModelTypeInner(bindings:Bindings, tref:TypeReference, hierarchy: seq) = - match tref with - | _ when tref.IsGenericParameter -> - if hierarchy <> null then - match ResolveGenericParameter(tref, hierarchy) with - | Some r -> this.GetModelTypeInner(bindings, r, hierarchy) - | None -> "ViewElement" + let rec getModelTypeInner (this : MemberBinding, bindings : Bindings, + tref : TypeReference, + hierarchy : seq) = + match tref with + | _ when tref.IsGenericParameter -> + if hierarchy <> null then + match resolveGenericParameter(tref, hierarchy) with + | Some r -> getModelTypeInner (this, bindings, r, hierarchy) + | None -> "ViewElement" + else "ViewElement" + | _ when tref.IsGenericInstance -> + let (ns, n) = + let n = tref.Name.Substring(0, tref.Name.IndexOf('`')) + if (tref.IsNested) then + let n = tref.DeclaringType.Name + "." + n + let ns = tref.DeclaringType.Namespace + ns, n else - "ViewElement" - - | _ when tref.IsGenericInstance -> - let (ns,n) = - let n = tref.Name.Substring(0, tref.Name.IndexOf('`')) - if (tref.IsNested) then - let n = tref.DeclaringType.Name + "." + n - let ns = tref.DeclaringType.Namespace - ns, n - else - let ns = tref.Namespace - ns, n - let args = System.String.Join(", ", (tref :?> GenericInstanceType).GenericArguments.Select(fun s -> this.GetModelTypeInner(bindings, s, hierarchy))) - sprintf "%s.%s<%s>" ns n args - - | _ -> - match tref.FullName with - | "System.String" -> "string" - | "System.Boolean" -> "bool" - | "System.Int32" -> "int" - | "System.Double" -> "double" - | "System.Single" -> "single" - | _ -> - match (bindings.Types |> Seq.tryFind (fun x -> x.Name = tref.FullName)) with - | None -> tref.FullName.Replace('/', '.') - | Some tb -> "ViewElement" - - member this.GetModelType(bindings: Bindings, memberResolutions, hierarchy: seq) = - match this.ModelType with - | NotNullOrWhitespace s -> s - | _ -> - match tryGetBoundType memberResolutions this with - | None -> failwithf "no type for %s" this.Name - | Some boundType -> this.GetModelTypeInner(bindings, boundType, hierarchy) - - member this.GetInputType(bindings: Bindings, memberResolutions, hierarchy: seq) = - match this.InputType with - | NotNullOrWhitespace s -> s - | _ -> - this.GetModelType(bindings, memberResolutions, hierarchy) - - member this.GetElementTypeInner(tref: TypeReference, hierarchy: seq) = - match ResolveGenericParameter(tref, hierarchy) with + let ns = tref.Namespace + ns, n + + let args = + System.String.Join (", ", + (tref :?> GenericInstanceType) + .GenericArguments.Select(fun s -> + getModelTypeInner (this, bindings, s, hierarchy))) + sprintf "%s.%s<%s>" ns n args + | _ -> + match tref.FullName with + | "System.String" -> "string" + | "System.Boolean" -> "bool" + | "System.Int32" -> "int" + | "System.Double" -> "double" + | "System.Single" -> "single" + | _ -> + match (bindings.Types + |> Seq.tryFind (fun x -> x.Name = tref.FullName)) with + | None -> tref.FullName.Replace('/', '.') + | Some tb -> "ViewElement" + + let getModelType (this : MemberBinding, bindings : Bindings, memberResolutions, hierarchy : seq) = + match this.ModelType with + | NotNullOrWhitespace s -> s + | _ -> + match tryGetBoundType memberResolutions this with + | None -> failwithf "no type for %s" this.Name + | Some boundType -> + getModelTypeInner (this, bindings, boundType, hierarchy) + + let getInputType (this : MemberBinding, bindings : Bindings, memberResolutions, hierarchy : seq) = + match this.InputType with + | NotNullOrWhitespace s -> s + | _ -> getModelType (this, bindings, memberResolutions, hierarchy) + + let rec getElementTypeInner (this : MemberBinding, tref : TypeReference, hierarchy : seq) = + match resolveGenericParameter(tref, hierarchy) with + | None -> None + | Some r -> + if (r.FullName = "System.String") then None + elif (r.Name = "IList`1" && r.IsGenericInstance) then + let args = (r :?> GenericInstanceType).GenericArguments + match resolveGenericParameter(args.[0], hierarchy) with + | None -> None + | Some elementType -> Some elementType + else + let bs = r.Resolve().Interfaces + bs + |> Seq.tryPick + (fun b -> + getElementTypeInner (this, b.InterfaceType, hierarchy)) + + let getElementTypeFullName (this : MemberBinding, memberResolutions, hierarchy : seq) = + match this.ElementType with + | NotNullOrWhitespace s -> Some s + | _ -> + match tryGetBoundType memberResolutions this with | None -> None - | Some r -> - if (r.FullName = "System.String") then - None - elif (r.Name = "IList`1" && r.IsGenericInstance) then - let args = (r :?> GenericInstanceType).GenericArguments - match ResolveGenericParameter(args.[0], hierarchy) with - | None -> - None - | Some elementType -> - Some elementType - else - let bs = r.Resolve().Interfaces - bs |> Seq.tryPick (fun b -> this.GetElementTypeInner(b.InterfaceType, hierarchy)) - - member this.GetElementTypeFullName(memberResolutions, hierarchy: seq) = - match this.ElementType with - | NotNullOrWhitespace s -> Some s - | _ -> - match tryGetBoundType memberResolutions this with + | Some boundType -> + match getElementTypeInner (this, boundType, hierarchy) with | None -> None - | Some boundType -> - match this.GetElementTypeInner(boundType, hierarchy) with - | None -> None - | Some res -> Some res.FullName - + | Some res -> Some res.FullName diff --git a/tools/Generator/Xamarin.Forms.Core.json b/tools/Generator/Xamarin.Forms.Core.json index da011575c..d63003d6d 100644 --- a/tools/Generator/Xamarin.Forms.Core.json +++ b/tools/Generator/Xamarin.Forms.Core.json @@ -653,7 +653,7 @@ "elementType": "Xamarin.Forms.RowDefinition", "modelType": "ViewElement[]", "inputType": "obj list", - "convToModel": "(fun es -> es |> Array.ofList |> Array.map (fun h -> View.RowDefinition(height=h)))" + "convToModel": "(fun es -> es |> Array.ofList |> Array.map (fun h -> ViewBuilders.ConstructRowDefinition(height=h)))" }, { "name": "ColumnDefinitions", @@ -663,7 +663,7 @@ "elementType": "Xamarin.Forms.ColumnDefinition", "modelType": "ViewElement[]", "inputType": "obj list", - "convToModel": "(fun es -> es |> Array.ofList |> Array.map (fun h -> View.ColumnDefinition(width=h)))" + "convToModel": "(fun es -> es |> Array.ofList |> Array.map (fun h -> ViewBuilders.ConstructColumnDefinition(width=h)))" }, { "name": "RowSpacing", From aac67e76f68d6b9edbceedb3bc2ff154ee605dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9=20Larivi=C3=A8re?= Date: Sat, 9 Feb 2019 17:53:50 +0100 Subject: [PATCH 2/3] Add missing project to solution --- Fabulous.sln | 71 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 51 insertions(+), 20 deletions(-) diff --git a/Fabulous.sln b/Fabulous.sln index 20c0918fc..08215186f 100644 --- a/Fabulous.sln +++ b/Fabulous.sln @@ -3,15 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27004.2006 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fabulous.Core", "src\Fabulous.Core\Fabulous.Core.fsproj", "{B459AFAD-BB5B-43C3-BD86-609E8DB3E3FD}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fabulous.Core", "src\Fabulous.Core\Fabulous.Core.fsproj", "{B459AFAD-BB5B-43C3-BD86-609E8DB3E3FD}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fabulous.LiveUpdate", "src\Fabulous.LiveUpdate\Fabulous.LiveUpdate.fsproj", "{B459AFAD-BB5B-43C3-BD86-609E8DB3E3F1}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fabulous.LiveUpdate", "src\Fabulous.LiveUpdate\Fabulous.LiveUpdate.fsproj", "{B459AFAD-BB5B-43C3-BD86-609E8DB3E3F1}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fabulous.Maps", "extensions\Maps\Fabulous.Maps.fsproj", "{B459AFAD-BB5B-43C3-BD86-609E8DB3E3FE}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fabulous.Maps", "extensions\Maps\Fabulous.Maps.fsproj", "{B459AFAD-BB5B-43C3-BD86-609E8DB3E3FE}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fabulous.SkiaSharp", "extensions\SkiaSharp\Fabulous.SkiaSharp.fsproj", "{B459AFAD-BB5B-43C3-BD86-609E8DB3E3FF}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fabulous.SkiaSharp", "extensions\SkiaSharp\Fabulous.SkiaSharp.fsproj", "{B459AFAD-BB5B-43C3-BD86-609E8DB3E3FF}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fabulous.OxyPlot", "extensions\OxyPlot\Fabulous.OxyPlot.fsproj", "{B459AFAD-BB5B-43C3-BD86-609E8DB3E3F0}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fabulous.OxyPlot", "extensions\OxyPlot\Fabulous.OxyPlot.fsproj", "{B459AFAD-BB5B-43C3-BD86-609E8DB3E3F0}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{FB194A8D-00A6-4416-AA8D-A89C1541935B}" EndProject @@ -19,7 +19,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StaticView", "StaticView", EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StaticViewCounterApp", "StaticViewCounterApp", "{A832662D-05EB-4582-B871-143798897673}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "StaticViewCounterApp", "samples\StaticView\StaticViewCounterApp\StaticViewCounterApp\StaticViewCounterApp.fsproj", "{4282E90F-2519-46D0-B593-D57CFCA36A2D}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "StaticViewCounterApp", "samples\StaticView\StaticViewCounterApp\StaticViewCounterApp\StaticViewCounterApp.fsproj", "{4282E90F-2519-46D0-B593-D57CFCA36A2D}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "StaticViewCounterApp.Droid", "samples\StaticView\StaticViewCounterApp\Droid\StaticViewCounterApp.Droid.fsproj", "{2D3CBBD7-118F-4457-817E-0D60E03C5534}" EndProject @@ -27,7 +27,7 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "StaticViewCounterApp.iOS", EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TicTacToe", "TicTacToe", "{9869E35B-39CD-490C-A843-842C09938630}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TicTacToe", "samples\TicTacToe\TicTacToe\TicTacToe.fsproj", "{AE045D79-7FF3-45F3-BFD0-305542A1C728}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "TicTacToe", "samples\TicTacToe\TicTacToe\TicTacToe.fsproj", "{AE045D79-7FF3-45F3-BFD0-305542A1C728}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "TicTacToe.iOS", "samples\TicTacToe\iOS\TicTacToe.iOS.fsproj", "{E43D02E6-04E7-4E4E-A527-3C5D00D9D826}" EndProject @@ -35,7 +35,7 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "TicTacToe.Droid", "samples\ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AllControls", "AllControls", "{12D18417-809C-4CA9-AD3E-474333B181BC}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "AllControls", "samples\AllControls\AllControls\AllControls.fsproj", "{13F140D6-2D21-41BE-AC90-4B14D8C16A47}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "AllControls", "samples\AllControls\AllControls\AllControls.fsproj", "{13F140D6-2D21-41BE-AC90-4B14D8C16A47}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "AllControls.Droid", "samples\AllControls\Droid\AllControls.Droid.fsproj", "{5CCD3C0C-3434-434C-B8C2-7FFDEDCC2437}" EndProject @@ -43,17 +43,17 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "AllControls.iOS", "samples\ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CounterApp", "CounterApp", "{A61655CB-26DF-47E7-BCC0-91FD9A7D83AA}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "CounterApp", "samples\CounterApp\CounterApp\CounterApp.fsproj", "{AC36B11A-383D-45A3-8999-4F6475E9DD13}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "CounterApp", "samples\CounterApp\CounterApp\CounterApp.fsproj", "{AC36B11A-383D-45A3-8999-4F6475E9DD13}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "CounterApp.Droid", "samples\CounterApp\Droid\CounterApp.Droid.fsproj", "{13181907-1C53-47C1-BDF0-DBECCC2ED92E}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "CounterApp.iOS", "samples\CounterApp\iOS\CounterApp.iOS.fsproj", "{F557905B-B099-44AB-939C-AB169499A36E}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Generator", "tools\Generator\Generator.fsproj", "{10DF5D2F-17FA-43DE-9549-B84E6CF26602}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Generator", "tools\Generator\Generator.fsproj", "{10DF5D2F-17FA-43DE-9549-B84E6CF26602}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fabulous.Cli", "src\Fabulous.Cli\Fabulous.Cli.fsproj", "{23640E46-E830-4AB7-9289-E527F6429435}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fabulous.Cli", "src\Fabulous.Cli\Fabulous.Cli.fsproj", "{23640E46-E830-4AB7-9289-E527F6429435}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fabulous.Cli.Tests", "tests\Fabulous.Cli.Tests\Fabulous.Cli.Tests.fsproj", "{810EEB40-5042-4946-B695-5B13E9957807}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fabulous.Cli.Tests", "tests\Fabulous.Cli.Tests\Fabulous.Cli.Tests.fsproj", "{810EEB40-5042-4946-B695-5B13E9957807}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{E75EAD35-1041-42CC-8AA4-01DB58FA467C}" EndProject @@ -61,15 +61,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1199BA9F EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "extensions", "extensions", "{13C0EB5D-E38E-4714-9421-77CD9C53A067}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fabulous.CustomControls", "src\Fabulous.CustomControls\Fabulous.CustomControls.fsproj", "{7FF328BB-9318-4C11-8A9A-37DD98EAB35B}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fabulous.CustomControls", "src\Fabulous.CustomControls\Fabulous.CustomControls.fsproj", "{7FF328BB-9318-4C11-8A9A-37DD98EAB35B}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Generator.Tests", "tests\Generator.Tests\Generator.Tests.fsproj", "{1CABDDE0-BB3C-4D9C-BC95-6213F177ACB1}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Generator.Tests", "tests\Generator.Tests\Generator.Tests.fsproj", "{1CABDDE0-BB3C-4D9C-BC95-6213F177ACB1}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "CounterApp.WPF", "samples\CounterApp\WPF\CounterApp.WPF.fsproj", "{096F85A9-9572-43FC-893C-05B9D07965A4}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "CounterApp.WPF", "samples\CounterApp\WPF\CounterApp.WPF.fsproj", "{096F85A9-9572-43FC-893C-05B9D07965A4}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "StaticViewCounterApp.WPF", "samples\StaticView\StaticViewCounterApp\WPF\StaticViewCounterApp.WPF.fsproj", "{D139AE95-5169-4AF4-B5A5-AED084467E86}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "StaticViewCounterApp.WPF", "samples\StaticView\StaticViewCounterApp\WPF\StaticViewCounterApp.WPF.fsproj", "{D139AE95-5169-4AF4-B5A5-AED084467E86}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TicTacToe.WPF", "samples\TicTacToe\WPF\TicTacToe.WPF.fsproj", "{30462E1D-0584-48A0-82BA-DE8A8B168E6B}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "TicTacToe.WPF", "samples\TicTacToe\WPF\TicTacToe.WPF.fsproj", "{30462E1D-0584-48A0-82BA-DE8A8B168E6B}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "CounterApp.Gtk", "samples\CounterApp\Gtk\CounterApp.Gtk.fsproj", "{C6A6BA94-897C-48B5-8046-3DF33897BA94}" EndProject @@ -87,11 +87,11 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "TicTacToe.macOS", "samples\ EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "CounterApp.macOS", "samples\CounterApp\macOS\CounterApp.macOS.fsproj", "{E9F1B013-B228-49E1-B652-6C45C6F7489B}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "AllControls.WPF", "samples\AllControls\WPF\AllControls.WPF.fsproj", "{8D3A942E-7D62-4D70-B1D7-485BB243C4B5}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "AllControls.WPF", "samples\AllControls\WPF\AllControls.WPF.fsproj", "{8D3A942E-7D62-4D70-B1D7-485BB243C4B5}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Calculator", "Calculator", "{6C7349C4-EB3D-4AB5-A5AF-BF51DAE78581}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Calculator", "samples\Calculator\Calculator\Calculator.fsproj", "{58C3A94E-459E-4CF5-AE67-B7C278578045}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Calculator", "samples\Calculator\Calculator\Calculator.fsproj", "{58C3A94E-459E-4CF5-AE67-B7C278578045}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Calculator.Droid", "samples\Calculator\Droid\Calculator.Droid.fsproj", "{58314FC1-D889-4B0F-B3AE-0544FADD7B3E}" EndProject @@ -101,7 +101,7 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Calculator.iOS", "samples\C EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Calculator.macOS", "samples\Calculator\macOS\Calculator.macOS.fsproj", "{C9F29337-EA7A-40F6-AB89-3F907431F359}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Calculator.WPF", "samples\Calculator\WPF\Calculator.WPF.fsproj", "{B5F55DCC-7550-4FF5-A3A7-14BD8DBF9D74}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Calculator.WPF", "samples\Calculator\WPF\Calculator.WPF.fsproj", "{B5F55DCC-7550-4FF5-A3A7-14BD8DBF9D74}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AllControls.UWP", "samples\AllControls\UWP\AllControls.UWP.csproj", "{6641E98C-A57A-4710-9B52-966C7A2618FD}" EndProject @@ -113,6 +113,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StaticViewCounterApp.UWP", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TicTacToe.UWP", "samples\TicTacToe\UWP\TicTacToe.UWP.csproj", "{F29D5D09-1D84-4617-A650-80E6E2C58890}" EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "CounterApp.Tests", "samples\CounterApp\CounterApp.Tests\CounterApp.Tests.fsproj", "{D331E698-DBA2-454A-924B-83D42D9BC10C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1383,6 +1385,34 @@ Global {F29D5D09-1D84-4617-A650-80E6E2C58890}.Release|x86.ActiveCfg = Release|x86 {F29D5D09-1D84-4617-A650-80E6E2C58890}.Release|x86.Build.0 = Release|x86 {F29D5D09-1D84-4617-A650-80E6E2C58890}.Release|x86.Deploy.0 = Release|x86 + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|ARM.ActiveCfg = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|ARM.Build.0 = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|ARM64.Build.0 = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|iPhone.Build.0 = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|x64.ActiveCfg = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|x64.Build.0 = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|x86.ActiveCfg = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Debug|x86.Build.0 = Debug|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|Any CPU.Build.0 = Release|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|ARM.ActiveCfg = Release|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|ARM.Build.0 = Release|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|ARM64.ActiveCfg = Release|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|ARM64.Build.0 = Release|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|iPhone.ActiveCfg = Release|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|iPhone.Build.0 = Release|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|x64.ActiveCfg = Release|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|x64.Build.0 = Release|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|x86.ActiveCfg = Release|Any CPU + {D331E698-DBA2-454A-924B-83D42D9BC10C}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1435,6 +1465,7 @@ Global {DE0EC9B1-B7F0-4B11-864D-5FE821A0E6A7} = {A61655CB-26DF-47E7-BCC0-91FD9A7D83AA} {707CFDB4-4AF2-4082-8F29-B1127974BD0F} = {A832662D-05EB-4582-B871-143798897673} {F29D5D09-1D84-4617-A650-80E6E2C58890} = {9869E35B-39CD-490C-A843-842C09938630} + {D331E698-DBA2-454A-924B-83D42D9BC10C} = {A61655CB-26DF-47E7-BCC0-91FD9A7D83AA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E142F9FB-7EA9-4866-81D4-718660BDCAEB} From be91aed88521f2e90bdeab8a7594d40babd1809d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9=20Larivi=C3=A8re?= Date: Sun, 10 Feb 2019 09:51:56 +0100 Subject: [PATCH 3/3] Added missing inline for Construct --- src/Fabulous.Core/Xamarin.Forms.Core.fs | 3836 +++++++++---------- tests/Generator.Tests/CodeGeneratorTests.fs | 12 +- tools/Generator/CodeGenerator.fs | 4 +- 3 files changed, 1926 insertions(+), 1926 deletions(-) diff --git a/src/Fabulous.Core/Xamarin.Forms.Core.fs b/src/Fabulous.Core/Xamarin.Forms.Core.fs index 1737c0849..407d74406 100644 --- a/src/Fabulous.Core/Xamarin.Forms.Core.fs +++ b/src/Fabulous.Core/Xamarin.Forms.Core.fs @@ -385,11 +385,11 @@ type ViewBuilders() = (fun _ _ _ -> ()) prevElementCreatedOpt currElementCreatedOpt target (fun _ _ _ -> ()) prevElementViewRefOpt currElementViewRefOpt target - static member ConstructElement(?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Element -> unit), - ?ref: ViewRef) = + static member inline ConstructElement(?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Element -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildElement(0, ?classId=classId, @@ -778,37 +778,37 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.TabIndex <- 0 | ValueNone, ValueNone -> () - static member ConstructVisualElement(?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.VisualElement -> unit), - ?ref: ViewRef) = + static member inline ConstructVisualElement(?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.VisualElement -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildVisualElement(0, ?anchorX=anchorX, @@ -957,41 +957,41 @@ type ViewBuilders() = canReuseChild updateChild - static member ConstructView(?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.View -> unit), - ?ref: ViewRef) = + static member inline ConstructView(?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.View -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildView(0, ?horizontalOptions=horizontalOptions, @@ -1050,7 +1050,7 @@ type ViewBuilders() = ignore curr ignore target - static member ConstructIGestureRecognizer() = + static member inline ConstructIGestureRecognizer() = let attribBuilder = ViewBuilders.BuildIGestureRecognizer(0) @@ -1115,13 +1115,13 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.PanUpdated.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructPanGestureRecognizer(?touchPoints: int, - ?panUpdated: Xamarin.Forms.PanUpdatedEventArgs -> unit, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.PanGestureRecognizer -> unit), - ?ref: ViewRef) = + static member inline ConstructPanGestureRecognizer(?touchPoints: int, + ?panUpdated: Xamarin.Forms.PanUpdatedEventArgs -> unit, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.PanGestureRecognizer -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildPanGestureRecognizer(0, ?touchPoints=touchPoints, @@ -1192,13 +1192,13 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.NumberOfTapsRequired <- 1 | ValueNone, ValueNone -> () - static member ConstructTapGestureRecognizer(?command: unit -> unit, - ?numberOfTapsRequired: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.TapGestureRecognizer -> unit), - ?ref: ViewRef) = + static member inline ConstructTapGestureRecognizer(?command: unit -> unit, + ?numberOfTapsRequired: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TapGestureRecognizer -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildTapGestureRecognizer(0, ?command=command, @@ -1283,14 +1283,14 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.Buttons <- Xamarin.Forms.ButtonsMask.Primary | ValueNone, ValueNone -> () - static member ConstructClickGestureRecognizer(?command: unit -> unit, - ?numberOfClicksRequired: int, - ?buttons: Xamarin.Forms.ButtonsMask, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ClickGestureRecognizer -> unit), - ?ref: ViewRef) = + static member inline ConstructClickGestureRecognizer(?command: unit -> unit, + ?numberOfClicksRequired: int, + ?buttons: Xamarin.Forms.ButtonsMask, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ClickGestureRecognizer -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildClickGestureRecognizer(0, ?command=command, @@ -1363,13 +1363,13 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.PinchUpdated.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructPinchGestureRecognizer(?isPinching: bool, - ?pinchUpdated: Xamarin.Forms.PinchGestureUpdatedEventArgs -> unit, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.PinchGestureRecognizer -> unit), - ?ref: ViewRef) = + static member inline ConstructPinchGestureRecognizer(?isPinching: bool, + ?pinchUpdated: Xamarin.Forms.PinchGestureUpdatedEventArgs -> unit, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.PinchGestureRecognizer -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildPinchGestureRecognizer(0, ?isPinching=isPinching, @@ -1469,15 +1469,15 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.Swiped.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructSwipeGestureRecognizer(?command: unit -> unit, - ?direction: Xamarin.Forms.SwipeDirection, - ?threshold: System.UInt32, - ?swiped: Xamarin.Forms.SwipedEventArgs -> unit, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.SwipeGestureRecognizer -> unit), - ?ref: ViewRef) = + static member inline ConstructSwipeGestureRecognizer(?command: unit -> unit, + ?direction: Xamarin.Forms.SwipeDirection, + ?threshold: System.UInt32, + ?swiped: Xamarin.Forms.SwipedEventArgs -> unit, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.SwipeGestureRecognizer -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildSwipeGestureRecognizer(0, ?command=command, @@ -1580,43 +1580,43 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.IsRunning <- false | ValueNone, ValueNone -> () - static member ConstructActivityIndicator(?color: Xamarin.Forms.Color, - ?isRunning: bool, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ActivityIndicator -> unit), - ?ref: ViewRef) = + static member inline ConstructActivityIndicator(?color: Xamarin.Forms.Color, + ?isRunning: bool, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ActivityIndicator -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildActivityIndicator(0, ?color=color, @@ -1747,43 +1747,43 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.CornerRadius <- Unchecked.defaultof | ValueNone, ValueNone -> () - static member ConstructBoxView(?color: Xamarin.Forms.Color, - ?cornerRadius: Xamarin.Forms.CornerRadius, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.BoxView -> unit), - ?ref: ViewRef) = + static member inline ConstructBoxView(?color: Xamarin.Forms.Color, + ?cornerRadius: Xamarin.Forms.CornerRadius, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.BoxView -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildBoxView(0, ?color=color, @@ -1900,42 +1900,42 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.Progress <- 0.0 | ValueNone, ValueNone -> () - static member ConstructProgressBar(?progress: double, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ProgressBar -> unit), - ?ref: ViewRef) = + static member inline ConstructProgressBar(?progress: double, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ProgressBar -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildProgressBar(0, ?progress=progress, @@ -2065,43 +2065,43 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.Padding <- Unchecked.defaultof | ValueNone, ValueNone -> () - static member ConstructLayout(?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Layout -> unit), - ?ref: ViewRef) = + static member inline ConstructLayout(?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Layout -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildLayout(0, ?isClippedToBounds=isClippedToBounds, @@ -2267,47 +2267,47 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.VerticalScrollBarVisibility <- Xamarin.Forms.ScrollBarVisibility.Default | ValueNone, ValueNone -> () - static member ConstructScrollView(?content: ViewElement, - ?orientation: Xamarin.Forms.ScrollOrientation, - ?horizontalScrollBarVisibility: Xamarin.Forms.ScrollBarVisibility, - ?verticalScrollBarVisibility: Xamarin.Forms.ScrollBarVisibility, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ScrollView -> unit), - ?ref: ViewRef) = + static member inline ConstructScrollView(?content: ViewElement, + ?orientation: Xamarin.Forms.ScrollOrientation, + ?horizontalScrollBarVisibility: Xamarin.Forms.ScrollBarVisibility, + ?verticalScrollBarVisibility: Xamarin.Forms.ScrollBarVisibility, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ScrollView -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildScrollView(0, ?content=content, @@ -2575,83 +2575,83 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.TextChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructSearchBar(?cancelButtonColor: Xamarin.Forms.Color, - ?fontFamily: string, - ?fontAttributes: Xamarin.Forms.FontAttributes, - ?fontSize: obj, - ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, - ?placeholder: string, - ?placeholderColor: Xamarin.Forms.Color, - ?searchCommand: string -> unit, - ?canExecute: bool, - ?text: string, - ?textColor: Xamarin.Forms.Color, - ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.SearchBar -> unit), - ?ref: ViewRef) = - - let attribBuilder = ViewBuilders.BuildSearchBar(0, - ?cancelButtonColor=cancelButtonColor, - ?fontFamily=fontFamily, - ?fontAttributes=fontAttributes, - ?fontSize=fontSize, - ?horizontalTextAlignment=horizontalTextAlignment, - ?placeholder=placeholder, - ?placeholderColor=placeholderColor, - ?searchCommand=searchCommand, - ?canExecute=canExecute, - ?text=text, - ?textColor=textColor, - ?textChanged=textChanged, - ?horizontalOptions=horizontalOptions, - ?verticalOptions=verticalOptions, - ?margin=margin, - ?gestureRecognizers=gestureRecognizers, - ?anchorX=anchorX, - ?anchorY=anchorY, - ?backgroundColor=backgroundColor, - ?heightRequest=heightRequest, - ?inputTransparent=inputTransparent, - ?isEnabled=isEnabled, - ?isVisible=isVisible, - ?minimumHeightRequest=minimumHeightRequest, - ?minimumWidthRequest=minimumWidthRequest, - ?opacity=opacity, - ?rotation=rotation, - ?rotationX=rotationX, + static member inline ConstructSearchBar(?cancelButtonColor: Xamarin.Forms.Color, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?fontSize: obj, + ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, + ?placeholder: string, + ?placeholderColor: Xamarin.Forms.Color, + ?searchCommand: string -> unit, + ?canExecute: bool, + ?text: string, + ?textColor: Xamarin.Forms.Color, + ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.SearchBar -> unit), + ?ref: ViewRef) = + + let attribBuilder = ViewBuilders.BuildSearchBar(0, + ?cancelButtonColor=cancelButtonColor, + ?fontFamily=fontFamily, + ?fontAttributes=fontAttributes, + ?fontSize=fontSize, + ?horizontalTextAlignment=horizontalTextAlignment, + ?placeholder=placeholder, + ?placeholderColor=placeholderColor, + ?searchCommand=searchCommand, + ?canExecute=canExecute, + ?text=text, + ?textColor=textColor, + ?textChanged=textChanged, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, ?rotationY=rotationY, ?scale=scale, ?style=style, @@ -2922,55 +2922,55 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.Padding <- Unchecked.defaultof | ValueNone, ValueNone -> () - static member ConstructButton(?text: string, - ?command: unit -> unit, - ?canExecute: bool, - ?borderColor: Xamarin.Forms.Color, - ?borderWidth: double, - ?commandParameter: System.Object, - ?contentLayout: Xamarin.Forms.Button.ButtonContentLayout, - ?cornerRadius: int, - ?fontFamily: string, - ?fontAttributes: Xamarin.Forms.FontAttributes, - ?fontSize: obj, - ?image: string, - ?textColor: Xamarin.Forms.Color, - ?padding: Xamarin.Forms.Thickness, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Button -> unit), - ?ref: ViewRef) = + static member inline ConstructButton(?text: string, + ?command: unit -> unit, + ?canExecute: bool, + ?borderColor: Xamarin.Forms.Color, + ?borderWidth: double, + ?commandParameter: System.Object, + ?contentLayout: Xamarin.Forms.Button.ButtonContentLayout, + ?cornerRadius: int, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?fontSize: obj, + ?image: string, + ?textColor: Xamarin.Forms.Color, + ?padding: Xamarin.Forms.Thickness, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Button -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildButton(0, ?text=text, @@ -3124,44 +3124,44 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.ValueChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructSlider(?minimumMaximum: float * float, - ?value: double, - ?valueChanged: Xamarin.Forms.ValueChangedEventArgs -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Slider -> unit), - ?ref: ViewRef) = + static member inline ConstructSlider(?minimumMaximum: float * float, + ?value: double, + ?valueChanged: Xamarin.Forms.ValueChangedEventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Slider -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildSlider(0, ?minimumMaximum=minimumMaximum, @@ -3318,68 +3318,68 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.ValueChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructStepper(?minimumMaximum: float * float, - ?value: double, - ?increment: double, - ?valueChanged: Xamarin.Forms.ValueChangedEventArgs -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Stepper -> unit), - ?ref: ViewRef) = - - let attribBuilder = ViewBuilders.BuildStepper(0, - ?minimumMaximum=minimumMaximum, - ?value=value, - ?increment=increment, - ?valueChanged=valueChanged, - ?horizontalOptions=horizontalOptions, - ?verticalOptions=verticalOptions, - ?margin=margin, - ?gestureRecognizers=gestureRecognizers, - ?anchorX=anchorX, - ?anchorY=anchorY, - ?backgroundColor=backgroundColor, - ?heightRequest=heightRequest, - ?inputTransparent=inputTransparent, - ?isEnabled=isEnabled, - ?isVisible=isVisible, - ?minimumHeightRequest=minimumHeightRequest, - ?minimumWidthRequest=minimumWidthRequest, - ?opacity=opacity, - ?rotation=rotation, - ?rotationX=rotationX, - ?rotationY=rotationY, + static member inline ConstructStepper(?minimumMaximum: float * float, + ?value: double, + ?increment: double, + ?valueChanged: Xamarin.Forms.ValueChangedEventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Stepper -> unit), + ?ref: ViewRef) = + + let attribBuilder = ViewBuilders.BuildStepper(0, + ?minimumMaximum=minimumMaximum, + ?value=value, + ?increment=increment, + ?valueChanged=valueChanged, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, ?scale=scale, ?style=style, ?styleClass=styleClass, @@ -3504,44 +3504,44 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.OnColor <- Xamarin.Forms.Color.Default | ValueNone, ValueNone -> () - static member ConstructSwitch(?isToggled: bool, - ?toggled: Xamarin.Forms.ToggledEventArgs -> unit, - ?onColor: Xamarin.Forms.Color, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Switch -> unit), - ?ref: ViewRef) = + static member inline ConstructSwitch(?isToggled: bool, + ?toggled: Xamarin.Forms.ToggledEventArgs -> unit, + ?onColor: Xamarin.Forms.Color, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Switch -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildSwitch(0, ?isToggled=isToggled, @@ -3643,13 +3643,13 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.IsEnabled <- true | ValueNone, ValueNone -> () - static member ConstructCell(?height: double, - ?isEnabled: bool, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Cell -> unit), - ?ref: ViewRef) = + static member inline ConstructCell(?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Cell -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildCell(0, ?height=height, @@ -3737,16 +3737,16 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.OnChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructSwitchCell(?on: bool, - ?text: string, - ?onChanged: Xamarin.Forms.ToggledEventArgs -> unit, - ?height: double, - ?isEnabled: bool, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.SwitchCell -> unit), - ?ref: ViewRef) = + static member inline ConstructSwitchCell(?on: bool, + ?text: string, + ?onChanged: Xamarin.Forms.ToggledEventArgs -> unit, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.SwitchCell -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildSwitchCell(0, ?on=on, @@ -3874,45 +3874,45 @@ type ViewBuilders() = | ValueNone, ValueNone -> () updateTableViewItems prevTableRootOpt currTableRootOpt target - static member ConstructTableView(?intent: Xamarin.Forms.TableIntent, - ?hasUnevenRows: bool, - ?rowHeight: int, - ?items: (string * ViewElement list) list, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.TableView -> unit), - ?ref: ViewRef) = + static member inline ConstructTableView(?intent: Xamarin.Forms.TableIntent, + ?hasUnevenRows: bool, + ?rowHeight: int, + ?items: (string * ViewElement list) list, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TableView -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildTableView(0, ?intent=intent, @@ -3993,7 +3993,7 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.Height <- Xamarin.Forms.GridLength.Auto | ValueNone, ValueNone -> () - static member ConstructRowDefinition(?height: obj) = + static member inline ConstructRowDefinition(?height: obj) = let attribBuilder = ViewBuilders.BuildRowDefinition(0, ?height=height) @@ -4036,7 +4036,7 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.Width <- Xamarin.Forms.GridLength.Auto | ValueNone, ValueNone -> () - static member ConstructColumnDefinition(?width: obj) = + static member inline ConstructColumnDefinition(?width: obj) = let attribBuilder = ViewBuilders.BuildColumnDefinition(0, ?width=width) @@ -4208,66 +4208,66 @@ type ViewBuilders() = canReuseChild updateChild - static member ConstructGrid(?rowdefs: obj list, - ?coldefs: obj list, - ?rowSpacing: double, - ?columnSpacing: double, - ?children: ViewElement list, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Grid -> unit), - ?ref: ViewRef) = - - let attribBuilder = ViewBuilders.BuildGrid(0, - ?rowdefs=rowdefs, - ?coldefs=coldefs, - ?rowSpacing=rowSpacing, - ?columnSpacing=columnSpacing, - ?children=children, - ?isClippedToBounds=isClippedToBounds, - ?padding=padding, - ?horizontalOptions=horizontalOptions, - ?verticalOptions=verticalOptions, - ?margin=margin, - ?gestureRecognizers=gestureRecognizers, - ?anchorX=anchorX, - ?anchorY=anchorY, - ?backgroundColor=backgroundColor, - ?heightRequest=heightRequest, - ?inputTransparent=inputTransparent, + static member inline ConstructGrid(?rowdefs: obj list, + ?coldefs: obj list, + ?rowSpacing: double, + ?columnSpacing: double, + ?children: ViewElement list, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Grid -> unit), + ?ref: ViewRef) = + + let attribBuilder = ViewBuilders.BuildGrid(0, + ?rowdefs=rowdefs, + ?coldefs=coldefs, + ?rowSpacing=rowSpacing, + ?columnSpacing=columnSpacing, + ?children=children, + ?isClippedToBounds=isClippedToBounds, + ?padding=padding, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, ?isEnabled=isEnabled, ?isVisible=isVisible, ?minimumHeightRequest=minimumHeightRequest, @@ -4390,44 +4390,44 @@ type ViewBuilders() = canReuseChild updateChild - static member ConstructAbsoluteLayout(?children: ViewElement list, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.AbsoluteLayout -> unit), - ?ref: ViewRef) = + static member inline ConstructAbsoluteLayout(?children: ViewElement list, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.AbsoluteLayout -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildAbsoluteLayout(0, ?children=children, @@ -4588,44 +4588,44 @@ type ViewBuilders() = canReuseChild updateChild - static member ConstructRelativeLayout(?children: ViewElement list, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.RelativeLayout -> unit), - ?ref: ViewRef) = + static member inline ConstructRelativeLayout(?children: ViewElement list, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.RelativeLayout -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildRelativeLayout(0, ?children=children, @@ -4870,50 +4870,50 @@ type ViewBuilders() = canReuseChild updateChild - static member ConstructFlexLayout(?alignContent: Xamarin.Forms.FlexAlignContent, - ?alignItems: Xamarin.Forms.FlexAlignItems, - ?direction: Xamarin.Forms.FlexDirection, - ?position: Xamarin.Forms.FlexPosition, - ?wrap: Xamarin.Forms.FlexWrap, - ?justifyContent: Xamarin.Forms.FlexJustify, - ?children: ViewElement list, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.FlexLayout -> unit), - ?ref: ViewRef) = + static member inline ConstructFlexLayout(?alignContent: Xamarin.Forms.FlexAlignContent, + ?alignItems: Xamarin.Forms.FlexAlignItems, + ?direction: Xamarin.Forms.FlexDirection, + ?position: Xamarin.Forms.FlexPosition, + ?wrap: Xamarin.Forms.FlexWrap, + ?justifyContent: Xamarin.Forms.FlexJustify, + ?children: ViewElement list, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.FlexLayout -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildFlexLayout(0, ?alignContent=alignContent, @@ -5021,72 +5021,72 @@ type ViewBuilders() = ignore curr ignore target - static member ConstructTemplatedView(?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.TemplatedView -> unit), - ?ref: ViewRef) = - - let attribBuilder = ViewBuilders.BuildTemplatedView(0, - ?isClippedToBounds=isClippedToBounds, - ?padding=padding, - ?horizontalOptions=horizontalOptions, - ?verticalOptions=verticalOptions, - ?margin=margin, - ?gestureRecognizers=gestureRecognizers, - ?anchorX=anchorX, - ?anchorY=anchorY, - ?backgroundColor=backgroundColor, - ?heightRequest=heightRequest, - ?inputTransparent=inputTransparent, - ?isEnabled=isEnabled, - ?isVisible=isVisible, - ?minimumHeightRequest=minimumHeightRequest, - ?minimumWidthRequest=minimumWidthRequest, - ?opacity=opacity, - ?rotation=rotation, - ?rotationX=rotationX, - ?rotationY=rotationY, - ?scale=scale, - ?style=style, - ?styleClass=styleClass, - ?translationX=translationX, - ?translationY=translationY, - ?widthRequest=widthRequest, - ?resources=resources, - ?styles=styles, + static member inline ConstructTemplatedView(?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TemplatedView -> unit), + ?ref: ViewRef) = + + let attribBuilder = ViewBuilders.BuildTemplatedView(0, + ?isClippedToBounds=isClippedToBounds, + ?padding=padding, + ?horizontalOptions=horizontalOptions, + ?verticalOptions=verticalOptions, + ?margin=margin, + ?gestureRecognizers=gestureRecognizers, + ?anchorX=anchorX, + ?anchorY=anchorY, + ?backgroundColor=backgroundColor, + ?heightRequest=heightRequest, + ?inputTransparent=inputTransparent, + ?isEnabled=isEnabled, + ?isVisible=isVisible, + ?minimumHeightRequest=minimumHeightRequest, + ?minimumWidthRequest=minimumWidthRequest, + ?opacity=opacity, + ?rotation=rotation, + ?rotationX=rotationX, + ?rotationY=rotationY, + ?scale=scale, + ?style=style, + ?styleClass=styleClass, + ?translationX=translationX, + ?translationY=translationY, + ?widthRequest=widthRequest, + ?resources=resources, + ?styles=styles, ?styleSheets=styleSheets, ?isTabStop=isTabStop, ?scaleX=scaleX, @@ -5181,44 +5181,44 @@ type ViewBuilders() = target.Content <- null | ValueNone, ValueNone -> () - static member ConstructContentView(?content: ViewElement, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ContentView -> unit), - ?ref: ViewRef) = + static member inline ConstructContentView(?content: ViewElement, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ContentView -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildContentView(0, ?content=content, @@ -5393,46 +5393,46 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.DateSelected.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructDatePicker(?date: System.DateTime, - ?format: string, - ?minimumDate: System.DateTime, - ?maximumDate: System.DateTime, - ?dateSelected: Xamarin.Forms.DateChangedEventArgs -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.DatePicker -> unit), - ?ref: ViewRef) = + static member inline ConstructDatePicker(?date: System.DateTime, + ?format: string, + ?minimumDate: System.DateTime, + ?maximumDate: System.DateTime, + ?dateSelected: Xamarin.Forms.DateChangedEventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.DatePicker -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildDatePicker(0, ?date=date, @@ -5609,46 +5609,46 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.SelectedIndexChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructPicker(?itemsSource: seq<'T>, - ?selectedIndex: int, - ?title: string, - ?textColor: Xamarin.Forms.Color, - ?selectedIndexChanged: (int * 'T option) -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Picker -> unit), - ?ref: ViewRef) = + static member inline ConstructPicker(?itemsSource: seq<'T>, + ?selectedIndex: int, + ?title: string, + ?textColor: Xamarin.Forms.Color, + ?selectedIndexChanged: (int * 'T option) -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Picker -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildPicker(0, ?itemsSource=itemsSource, @@ -5799,47 +5799,47 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.HasShadow <- true | ValueNone, ValueNone -> () - static member ConstructFrame(?borderColor: Xamarin.Forms.Color, - ?cornerRadius: double, - ?hasShadow: bool, - ?content: ViewElement, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Frame -> unit), - ?ref: ViewRef) = + static member inline ConstructFrame(?borderColor: Xamarin.Forms.Color, + ?cornerRadius: double, + ?hasShadow: bool, + ?content: ViewElement, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Frame -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildFrame(0, ?borderColor=borderColor, @@ -5988,44 +5988,44 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.IsOpaque <- true | ValueNone, ValueNone -> () - static member ConstructImage(?source: obj, - ?aspect: Xamarin.Forms.Aspect, - ?isOpaque: bool, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Image -> unit), - ?ref: ViewRef) = + static member inline ConstructImage(?source: obj, + ?aspect: Xamarin.Forms.Aspect, + ?isOpaque: bool, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Image -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildImage(0, ?source=source, @@ -6282,52 +6282,52 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.Released.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructImageButton(?command: unit -> unit, - ?source: obj, - ?aspect: Xamarin.Forms.Aspect, - ?borderColor: Xamarin.Forms.Color, - ?borderWidth: double, - ?cornerRadius: int, - ?isOpaque: bool, - ?padding: Xamarin.Forms.Thickness, - ?clicked: System.EventArgs -> unit, - ?pressed: System.EventArgs -> unit, - ?released: System.EventArgs -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ImageButton -> unit), - ?ref: ViewRef) = + static member inline ConstructImageButton(?command: unit -> unit, + ?source: obj, + ?aspect: Xamarin.Forms.Aspect, + ?borderColor: Xamarin.Forms.Color, + ?borderWidth: double, + ?cornerRadius: int, + ?isOpaque: bool, + ?padding: Xamarin.Forms.Thickness, + ?clicked: System.EventArgs -> unit, + ?pressed: System.EventArgs -> unit, + ?released: System.EventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ImageButton -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildImageButton(0, ?command=command, @@ -6453,42 +6453,42 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.Keyboard <- Xamarin.Forms.Keyboard.Default | ValueNone, ValueNone -> () - static member ConstructInputView(?keyboard: Xamarin.Forms.Keyboard, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.InputView -> unit), - ?ref: ViewRef) = + static member inline ConstructInputView(?keyboard: Xamarin.Forms.Keyboard, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.InputView -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildInputView(0, ?keyboard=keyboard, @@ -6716,69 +6716,69 @@ type ViewBuilders() = | ValueSome prevValue, ValueSome currValue -> target.TextChanged.RemoveHandler(prevValue); target.TextChanged.AddHandler(currValue) | ValueNone, ValueSome currValue -> target.TextChanged.AddHandler(currValue) | ValueSome prevValue, ValueNone -> target.TextChanged.RemoveHandler(prevValue) - | ValueNone, ValueNone -> () - match prevAutoSizeOpt, currAutoSizeOpt with - | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () - | _, ValueSome currValue -> target.AutoSize <- currValue - | ValueSome _, ValueNone -> target.AutoSize <- Xamarin.Forms.EditorAutoSizeOption.Disabled - | ValueNone, ValueNone -> () - match prevPlaceholderOpt, currPlaceholderOpt with - | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () - | _, ValueSome currValue -> target.Placeholder <- currValue - | ValueSome _, ValueNone -> target.Placeholder <- null - | ValueNone, ValueNone -> () - match prevPlaceholderColorOpt, currPlaceholderColorOpt with - | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () - | _, ValueSome currValue -> target.PlaceholderColor <- currValue - | ValueSome _, ValueNone -> target.PlaceholderColor <- Xamarin.Forms.Color.Default - | ValueNone, ValueNone -> () - - static member ConstructEditor(?text: string, - ?fontSize: obj, - ?fontFamily: string, - ?fontAttributes: Xamarin.Forms.FontAttributes, - ?textColor: Xamarin.Forms.Color, - ?completed: string -> unit, - ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, - ?autoSize: Xamarin.Forms.EditorAutoSizeOption, - ?placeholder: string, - ?placeholderColor: Xamarin.Forms.Color, - ?keyboard: Xamarin.Forms.Keyboard, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Editor -> unit), - ?ref: ViewRef) = + | ValueNone, ValueNone -> () + match prevAutoSizeOpt, currAutoSizeOpt with + | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () + | _, ValueSome currValue -> target.AutoSize <- currValue + | ValueSome _, ValueNone -> target.AutoSize <- Xamarin.Forms.EditorAutoSizeOption.Disabled + | ValueNone, ValueNone -> () + match prevPlaceholderOpt, currPlaceholderOpt with + | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () + | _, ValueSome currValue -> target.Placeholder <- currValue + | ValueSome _, ValueNone -> target.Placeholder <- null + | ValueNone, ValueNone -> () + match prevPlaceholderColorOpt, currPlaceholderColorOpt with + | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () + | _, ValueSome currValue -> target.PlaceholderColor <- currValue + | ValueSome _, ValueNone -> target.PlaceholderColor <- Xamarin.Forms.Color.Default + | ValueNone, ValueNone -> () + + static member inline ConstructEditor(?text: string, + ?fontSize: obj, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?textColor: Xamarin.Forms.Color, + ?completed: string -> unit, + ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, + ?autoSize: Xamarin.Forms.EditorAutoSizeOption, + ?placeholder: string, + ?placeholderColor: Xamarin.Forms.Color, + ?keyboard: Xamarin.Forms.Keyboard, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Editor -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildEditor(0, ?text=text, @@ -7109,58 +7109,58 @@ type ViewBuilders() = (fun _ curr (target: Xamarin.Forms.Entry) -> match curr with ValueSome value -> target.CursorPosition <- value | ValueNone -> ()) prevCursorPositionOpt currCursorPositionOpt target (fun _ curr (target: Xamarin.Forms.Entry) -> match curr with ValueSome value -> target.SelectionLength <- value | ValueNone -> ()) prevSelectionLengthOpt currSelectionLengthOpt target - static member ConstructEntry(?text: string, - ?placeholder: string, - ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, - ?fontSize: obj, - ?fontFamily: string, - ?fontAttributes: Xamarin.Forms.FontAttributes, - ?textColor: Xamarin.Forms.Color, - ?placeholderColor: Xamarin.Forms.Color, - ?isPassword: bool, - ?completed: string -> unit, - ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, - ?isTextPredictionEnabled: bool, - ?returnType: Xamarin.Forms.ReturnType, - ?returnCommand: unit -> unit, - ?cursorPosition: int, - ?selectionLength: int, - ?keyboard: Xamarin.Forms.Keyboard, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Entry -> unit), - ?ref: ViewRef) = + static member inline ConstructEntry(?text: string, + ?placeholder: string, + ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, + ?fontSize: obj, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?textColor: Xamarin.Forms.Color, + ?placeholderColor: Xamarin.Forms.Color, + ?isPassword: bool, + ?completed: string -> unit, + ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, + ?isTextPredictionEnabled: bool, + ?returnType: Xamarin.Forms.ReturnType, + ?returnCommand: unit -> unit, + ?cursorPosition: int, + ?selectionLength: int, + ?keyboard: Xamarin.Forms.Keyboard, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Entry -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildEntry(0, ?text=text, @@ -7350,20 +7350,20 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.TextChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructEntryCell(?label: string, - ?text: string, - ?keyboard: Xamarin.Forms.Keyboard, - ?placeholder: string, - ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, - ?completed: string -> unit, - ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, - ?height: double, - ?isEnabled: bool, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Fabulous.CustomControls.CustomEntryCell -> unit), - ?ref: ViewRef) = + static member inline ConstructEntryCell(?label: string, + ?text: string, + ?keyboard: Xamarin.Forms.Keyboard, + ?placeholder: string, + ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, + ?completed: string -> unit, + ?textChanged: Xamarin.Forms.TextChangedEventArgs -> unit, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Fabulous.CustomControls.CustomEntryCell -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildEntryCell(0, ?label=label, @@ -7616,53 +7616,53 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.TextDecorations <- Xamarin.Forms.TextDecorations.None | ValueNone, ValueNone -> () - static member ConstructLabel(?text: string, - ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, - ?verticalTextAlignment: Xamarin.Forms.TextAlignment, - ?fontSize: obj, - ?fontFamily: string, - ?fontAttributes: Xamarin.Forms.FontAttributes, - ?textColor: Xamarin.Forms.Color, - ?formattedText: ViewElement, - ?lineBreakMode: Xamarin.Forms.LineBreakMode, - ?lineHeight: double, - ?maxLines: int, - ?textDecorations: Xamarin.Forms.TextDecorations, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Label -> unit), - ?ref: ViewRef) = + static member inline ConstructLabel(?text: string, + ?horizontalTextAlignment: Xamarin.Forms.TextAlignment, + ?verticalTextAlignment: Xamarin.Forms.TextAlignment, + ?fontSize: obj, + ?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?textColor: Xamarin.Forms.Color, + ?formattedText: ViewElement, + ?lineBreakMode: Xamarin.Forms.LineBreakMode, + ?lineHeight: double, + ?maxLines: int, + ?textDecorations: Xamarin.Forms.TextDecorations, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Label -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildLabel(0, ?text=text, @@ -7809,56 +7809,56 @@ type ViewBuilders() = canReuseChild updateChild match prevStackOrientationOpt, currStackOrientationOpt with - | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () - | _, ValueSome currValue -> target.Orientation <- currValue - | ValueSome _, ValueNone -> target.Orientation <- Xamarin.Forms.StackOrientation.Vertical - | ValueNone, ValueNone -> () - match prevSpacingOpt, currSpacingOpt with - | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () - | _, ValueSome currValue -> target.Spacing <- currValue - | ValueSome _, ValueNone -> target.Spacing <- 6.0 - | ValueNone, ValueNone -> () - - static member ConstructStackLayout(?children: ViewElement list, - ?orientation: Xamarin.Forms.StackOrientation, - ?spacing: double, - ?isClippedToBounds: bool, - ?padding: obj, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.StackLayout -> unit), - ?ref: ViewRef) = + | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () + | _, ValueSome currValue -> target.Orientation <- currValue + | ValueSome _, ValueNone -> target.Orientation <- Xamarin.Forms.StackOrientation.Vertical + | ValueNone, ValueNone -> () + match prevSpacingOpt, currSpacingOpt with + | ValueSome prevValue, ValueSome currValue when prevValue = currValue -> () + | _, ValueSome currValue -> target.Spacing <- currValue + | ValueSome _, ValueNone -> target.Spacing <- 6.0 + | ValueNone, ValueNone -> () + + static member inline ConstructStackLayout(?children: ViewElement list, + ?orientation: Xamarin.Forms.StackOrientation, + ?spacing: double, + ?isClippedToBounds: bool, + ?padding: obj, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.StackLayout -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildStackLayout(0, ?children=children, @@ -8061,20 +8061,20 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.TextDecorations <- Xamarin.Forms.TextDecorations.None | ValueNone, ValueNone -> () - static member ConstructSpan(?fontFamily: string, - ?fontAttributes: Xamarin.Forms.FontAttributes, - ?fontSize: obj, - ?backgroundColor: Xamarin.Forms.Color, - ?foregroundColor: Xamarin.Forms.Color, - ?text: string, - ?propertyChanged: System.ComponentModel.PropertyChangedEventArgs -> unit, - ?lineHeight: double, - ?textDecorations: Xamarin.Forms.TextDecorations, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Span -> unit), - ?ref: ViewRef) = + static member inline ConstructSpan(?fontFamily: string, + ?fontAttributes: Xamarin.Forms.FontAttributes, + ?fontSize: obj, + ?backgroundColor: Xamarin.Forms.Color, + ?foregroundColor: Xamarin.Forms.Color, + ?text: string, + ?propertyChanged: System.ComponentModel.PropertyChangedEventArgs -> unit, + ?lineHeight: double, + ?textDecorations: Xamarin.Forms.TextDecorations, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Span -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildSpan(0, ?fontFamily=fontFamily, @@ -8138,12 +8138,12 @@ type ViewBuilders() = canReuseChild updateChild - static member ConstructFormattedString(?spans: ViewElement[], - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.FormattedString -> unit), - ?ref: ViewRef) = + static member inline ConstructFormattedString(?spans: ViewElement[], + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.FormattedString -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildFormattedString(0, ?spans=spans, @@ -8257,44 +8257,44 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.TextColor <- Xamarin.Forms.Color.Default | ValueNone, ValueNone -> () - static member ConstructTimePicker(?time: System.TimeSpan, - ?format: string, - ?textColor: Xamarin.Forms.Color, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.TimePicker -> unit), - ?ref: ViewRef) = + static member inline ConstructTimePicker(?time: System.TimeSpan, + ?format: string, + ?textColor: Xamarin.Forms.Color, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TimePicker -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildTimePicker(0, ?time=time, @@ -8467,46 +8467,46 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.ReloadRequested.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructWebView(?source: Xamarin.Forms.WebViewSource, - ?reload: bool, - ?navigated: Xamarin.Forms.WebNavigatedEventArgs -> unit, - ?navigating: Xamarin.Forms.WebNavigatingEventArgs -> unit, - ?reloadRequested: System.EventArgs -> unit, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.WebView -> unit), - ?ref: ViewRef) = + static member inline ConstructWebView(?source: Xamarin.Forms.WebViewSource, + ?reload: bool, + ?navigated: Xamarin.Forms.WebNavigatedEventArgs -> unit, + ?navigating: Xamarin.Forms.WebNavigatingEventArgs -> unit, + ?reloadRequested: System.EventArgs -> unit, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.WebView -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildWebView(0, ?source=source, @@ -8747,47 +8747,47 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.LayoutChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructPage(?title: string, - ?backgroundImage: string, - ?icon: string, - ?isBusy: bool, - ?padding: obj, - ?toolbarItems: ViewElement list, - ?useSafeArea: bool, - ?appearing: unit -> unit, - ?disappearing: unit -> unit, - ?layoutChanged: unit -> unit, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.Page -> unit), - ?ref: ViewRef) = + static member inline ConstructPage(?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.Page -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildPage(0, ?title=title, @@ -8939,50 +8939,50 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.CurrentPageChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructCarouselPage(?children: ViewElement list, - ?currentPage: int, - ?currentPageChanged: int option -> unit, - ?title: string, - ?backgroundImage: string, - ?icon: string, - ?isBusy: bool, - ?padding: obj, - ?toolbarItems: ViewElement list, - ?useSafeArea: bool, - ?appearing: unit -> unit, - ?disappearing: unit -> unit, - ?layoutChanged: unit -> unit, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.CarouselPage -> unit), - ?ref: ViewRef) = + static member inline ConstructCarouselPage(?children: ViewElement list, + ?currentPage: int, + ?currentPageChanged: int option -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.CarouselPage -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildCarouselPage(0, ?children=children, @@ -9219,53 +9219,53 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.Pushed.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructNavigationPage(?pages: ViewElement list, - ?barBackgroundColor: Xamarin.Forms.Color, - ?barTextColor: Xamarin.Forms.Color, - ?popped: Xamarin.Forms.NavigationEventArgs -> unit, - ?poppedToRoot: Xamarin.Forms.NavigationEventArgs -> unit, - ?pushed: Xamarin.Forms.NavigationEventArgs -> unit, - ?title: string, - ?backgroundImage: string, - ?icon: string, - ?isBusy: bool, - ?padding: obj, - ?toolbarItems: ViewElement list, - ?useSafeArea: bool, - ?appearing: unit -> unit, - ?disappearing: unit -> unit, - ?layoutChanged: unit -> unit, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.NavigationPage -> unit), - ?ref: ViewRef) = + static member inline ConstructNavigationPage(?pages: ViewElement list, + ?barBackgroundColor: Xamarin.Forms.Color, + ?barTextColor: Xamarin.Forms.Color, + ?popped: Xamarin.Forms.NavigationEventArgs -> unit, + ?poppedToRoot: Xamarin.Forms.NavigationEventArgs -> unit, + ?pushed: Xamarin.Forms.NavigationEventArgs -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.NavigationPage -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildNavigationPage(0, ?pages=pages, @@ -9451,52 +9451,52 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.CurrentPageChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructTabbedPage(?children: ViewElement list, - ?barBackgroundColor: Xamarin.Forms.Color, - ?barTextColor: Xamarin.Forms.Color, - ?currentPage: int, - ?currentPageChanged: int option -> unit, - ?title: string, - ?backgroundImage: string, - ?icon: string, - ?isBusy: bool, - ?padding: obj, - ?toolbarItems: ViewElement list, - ?useSafeArea: bool, - ?appearing: unit -> unit, - ?disappearing: unit -> unit, - ?layoutChanged: unit -> unit, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.TabbedPage -> unit), - ?ref: ViewRef) = + static member inline ConstructTabbedPage(?children: ViewElement list, + ?barBackgroundColor: Xamarin.Forms.Color, + ?barTextColor: Xamarin.Forms.Color, + ?currentPage: int, + ?currentPageChanged: int option -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TabbedPage -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildTabbedPage(0, ?children=children, @@ -9628,64 +9628,64 @@ type ViewBuilders() = | ValueSome prev -> for kvp in prev.AttributesKeyed do if kvp.Key = ViewAttributes.ContentAttribKey.KeyValue then - prevContentOpt <- ValueSome (kvp.Value :?> ViewElement) - if kvp.Key = ViewAttributes.OnSizeAllocatedCallbackAttribKey.KeyValue then - prevOnSizeAllocatedCallbackOpt <- ValueSome (kvp.Value :?> FSharp.Control.Handler<(double * double)>) - match prevContentOpt, currContentOpt with - // For structured objects, dependsOn on reference equality - | ValueSome prevValue, ValueSome newValue when identical prevValue newValue -> () - | ValueSome prevValue, ValueSome newValue when canReuseChild prevValue newValue -> - newValue.UpdateIncremental(prevValue, target.Content) - | _, ValueSome newValue -> - target.Content <- (newValue.Create() :?> Xamarin.Forms.View) - | ValueSome _, ValueNone -> - target.Content <- null - | ValueNone, ValueNone -> () - updateOnSizeAllocated prevOnSizeAllocatedCallbackOpt currOnSizeAllocatedCallbackOpt target - - static member ConstructContentPage(?content: ViewElement, - ?onSizeAllocated: (double * double) -> unit, - ?title: string, - ?backgroundImage: string, - ?icon: string, - ?isBusy: bool, - ?padding: obj, - ?toolbarItems: ViewElement list, - ?useSafeArea: bool, - ?appearing: unit -> unit, - ?disappearing: unit -> unit, - ?layoutChanged: unit -> unit, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ContentPage -> unit), - ?ref: ViewRef) = + prevContentOpt <- ValueSome (kvp.Value :?> ViewElement) + if kvp.Key = ViewAttributes.OnSizeAllocatedCallbackAttribKey.KeyValue then + prevOnSizeAllocatedCallbackOpt <- ValueSome (kvp.Value :?> FSharp.Control.Handler<(double * double)>) + match prevContentOpt, currContentOpt with + // For structured objects, dependsOn on reference equality + | ValueSome prevValue, ValueSome newValue when identical prevValue newValue -> () + | ValueSome prevValue, ValueSome newValue when canReuseChild prevValue newValue -> + newValue.UpdateIncremental(prevValue, target.Content) + | _, ValueSome newValue -> + target.Content <- (newValue.Create() :?> Xamarin.Forms.View) + | ValueSome _, ValueNone -> + target.Content <- null + | ValueNone, ValueNone -> () + updateOnSizeAllocated prevOnSizeAllocatedCallbackOpt currOnSizeAllocatedCallbackOpt target + + static member inline ConstructContentPage(?content: ViewElement, + ?onSizeAllocated: (double * double) -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ContentPage -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildContentPage(0, ?content=content, @@ -9895,53 +9895,53 @@ type ViewBuilders() = | ValueSome prevValue, ValueNone -> target.IsPresentedChanged.RemoveHandler(prevValue) | ValueNone, ValueNone -> () - static member ConstructMasterDetailPage(?master: ViewElement, - ?detail: ViewElement, - ?isGestureEnabled: bool, - ?isPresented: bool, - ?masterBehavior: Xamarin.Forms.MasterBehavior, - ?isPresentedChanged: bool -> unit, - ?title: string, - ?backgroundImage: string, - ?icon: string, - ?isBusy: bool, - ?padding: obj, - ?toolbarItems: ViewElement list, - ?useSafeArea: bool, - ?appearing: unit -> unit, - ?disappearing: unit -> unit, - ?layoutChanged: unit -> unit, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.MasterDetailPage -> unit), - ?ref: ViewRef) = + static member inline ConstructMasterDetailPage(?master: ViewElement, + ?detail: ViewElement, + ?isGestureEnabled: bool, + ?isPresented: bool, + ?masterBehavior: Xamarin.Forms.MasterBehavior, + ?isPresentedChanged: bool -> unit, + ?title: string, + ?backgroundImage: string, + ?icon: string, + ?isBusy: bool, + ?padding: obj, + ?toolbarItems: ViewElement list, + ?useSafeArea: bool, + ?appearing: unit -> unit, + ?disappearing: unit -> unit, + ?layoutChanged: unit -> unit, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.MasterDetailPage -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildMasterDetailPage(0, ?master=master, @@ -10090,16 +10090,16 @@ type ViewBuilders() = | ValueNone, ValueNone -> () updateAccelerator prevAcceleratorOpt currAcceleratorOpt target - static member ConstructMenuItem(?text: string, - ?command: unit -> unit, - ?commandParameter: System.Object, - ?icon: string, - ?accelerator: string, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.MenuItem -> unit), - ?ref: ViewRef) = + static member inline ConstructMenuItem(?text: string, + ?command: unit -> unit, + ?commandParameter: System.Object, + ?icon: string, + ?accelerator: string, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.MenuItem -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildMenuItem(0, ?text=text, @@ -10237,20 +10237,20 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.CommandParameter <- null | ValueNone, ValueNone -> () - static member ConstructTextCell(?text: string, - ?detail: string, - ?textColor: Xamarin.Forms.Color, - ?detailColor: Xamarin.Forms.Color, - ?command: unit -> unit, - ?canExecute: bool, - ?commandParameter: System.Object, - ?height: double, - ?isEnabled: bool, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.TextCell -> unit), - ?ref: ViewRef) = + static member inline ConstructTextCell(?text: string, + ?detail: string, + ?textColor: Xamarin.Forms.Color, + ?detailColor: Xamarin.Forms.Color, + ?command: unit -> unit, + ?canExecute: bool, + ?commandParameter: System.Object, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.TextCell -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildTextCell(0, ?text=text, @@ -10333,18 +10333,18 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.Priority <- 0 | ValueNone, ValueNone -> () - static member ConstructToolbarItem(?order: Xamarin.Forms.ToolbarItemOrder, - ?priority: int, - ?text: string, - ?command: unit -> unit, - ?commandParameter: System.Object, - ?icon: string, - ?accelerator: string, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ToolbarItem -> unit), - ?ref: ViewRef) = + static member inline ConstructToolbarItem(?order: Xamarin.Forms.ToolbarItemOrder, + ?priority: int, + ?text: string, + ?command: unit -> unit, + ?commandParameter: System.Object, + ?icon: string, + ?accelerator: string, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ToolbarItem -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildToolbarItem(0, ?order=order, @@ -10415,21 +10415,21 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.ImageSource <- null | ValueNone, ValueNone -> () - static member ConstructImageCell(?imageSource: obj, - ?text: string, - ?detail: string, - ?textColor: Xamarin.Forms.Color, - ?detailColor: Xamarin.Forms.Color, - ?command: unit -> unit, - ?canExecute: bool, - ?commandParameter: System.Object, - ?height: double, - ?isEnabled: bool, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ImageCell -> unit), - ?ref: ViewRef) = + static member inline ConstructImageCell(?imageSource: obj, + ?text: string, + ?detail: string, + ?textColor: Xamarin.Forms.Color, + ?detailColor: Xamarin.Forms.Color, + ?command: unit -> unit, + ?canExecute: bool, + ?commandParameter: System.Object, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ImageCell -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildImageCell(0, ?imageSource=imageSource, @@ -10501,14 +10501,14 @@ type ViewBuilders() = target.View <- null | ValueNone, ValueNone -> () - static member ConstructViewCell(?view: ViewElement, - ?height: double, - ?isEnabled: bool, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ViewCell -> unit), - ?ref: ViewRef) = + static member inline ConstructViewCell(?view: ViewElement, + ?height: double, + ?isEnabled: bool, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ViewCell -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildViewCell(0, ?view=view, @@ -10849,60 +10849,60 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.SelectionMode <- Xamarin.Forms.ListViewSelectionMode.Single | ValueNone, ValueNone -> () - static member ConstructListView(?items: seq, - ?footer: System.Object, - ?hasUnevenRows: bool, - ?header: System.Object, - ?headerTemplate: Xamarin.Forms.DataTemplate, - ?isGroupingEnabled: bool, - ?isPullToRefreshEnabled: bool, - ?isRefreshing: bool, - ?refreshCommand: unit -> unit, - ?rowHeight: int, - ?selectedItem: int option, - ?separatorVisibility: Xamarin.Forms.SeparatorVisibility, - ?separatorColor: Xamarin.Forms.Color, - ?itemAppearing: int -> unit, - ?itemDisappearing: int -> unit, - ?itemSelected: int option -> unit, - ?itemTapped: int -> unit, - ?refreshing: unit -> unit, - ?selectionMode: Xamarin.Forms.ListViewSelectionMode, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ListView -> unit), - ?ref: ViewRef) = + static member inline ConstructListView(?items: seq, + ?footer: System.Object, + ?hasUnevenRows: bool, + ?header: System.Object, + ?headerTemplate: Xamarin.Forms.DataTemplate, + ?isGroupingEnabled: bool, + ?isPullToRefreshEnabled: bool, + ?isRefreshing: bool, + ?refreshCommand: unit -> unit, + ?rowHeight: int, + ?selectedItem: int option, + ?separatorVisibility: Xamarin.Forms.SeparatorVisibility, + ?separatorColor: Xamarin.Forms.Color, + ?itemAppearing: int -> unit, + ?itemDisappearing: int -> unit, + ?itemSelected: int option -> unit, + ?itemTapped: int -> unit, + ?refreshing: unit -> unit, + ?selectionMode: Xamarin.Forms.ListViewSelectionMode, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ListView -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildListView(0, ?items=items, @@ -11271,59 +11271,59 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.SelectionMode <- Xamarin.Forms.ListViewSelectionMode.Single | ValueNone, ValueNone -> () - static member ConstructListViewGrouped(?items: (string * ViewElement * ViewElement list) list, - ?showJumpList: bool, - ?footer: System.Object, - ?hasUnevenRows: bool, - ?header: System.Object, - ?isPullToRefreshEnabled: bool, - ?isRefreshing: bool, - ?refreshCommand: unit -> unit, - ?rowHeight: int, - ?selectedItem: (int * int) option, - ?separatorVisibility: Xamarin.Forms.SeparatorVisibility, - ?separatorColor: Xamarin.Forms.Color, - ?itemAppearing: int * int option -> unit, - ?itemDisappearing: int * int option -> unit, - ?itemSelected: (int * int) option -> unit, - ?itemTapped: int * int -> unit, - ?refreshing: unit -> unit, - ?selectionMode: Xamarin.Forms.ListViewSelectionMode, - ?horizontalOptions: Xamarin.Forms.LayoutOptions, - ?verticalOptions: Xamarin.Forms.LayoutOptions, - ?margin: obj, - ?gestureRecognizers: ViewElement list, - ?anchorX: double, - ?anchorY: double, - ?backgroundColor: Xamarin.Forms.Color, - ?heightRequest: double, - ?inputTransparent: bool, - ?isEnabled: bool, - ?isVisible: bool, - ?minimumHeightRequest: double, - ?minimumWidthRequest: double, - ?opacity: double, - ?rotation: double, - ?rotationX: double, - ?rotationY: double, - ?scale: double, - ?style: Xamarin.Forms.Style, - ?styleClass: obj, - ?translationX: double, - ?translationY: double, - ?widthRequest: double, - ?resources: (string * obj) list, - ?styles: Xamarin.Forms.Style list, - ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, - ?isTabStop: bool, - ?scaleX: double, - ?scaleY: double, - ?tabIndex: int, - ?classId: string, - ?styleId: string, - ?automationId: string, - ?created: (Xamarin.Forms.ListView -> unit), - ?ref: ViewRef) = + static member inline ConstructListViewGrouped(?items: (string * ViewElement * ViewElement list) list, + ?showJumpList: bool, + ?footer: System.Object, + ?hasUnevenRows: bool, + ?header: System.Object, + ?isPullToRefreshEnabled: bool, + ?isRefreshing: bool, + ?refreshCommand: unit -> unit, + ?rowHeight: int, + ?selectedItem: (int * int) option, + ?separatorVisibility: Xamarin.Forms.SeparatorVisibility, + ?separatorColor: Xamarin.Forms.Color, + ?itemAppearing: int * int option -> unit, + ?itemDisappearing: int * int option -> unit, + ?itemSelected: (int * int) option -> unit, + ?itemTapped: int * int -> unit, + ?refreshing: unit -> unit, + ?selectionMode: Xamarin.Forms.ListViewSelectionMode, + ?horizontalOptions: Xamarin.Forms.LayoutOptions, + ?verticalOptions: Xamarin.Forms.LayoutOptions, + ?margin: obj, + ?gestureRecognizers: ViewElement list, + ?anchorX: double, + ?anchorY: double, + ?backgroundColor: Xamarin.Forms.Color, + ?heightRequest: double, + ?inputTransparent: bool, + ?isEnabled: bool, + ?isVisible: bool, + ?minimumHeightRequest: double, + ?minimumWidthRequest: double, + ?opacity: double, + ?rotation: double, + ?rotationX: double, + ?rotationY: double, + ?scale: double, + ?style: Xamarin.Forms.Style, + ?styleClass: obj, + ?translationX: double, + ?translationY: double, + ?widthRequest: double, + ?resources: (string * obj) list, + ?styles: Xamarin.Forms.Style list, + ?styleSheets: Xamarin.Forms.StyleSheets.StyleSheet list, + ?isTabStop: bool, + ?scaleX: double, + ?scaleY: double, + ?tabIndex: int, + ?classId: string, + ?styleId: string, + ?automationId: string, + ?created: (Xamarin.Forms.ListView -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildListViewGrouped(0, ?items=items, diff --git a/tests/Generator.Tests/CodeGeneratorTests.fs b/tests/Generator.Tests/CodeGeneratorTests.fs index c9f947b34..70334ebee 100644 --- a/tests/Generator.Tests/CodeGeneratorTests.fs +++ b/tests/Generator.Tests/CodeGeneratorTests.fs @@ -388,7 +388,7 @@ type ViewProto() = FullName = "Xamarin.Forms.View" Members = [| |]} """ - static member ConstructView() = + static member inline ConstructView() = let attribBuilder = ViewBuilders.BuildView(0) @@ -407,10 +407,10 @@ type ViewProto() = { LowerShortName = "created"; InputType = "" } { LowerShortName = "ref"; InputType = "" } |] } """ - static member ConstructButton(?text: string, - ?canExecute: bool, - ?created: (Xamarin.Forms.Button -> unit), - ?ref: ViewRef) = + static member inline ConstructButton(?text: string, + ?canExecute: bool, + ?created: (Xamarin.Forms.Button -> unit), + ?ref: ViewRef) = let attribBuilder = ViewBuilders.BuildButton(0, ?text=text, @@ -510,7 +510,7 @@ type ViewBuilders() = | ValueSome _, ValueNone -> target.Text <- null | ValueNone, ValueNone -> () - static member ConstructButton(?text: string) = + static member inline ConstructButton(?text: string) = let attribBuilder = ViewBuilders.BuildButton(0, ?text=text) diff --git a/tools/Generator/CodeGenerator.fs b/tools/Generator/CodeGenerator.fs index f7b517b7e..98e7e0db2 100644 --- a/tools/Generator/CodeGenerator.fs +++ b/tools/Generator/CodeGenerator.fs @@ -217,7 +217,7 @@ module CodeGenerator = w let generateConstruct (data: ConstructData) (w: StringWriter) = - let memberNewLine = "\n " + String.replicate data.Name.Length " " + " " + let memberNewLine = "\n " + String.replicate data.Name.Length " " + " " let space = "\n " let membersForConstructor = data.Members @@ -237,7 +237,7 @@ module CodeGenerator = | _ -> sprintf ",%s?%s=%s" space m.LowerShortName m.LowerShortName) |> Array.fold (+) "" - w.printfn " static member Construct%s(%s) = " data.Name membersForConstructor + w.printfn " static member inline Construct%s(%s) = " data.Name membersForConstructor w.printfn "" w.printfn " let attribBuilder = ViewBuilders.Build%s(0%s)" data.Name membersForBuild w.printfn ""