Github GitHub - fsprojects/Avalonia.FuncUI: Develop cross-plattform MVU GUI Appl...
source link: https://github.com/fsprojects/Avalonia.FuncUI
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Avalonia FuncUI
Develop cross-platform MVU GUI Applications using F# and Avalonia!
(Application was created using Avalonia.FuncUI!)
About
This library allows you to write cross-platform GUI Applications entirely in F# - No XAML, but a declarative Elm-like DSL. MVU (Model-View-Update) architecture support is built in, and bindings to use it with Elmish are also ready to use.
Getting started
Contributing
Please contribute to this library through issue reports, pull requests, code reviews, documentation, and discussion.
Example
Below is the code of a simple counter app (using the Avalonia.FuncUI.Elmish package).
module Counter = type CounterState = { count : int } let init = { count = 0 } type Msg = | Increment | Decrement let update (msg: Msg) (state: CounterState) : CounterState = match msg with | Increment -> { state with count = state.count + 1 } | Decrement -> { state with count = state.count - 1 } let view (state: CounterState) (dispatch): IView = DockPanel.create [ DockPanel.children [ Button.create [ Button.onClick (fun _ -> dispatch Increment) Button.content "click to increment" ] Button.create [ Button.onClick (fun _ -> dispatch Decrement) Button.content "click to decrement" ] TextBlock.create [ TextBlock.dock Dock.Top TextBlock.text (sprintf "the count is %i" state.count) ] ] ]
Maintainer(s)
The default maintainer account for projects under "fsprojects" is @fsprojectsgit - F# Community Project Incubation Space (repo management)
Recommend
-
8
This repo contains archival material about "F# for AI Models". Contents: FM: An F# DSL for AI Models with separated shape checking and tooling FM was a prototype F# eDSL for writing numeric models. It ha...
-
12
Collaborator nojaf commented
-
8
Conversation Copy link Contributor ...
-
6
FSharp.Data.Adaptive FSharp.Data.Adaptive provides a clean API for handling changeable ("adaptive") data while sticking to functional principles. It allows programmers to treat adaptive values just like immutable data while...
-
6
Copy link Collaborator nojaf commented
-
5
FSharp.UMX F# Units of Measure for primitive non-numeric types by Eirik Tsarpalis. Compatible with Fable. Installing Add the FSharp.UMX package from Nuget or just copy the src/FSharp.UMX.fs
-
6
FSharp.Interop.Dynamic The F# Dynamic Operator, powered by the DLR. Compiled for .NET Standard 2.0, .NET Standard 1.6, .NET Framework 4.5 Install from NuGet...
-
35
Making your WPF app cross platform with Avalonia UI – Bruno Sonnino
-
4
April 18, 2023 Writing a Cross-Platform Clock App With Avalonia UI and NXUI
-
3
AvaloniaUI/Avalonia.Essentials: Essential cross platform APIs for your mobile apps. Skip to content...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK