Questions tagged [elmish-wpf]

an Elm-like model-view-update architecture implemented in F#, to build WPF applications.

WPF done the Elmish Way. The Elmish.WPF library uses Elmish, a model-view-update architecture implemented in F#, to build WPF applications.

Never write a ViewModel class again!

33 questions
4
votes
1 answer

How to manage multiple windows, usercontrols, and customcontrols with Elmish.wpf and F#?

I am a newbie to F#. I have recently be introduced to Elmish.wpf and the MVU design. The application I am working with is in C# WPF with many WPF usercontrols, customcontrols, and windows. It appears that Elmish.wpf flattens the concept of…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
3
votes
0 answers

In Elmish/Elmish.WPF, This construct causes code to be less generic .... The type varable 'a has been constrained to be type 'Msg'

This statement in the update: let update m msg = match msg with | SetEncounterMsg encounter -> match encounter with | None -> init() , Cmd.none | Some s -> init () |> (fun q -> {q with Encounter = Some s}), …
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
3
votes
1 answer

Updating ProgressBar.Value in FsXaml and ElmishWPF

I am trying to update ProgressBar.Value in FsXaml. In C#, I used the below-mentioned code. I haven't tried to implement the C# approach in F# as using a public field (myCaller) does not seem to me as being a functional approach (let alone the fact…
3
votes
1 answer

Elmish.Wpf binding for LiveCharts LabelFormatter

I am trying to convert the LiveCharts example for a Basic Line Chart to use with Elmish.Wpf I have bindings for everything except the "YFormatter". What sort of Binding should I use? type Model = { AllSeries: SeriesCollection Labels:…
Paul Smith
  • 109
  • 4
3
votes
1 answer

Managing a WPF Tab Control with Elmish.WPF (F#)?

I have a complex WPF Tab control inside a main main window, all in C#, using .NET Framework. The main window provides a consistent main menu and a contentcontrol holding the Tab Control. Each tab of the tab control presents a different usercontrol…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
2
votes
1 answer

Elmish.WPF type conflict: unit -> Model expected where Model provided?

My Elmish.WPF app combines the Elmish.WPF Sample projects ‘NewWindow’ + ‘NewWindow.Core’ which I am adding to a copy of ‘FileDialogsCmdMsg’ + ‘FileDialogsCmdMsg.Core’. FileDialogsCmdMsg is the basis of this effort and provides the background…
rfreytag
  • 955
  • 1
  • 8
  • 24
2
votes
2 answers

Type Elmish.WPF main() function reports binding () -> #Window as an error

Why does my version of the Elmish.WPF Sample NewWindow (XAML code and F# Core) emit the error ... The type 'unit -> 'a' is not compatible with the type 'Window'. The same line emits the warning... This construct causes code to be less generic…
rfreytag
  • 955
  • 1
  • 8
  • 24
2
votes
1 answer

In the new Elmish.WPF 4.0 beta version, where is runWindowWithConfig?

I've been playing with the new beta version of Elmish.WPF 4.0 and can't seem to find Program.runWindowWithConfig. Has it been replaced? let entryPoint (_: string[], mainWindow: Window) = Program.mkProgram init update bindings |>…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
2
votes
1 answer

Changing an Elmish.WPF model from inside an async function

What is the accepted way in Elmish.WPF to have a Binding.cmd calling an async computation expression (CE) allow the delayed result of the async CE change the shared top-level model? I want to do this without causing the UI thread to hang or starve…
rfreytag
  • 955
  • 1
  • 8
  • 24
2
votes
0 answers

Elmish.WPF config file problems in Visual Studio 2019 on Win10

As a C# developer my solution (*.sln) and project (*.csproj) configuration files are rarely a problem and Visual Studio (VS) manages things well. Result is I am largely unaware of this essential plumbing. But now learning F# and Elmish.WPF I…
rfreytag
  • 955
  • 1
  • 8
  • 24
2
votes
1 answer

Can Model View Update be used with Uno Platform?

I am looking into using the Model View Update pattern in Uno Platform. Just like this project: https://github.com/unoplatform/Elmish.Uno However, Elmish.Uno is troubled: A: 3 years since last maintainance B: from the page and docs, it is unclear to…
user7470355
2
votes
2 answers

How is child/submodel to parent/main model messaging done in Elmish.WPF?

(Newbie question). In Elmish.WPF, I have a parent module, App, holding a child submodule, FinderLastName: module App = type Model = { FinderLastName: FinderLastName.Model } type Msg = |…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
2
votes
1 answer

In Elmish.WFP, how is an Indexed-Binding made for a DataGrid? (Binding to a list element)

In the below UserControl for a DataGrid, the line: performs a binding to a column by its index, how is this binding made in…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
2
votes
0 answers

How to use F# modules from C# XAML for DataTemplates and DataContext?

I am starting to learn F#/Elmish from the top down. I have found alot of information on F#, but very little on moving from C# to F#. my topmost XAML is:
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
2
votes
1 answer

How to start multiple windows from F# using Elmish.WPF?

I am a newbie to Elmish.WPF and F#. In studying the tutorial on NewWindow/NewWindow.Views, the authors have assigned the following code from C# : using System; using Elmish.WPF.Samples.NewWindow; using static…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
1
2 3