Basic GridViewGenerator usage - SlowLogicBoy/Eto.Generator GitHub Wiki
Basically call:
var gridView = new GridViewGenerator().GetGridView<MyModel>();
Full Code:
#! "netcoreapp2.0"
#r "nuget: Eto.Forms, *"
#r "nuget: Eto.Platform.Gtk, *"
#r "Eto.Generator.dll"
using Eto.Forms;
using Eto.Generator;
class MyModel
{
public string Title { get; set; }
public bool? IsChecked { get; set; }
public List<string> StringList { get; set; }
}
var app = new Application(new Eto.GtkSharp.Platform());
var gridView = new GridViewGenerator().GetGridView<MyModel>(); //That's all you need for basic usage
gridView.DataStore = new []{
new MyModel{
Title = "My First Model",
IsChecked = true,
StringList = new List<string>{
"First",
"Second"
}
},
new MyModel{
Title = "My Second Model",
IsChecked = null,
StringList = null
}
};
app.Run(new Form {
Title = "Generator Test",
Content = gridView
})
Result: