Created
June 25, 2019 19:17
-
-
Save handicraftsman/3d815b92bb8b5a04f08aca98285fc84d to your computer and use it in GitHub Desktop.
Some more GUI stuff, in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using AirKit; | |
using AirKit.Layout; | |
using AirKit.Material; | |
namespace AirKit.Demo | |
{ | |
class MainView : View | |
{ | |
int value; | |
public override Element* Build() | |
{ | |
return new MatScaffold( | |
appbar: new MatAppBar( | |
title: "AirKit Demo", | |
new LayCenter( | |
horizontal: true, | |
vertical: true, | |
new LayBox( | |
orientation: LayOrientation.VERTICAL, | |
new MatText( | |
text: $"I am ${value}" | |
), | |
new MatButtonBox( | |
new MatButton( | |
raised: true, | |
text: "Increment", | |
onClicked: () => { | |
update(() => { | |
value += 1; | |
}); | |
} | |
), | |
new MatButton( | |
raised: true, | |
text: "Decrement", | |
onClicked: () => { | |
update(() => { | |
value -= 1; | |
}); | |
} | |
) | |
) | |
) | |
) | |
) | |
); | |
} | |
} | |
class Program | |
{ | |
[STAThread] | |
static void Main(string[] args) | |
{ | |
var app = new Application( | |
name: "AirKit Demo", | |
mainView: new MainView() | |
); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment