Maui- Fabulous.MauiControls

[删除(380066935@qq.com或微信通知)]

Fabulous for .NET MAUI (Microsoft.Maui.Controls)

fabulous-dev/Fabulous.MauiControls: Declarative UIs for .NET MAUI Controls with F# and MVU, using Fabulous (github.com)

Fabulous.MauiControls brings the great development experience of Fabulous to .NET MAUI, allowing you to take advantage of the latest cross-platform UI framework from Microsoft with a tailored declarative UI DSL and clean architecture.

Deploy to any platform supported by .NET MAUI, such as Android, iOS, macOS, Windows, Linux and more!

/// A simple Counter app

type Model =
    { Count: int }

type Msg =
    | Increment
    | Decrement

let init () =
    { Count = 0 }

let update msg model =
    match msg with
    | Increment -> { model with Count = model.Count + 1 }
    | Decrement -> { model with Count = model.Count - 1 }

let view model =
    Application(
        ContentPage(
            VStack(spacing = 16.) {
                Image("fabulous.png")

                Label($"Count is {model.Count}")

                Button("Increment", Increment)
                Button("Decrement", Decrement)
            }
        )
    )

Getting Started

You can start your new Fabulous.MauiControls app in a matter of seconds using the dotnet CLI templates.
For a starter guide see our Get Started with Fabulous.MauiControls.

dotnet new install Fabulous.MauiControls.Templates
dotnet new fabulous-mauicontrols -n MyApp