JaggerJo.Avalonia.FuncUI.Elmish 0.1.0

Package Description

There is a newer version of this package available.
See the version list below for details.
Install-Package JaggerJo.Avalonia.FuncUI.Elmish -Version 0.1.0
dotnet add package JaggerJo.Avalonia.FuncUI.Elmish --version 0.1.0
<PackageReference Include="JaggerJo.Avalonia.FuncUI.Elmish" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JaggerJo.Avalonia.FuncUI.Elmish --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JaggerJo.Avalonia.FuncUI.Elmish, 0.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install JaggerJo.Avalonia.FuncUI.Elmish as a Cake Addin
#addin nuget:?package=JaggerJo.Avalonia.FuncUI.Elmish&version=0.1.0

// Install JaggerJo.Avalonia.FuncUI.Elmish as a Cake Tool
#tool nuget:?package=JaggerJo.Avalonia.FuncUI.Elmish&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

<img src="github/img/icon.png" width="100"/>

Avalonia.FuncUI

Build Status

Develop cross-plattform MVU GUI Applications using F# and Avalonia!

About

This library allows you to write cross-plattform 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.

Current State

Should be usable, but expect bugs and some breaking changes. Basically wet paint.

Contributing

Please contribute to this library through issue reports, pull requests, code reviews and discussion.

Getting started

Avalonia.FuncUI nuget

Install-Package JaggerJo.Avalonia.FuncUI

Avalonia.FuncUI.Elmish nuget

Install-Package JaggerJo.Avalonia.FuncUI.Elmish

Project templates will follow soon.

For now check out the Examples.

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): View =
        Views.dockPanel [
            Attrs.children [
                Views.button [
                    Attrs.click (fun sender args -> dispatch Increment)
                    Attrs.content "click to increment"
                ]
                Views.button [
                    Attrs.click (fun sender args -> dispatch Decrement)
                    Attrs.content "click to decrement" 
                ]
                Views.textBlock [
                    Attrs.dockPanel_dock Dock.Top
                    Attrs.text (sprintf "the count is %i" state.count)
                ]
            ]
        ]    

<img src="github/img/icon.png" width="100"/>

Avalonia.FuncUI

Build Status

Develop cross-plattform MVU GUI Applications using F# and Avalonia!

About

This library allows you to write cross-plattform 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.

Current State

Should be usable, but expect bugs and some breaking changes. Basically wet paint.

Contributing

Please contribute to this library through issue reports, pull requests, code reviews and discussion.

Getting started

Avalonia.FuncUI nuget

Install-Package JaggerJo.Avalonia.FuncUI

Avalonia.FuncUI.Elmish nuget

Install-Package JaggerJo.Avalonia.FuncUI.Elmish

Project templates will follow soon.

For now check out the Examples.

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): View =
        Views.dockPanel [
            Attrs.children [
                Views.button [
                    Attrs.click (fun sender args -> dispatch Increment)
                    Attrs.content "click to increment"
                ]
                Views.button [
                    Attrs.click (fun sender args -> dispatch Decrement)
                    Attrs.content "click to decrement" 
                ]
                Views.textBlock [
                    Attrs.dockPanel_dock Dock.Top
                    Attrs.text (sprintf "the count is %i" state.count)
                ]
            ]
        ]    

NuGet packages (1)

Showing the top 1 NuGet packages that depend on JaggerJo.Avalonia.FuncUI.Elmish:

Package Downloads
XTargets.FuncUI
Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.5.0-beta 648 12/22/2020
0.4.0 2,485 4/4/2020
0.2.0 545 12/14/2019
0.2.0-beta.1 148 11/30/2019
0.1.0 475 6/21/2019