我是 F# 语言的新手,我必须可以在网格视图中添加一行。
这就是我的 GridView 和代码 C#
public partial class Form1 : Form, IMainView
{
public event EventHandler<ViewEventData> ModelChanged;
private void samplesButton_Click(object sender, EventArgs e)
{}
}
F#
type MainPresenter(view : IMainView) =
let arrayTrackPosition = Array.create 100 ""
let xlApp = new Excel.ApplicationClass()
let xlWorkBookInput = xlApp.Workbooks.Open(@"C:\Projects\Tool\Versuch\VersuchZuEditieren.xlsx")
let viewStateMachine state event =
match state, event with
|{State = _}, SamplesClicked ->
## What come here? ##
{State = "Samples"}
member this.Initialize() = Event.scan viewStateMachine { State = "Consumables" } view.ModelChanged |> ignore
type ViewEventData =
| ConsumablesClicked of BarcodeConsumablesViewModel
| ReagentsClicked of BarcodeReagentsViewModel
| SamplesClicked