Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions templates/content/blank/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@
"dataType": "string",
"replaces": "AvaloniaThemesFluentPkgVersion",
"defaultValue": "11.0.10"
},
"AvaloniaDiagnosticsPkgVersion": {
"type": "parameter",
"dataType": "string",
"replaces": "AvaloniaDiagnosticsPkgVersion",
"defaultValue": "11.0.10"
}
}
}
18 changes: 11 additions & 7 deletions templates/content/blank/App.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace NewApp

open Avalonia
open Avalonia.Themes.Fluent
open Fabulous
open Fabulous.Avalonia
Expand Down Expand Up @@ -50,7 +51,7 @@ module App =
else
model, Cmd.none

let view model =
let content model =
(VStack() {
TextBlock($"%d{model.Count}").centerText()

Expand All @@ -75,17 +76,20 @@ module App =
})
.center()

//-:cnd:noEmit

let view model =
//-:cnd:noEmit
#if MOBILE
let app model = SingleViewApplication(view model)
SingleViewApplication(content model)
#else
let app model = DesktopApplication(Window(view model))
DesktopApplication(Window(content model))
#endif

//+:cnd:noEmit
#if DEBUG
.attachDevTools()
#endif

let create () =
let program = Program.statefulWithCmd init update |> Program.withView app
let program = Program.statefulWithCmd init update |> Program.withView view

FabulousAppBuilder.Configure(FluentTheme, program)
//+:cnd:noEmit
1 change: 1 addition & 0 deletions templates/content/blank/NewApp.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Themes.Fluent" Version="AvaloniaThemesFluentPkgVersion" />
<PackageReference Include="Avalonia.Diagnostics" Version="AvaloniaDiagnosticsPkgVersion" />
<PackageReference Include="FSharp.Core" Version="FSharpCorePkgVersion" />
<PackageReference Include="Fabulous" Version="FabulousPkgVersion" />
<PackageReference Include="Fabulous.Avalonia" Version="FabulousAvaloniaPkgVersion" />
Expand Down
6 changes: 6 additions & 0 deletions templates/content/multi/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@
"dataType": "string",
"replaces": "AvaloniaThemesFluentPkgVersion",
"defaultValue": "11.0.10"
},
"AvaloniaDiagnosticsPkgVersion": {
"type": "parameter",
"dataType": "string",
"replaces": "AvaloniaDiagnosticsPkgVersion",
"defaultValue": "11.0.10"
}
}
}
17 changes: 12 additions & 5 deletions templates/content/multi/NewApp/App.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace NewApp

open System
open Avalonia
open Avalonia.Themes.Fluent
open Fabulous
open Fabulous.Avalonia
Expand Down Expand Up @@ -51,7 +52,7 @@ module App =
else
model, Cmd.none

let view model =
let content model =
(VStack() {
TextBlock($"%d{model.Count}").centerText()

Expand All @@ -74,17 +75,23 @@ module App =
Button("Reset", Reset).centerHorizontal()
})

let app model =
let view model =
if
OperatingSystem.IsAndroid()
|| OperatingSystem.IsIOS()
|| OperatingSystem.IsBrowser()
then
SingleViewApplication(view model)
SingleViewApplication(content model)
else
DesktopApplication(Window(view model))
DesktopApplication(Window(content model))

//-:cnd:noEmit
#if DEBUG
.attachDevTools()
#endif

let create () =
let program = Program.statefulWithCmd init update |> Program.withView app
let program = Program.statefulWithCmd init update |> Program.withView view

FabulousAppBuilder.Configure(FluentTheme, program)
//+:cnd:noEmit
1 change: 1 addition & 0 deletions templates/content/multi/NewApp/NewApp.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
<ItemGroup>
<PackageReference Include="Fabulous.Avalonia" Version="FabulousAvaloniaPkgVersion" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="AvaloniaThemesFluentPkgVersion" />
<PackageReference Include="Avalonia.Diagnostics" Version="AvaloniaDiagnosticsPkgVersion" />
</ItemGroup>
</Project>