-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathVerticalSplitBox.cs
35 lines (28 loc) · 1.04 KB
/
VerticalSplitBox.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
namespace UniMob.UI.Widgets
{
public class VerticalSplitBox : StatefulWidget
{
public Widget FirstChild { get; set; }
public Widget SecondChild { get; set; }
public override State CreateState() => new VerticalSplitBoxState();
}
public class VerticalSplitBoxState : ViewState<VerticalSplitBox>, IVerticalSplitBoxState
{
private StateHolder _firstChild;
private StateHolder _secondChild;
public override WidgetViewReference View { get; }
= WidgetViewReference.Resource("$$_VerticalSplitBox");
public IState FirstChild => _firstChild.Value;
public IState SecondChild => _secondChild.Value;
public override void InitState()
{
base.InitState();
_firstChild = CreateChild(_ => Widget.FirstChild);
_secondChild = CreateChild(_ => Widget.SecondChild);
}
public override WidgetSize CalculateSize()
{
return WidgetSize.StackY(FirstChild.Size, SecondChild.Size);
}
}
}