Skip to content

Integrating LiveCharts2 into Elmish app #340

Answered by JaggerJo
matthewcrews asked this question in Q&A
Discussion options

You must be logged in to vote

You need to "follow the API" when creating bindings. Take a look at existing bindings for the basic Avalonia controls. It's usually a 1:1 mapping.

For example:

[<AutoOpen>]
module CartesianChart =

    let create (attrs: IAttr<CartesianChart> list): IView<CartesianChart> =
        ViewBuilder.Create<CartesianChart>(attrs)

    type CartesianChart with

        static member series<'T when 'T :> CartesianChart> (value: seq<ISeries>) : IAttr<'T> =
            AttrBuilder<'T>.CreateProperty<seq<ISeries>>(
                property = CartesianChart.SeriesProperty,
                value = value,
                comparer = ValueNone
            )

If you need more help, I'm open to contract work…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@matthewcrews
Comment options

@matthewcrews
Comment options

@matthewcrews
Comment options

Answer selected by matthewcrews
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants