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
2
votes
1 answer

Support for plugin architecture in Elmish.WPF app?

I know how to do this: Find and load plugin assemblies at runtime. Instantiate instances of plugins, including XAML-based views. Place the XAML-based view on the screen. I think I can even update msg model from my application's update to the…
Wallace Kelly
  • 15,565
  • 8
  • 50
  • 71
1
vote
1 answer

Elmish.WPF - binding collection to multiple instances of a window

The sample NewWindow (https://github.com/elmish/Elmish.WPF/tree/master/src/Samples), shows how to open new windows and bind the DataContext to the application model. Given a model //App.fs type Model = { Window1Data: Window1Model ...} a…
Franco Tiveron
  • 2,364
  • 18
  • 34
1
vote
1 answer

How does Elmish.WPF marshall secondary windows into the main function?

How do the various #Windows (mainWindow, createWindow1, and createWindow2) get marshalled as parameters when calling the Elmish.WPF NewWindow code sample Program.fs as seen here ... let main mainWindow (createWindow1: Func<#Window>) (createWindow2:…
rfreytag
  • 955
  • 1
  • 8
  • 24
1
vote
0 answers

In Elmish.WPF, can submodels be run asynchronously or in parallel?

I apologize upfront for all the code following this question. Its included to answer any questions -- I hope. In Elmish.WPF, I have submodels of submodels of submodels. Each submodel is esentially a list. That is, I have a main DataGrid, an…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
1
vote
1 answer

Selecting all text in a textbox using cmdParam (Elmish.WPF/F#)

In order to select all text in a textbox with a click in a WPF app as well as in an Elmish.WPF app, I can use this C#/XAML code: file SettingsPage.xaml: file…
1
vote
2 answers

With Elmish.wpf/F#, how to display in WPF a string option as the string or null, not "Some(string)"?

I am a newbie to F#. In WPF, I am using DisplayMemberBinding within a Datagrid as:
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
1
vote
1 answer

In Elmish.WPF (F#), how is the Binding written to support a tabcontrol within another tabcontrol with different models?

As a complete newbie (but learning fast), I've been studying through Elmish.wpf but it is unclear to me how to manage a TabControl placed on a TabItem of another TabControl. For example, in Xaml, the top level window is:
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
1
vote
0 answers

How to set the ViewModel type in F# Elmish.WPF for use by a WPF DataTemplate?

I am learning to use Elmish.WPF. Below is typical XAML code for a tab control with a simple example of the UserControl ContactDetailsView: XMAL:
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
1
vote
0 answers

A newbie setup for Elmish.WPF in Visual Studio 2019

At the risk of beating a dead horse, I would like to be clear on the initial setup for using Elmish.WPF. My intent is to have essentially two projects: FrontOfficeV -- a C# project to hold the XAML's, Windows, etc.. Models -- a F# project for…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
1
vote
1 answer

Fix XamlObjectWriterException, Cannot create unknown type in F#, FsXaml, WPF app?

I am getting this error in a WPF app that is built with F#, FsXaml, and Elmish.WPF. System.Xaml.XamlObjectWriterException: Cannot create unknown type '{http://schemas.componentone.com/winfx/2006/xaml}C1ProgressIndicator'. at…
Wallace Kelly
  • 15,565
  • 8
  • 50
  • 71
0
votes
0 answers

How to send a message to the Dispatcher from a custom event in Elmish.wpf/Elmish?

In F#, I have a custom event as a singleton: type EventMediator private () = let mutable _name = ""; static member val private _instance = lazy EventMediator() static member Instance = EventMediator._instance.Value member val…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
0
votes
1 answer

In Elemish.WPF, can a parameter be sent when modal window is closed?

I have a MainWindow which opens a modal window (following the NewWindow example in the Elmish.WPF tutorial). My modal window deals almost exclusively with visual elements in xaml and C# code (i.e., handwriting recognition). Aside from creating a…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
0
votes
0 answers

How to approach writing a WPF Custom Control in F#?

I am trying to understand how a wpf custom control could be written in F#. As an example, I have the following C# code for a drag and drop on a canvas (in C#). It inherits from ListBox. I'm not looking for anybody to rewrite this. But I'm at a loss…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
0
votes
3 answers

How to update the WPF GUI from non-blocking async methods in F#

System.InvalidOperationException: 'The calling thread cannot access this object because a different thread owns it.' I have a WPF GUI with a button that when clicked does: starts a control animation (on the GUI), and starts a background process to…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
0
votes
1 answer

In C#, how to get the class/module type of an F#/Elmish.WPF object?

I am attempting to mix F# with C#. In my C# Dependency property, I need the type of e.NewValue -- which is a supplied object from F#/Elmish.WPF e.NewValue.GetType() returns: {Name = "ViewModel2" FullName = "Elmish.WPF.ViewModel2[[System.Object,…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95