F# XAML DataGrid ComboBox

Viewed 40

Hello Thanks for you Help...

I have a WPF application that I am trying to Create a Combobox in and pass the combobox a list of strings.

Below is my XAML code with a is inside DataGrid.Columns

<DataGridTextColumn Header="Mapping Notes"  Binding="{Binding Path=MappingNote}" />
<DataGridComboBoxColumn x:Name="functionArg1Combobox" Header="Arg1" ItemsSource="{Binding ArgumentDropDownList}" SelectedItemBinding="{Binding Path=arg1}" />

In F# I have Type FDMappingRow under that I create a member

type FDMappingRow() =
let mutable targetField: string = "initial target"
            let mutable speacialFunction: string = "innitial function"
            let mutable mappingNote: string = "ATesting"
            let mutable argumentDropDownList: System.Collections.Generic.List<string> = new List<string>()

 member x.MappingNote
                with get() = mappingNote
                and set(t) = 
                    mappingNote <- t
                    x.TriggerPropertyChanged "MappingNote"
        
        //Testing to see if I can get Combobox working
            member x.Argument1
                with get() = argumentDropDownList
                and set(t) = 
                    argumentDropDownList <- t
                    x.TriggerPropertyChanged "and pass it that list into to populate the combobox"

Basically my question is how do I take the statement below and pass it this

"let mutable argumentDropDownList: System.Collections.Generic.List = new"

so I can populate the ComboBox?

member x.Argument1
                    with get() = argumentDropDownList
                    and set(t) = 
                        argumentDropDownList <- t
                        x.TriggerPropertyChanged "and pass it that list into to populate the combobox"

What is the correct syntax?

This would help me a lot. I can get Mapping Notes working correctly cause it just a txt box but cant figure out for DataGridComboBoxColumn

0 Answers
Related