New binding mechanism: Expression tracking

This commit is contained in:
2023-08-15 13:17:42 +02:00
parent 335433562a
commit b792639635
35 changed files with 971 additions and 311 deletions

View File

@@ -0,0 +1,46 @@
using FileTime.App.Core.ViewModels.Timeline;
using TerminalUI.Controls;
using TerminalUI.Extensions;
namespace FileTime.ConsoleUI.App.Controls;
public class Timeline
{
public IView<IRootViewModel> View()
{
var root = new Grid<IRootViewModel>
{
ChildInitializer =
{
new ItemsControl<IRootViewModel, ICommandTimeStateViewModel>()
{
ItemTemplate = () =>
{
var grid = new Grid<ICommandTimeStateViewModel>()
{
ChildInitializer =
{
new TextBlock<ICommandTimeStateViewModel>()
{
}.Setup(t => t.Bind(
t,
dc => dc.DisplayLabel.Value,
t => t.Text))
}
};
return grid;
}
}
.Setup(i => i.Bind(
i,
dc => dc.TimelineViewModel.ParallelCommandsGroups[0].Commands,
i => i.ItemsSource,
v => v))
}
};
return root;
}
}