-
Notifications
You must be signed in to change notification settings - Fork 1
/
Application.fs
46 lines (40 loc) · 1.07 KB
/
Application.fs
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
36
37
38
39
40
41
42
43
44
45
46
// Learn more about F# at http://fsharp.org
open System
open System.Reflection
open Avalonia
open Avalonia.Media
open Avalonia.Controls
open Avalonia.Markup.Xaml
open DSL
type App () =
inherit Application ()
override this.Initialize () =
AvaloniaXamlLoader.Load(this)
[<EntryPoint>]
let main argv =
AppBuilder.Configure<App>()
.UsePlatformDetect()
.SetupWithoutStarting() |> ignore
let mutable textBlockValue = "Hello, world!"
window {
minHeight 100.0
minWidth 100.0
content (
grid {
rowDefinitions [| 20.0; 100.0 |]
content [|
textBlock {
text textBlockValue
row 0
}
button {
text "Click"
click (fun f -> textBlockValue <- "Clicked")
row 1
}
|]
})
title "Hello world from F# DSL"
run
} |> ignore
0 // return an integer exit code