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
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,9 @@ jobs:
run: |
dotnet new fabulous-avalonia-multi -n MultiProjectTemplate
dotnet build MultiProjectTemplate -p:ManagePackageVersionsCentrally=false
- name: Test desktop project template
run: |
dotnet new fabulous-avalonia-desktop -n DesktopProjectTemplate
dotnet build DesktopProjectTemplate -p:ManagePackageVersionsCentrally=false
- name: Push
run: dotnet nuget push "nupkgs/*" -s https://nuget.pkg.github.com/fabulous-dev/index.json -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ dotnet new install Fabulous.Avalonia.Templates

Then, you will be able to create new Fabulous.Avalonia projects with `dotnet new`:

#### Desktop Project

Desktop project is a standard Avalonia project that can target Desktop platforms only.

```sh
dotnet new fabulous-avalonia-desktop -n MyApp
```

#### Single Project

Single project takes the platform-specific development experiences and abstracts them into a single shared project that can target Android, iOS, Desktop.
Expand Down
7 changes: 6 additions & 1 deletion src/Fabulous.Avalonia.ColorPicker/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
_No unreleased changes_

## [2.4.0] - 2025-04-07
### Added
- No changes

## [2.3.0] - 2024-01-17
### Added
- No changes
Expand Down Expand Up @@ -36,7 +40,8 @@ _No unreleased changes_
### Added
- Initial release

[unreleased]: https://github.com/fabulous-dev/Fabulous.Avalonia.ColorPicker/compare/2.3.0...HEAD
[unreleased]: https://github.com/fabulous-dev/Fabulous.Avalonia.ColorPicker/compare/2.4.0...HEAD
[2.4.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.ColorPicker/releases/tag/2.4.0
[2.3.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.ColorPicker/releases/tag/2.3.0
[2.2.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.ColorPicker/releases/tag/2.2.0
[2.1.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.ColorPicker/releases/tag/2.1.0
Expand Down
7 changes: 6 additions & 1 deletion src/Fabulous.Avalonia.DataGrid/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
_No unreleased changes_

## [2.4.0] - 2025-04-07
### Added
- No changes

## [2.3.0] - 2024-01-17
### Added
- No changes
Expand Down Expand Up @@ -36,7 +40,8 @@ _No unreleased changes_
### Added
- Initial release

[unreleased]: https://github.com/fabulous-dev/Fabulous.Avalonia.DataGrid/compare/2.3.0...HEAD
[unreleased]: https://github.com/fabulous-dev/Fabulous.Avalonia.DataGrid/compare/2.4.0...HEAD
[2.4.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.DataGrid/releases/tag/2.4.0
[2.3.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.DataGrid/releases/tag/2.3.0
[2.2.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.DataGrid/releases/tag/2.2.0
[2.1.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.DataGrid/releases/tag/2.1.0
Expand Down
7 changes: 6 additions & 1 deletion src/Fabulous.Avalonia.ItemsRepeater/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
_No unreleased changes_

## [2.4.0] - 2025-04-07
### Added
- No changes

## [2.3.0] - 2024-01-17
### Added
- No changes
Expand All @@ -32,7 +36,8 @@ _No unreleased changes_
### Added
- Initial release

[unreleased]: https://github.com/fabulous-dev/Fabulous.Avalonia.ItemsRepeater/compare/2.3.0...HEAD
[unreleased]: https://github.com/fabulous-dev/Fabulous.Avalonia.ItemsRepeater/compare/2.4.0...HEAD
[2.4.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.ItemsRepeater/releases/tag/2.4.0
[2.3.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.ItemsRepeater/releases/tag/2.3.0
[2.2.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.ItemsRepeater/releases/tag/2.2.0
[2.1.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.ItemsRepeater/releases/tag/2.1.0
Expand Down
7 changes: 6 additions & 1 deletion src/Fabulous.Avalonia.TreeDataGrid/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
_No unreleased changes_

## [2.4.0] - 2025-04-07
### Added
- No changes

## [2.3.0] - 2024-01-17
### Added
- No changes
Expand All @@ -32,7 +36,8 @@ _No unreleased changes_
### Added
- Initial release

[unreleased]: https://github.com/fabulous-dev/Fabulous.Avalonia.TreeDataGrid/compare/2.3.0...HEAD
[unreleased]: https://github.com/fabulous-dev/Fabulous.Avalonia.TreeDataGrid/compare/2.4.0...HEAD
[2.4.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.TreeDataGrid/releases/tag/2.4.0
[2.3.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.TreeDataGrid/releases/tag/2.3.0
[2.2.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.TreeDataGrid/releases/tag/2.2.0
[2.1.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.TreeDataGrid/releases/tag/2.1.0
Expand Down
7 changes: 6 additions & 1 deletion src/Fabulous.Avalonia/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
_No unreleased changes_

## [2.4.0] - 2025-04-07
### Added
- No changes

## [2.3.0] - 2024-01-17
### Added
- ImageSource constructors and modifiers consolidations
Expand Down Expand Up @@ -174,7 +178,8 @@ _No unreleased changes_
### Added
- Initial release

[unreleased]: https://github.com/fabulous-dev/Fabulous.Avalonia/compare/2.3.0...HEAD
[unreleased]: https://github.com/fabulous-dev/Fabulous.Avalonia/compare/2.4.0...HEAD
[2.4.0]: https://github.com/fabulous-dev/Fabulous.Avalonia/releases/tag/2.4.0
[2.3.0]: https://github.com/fabulous-dev/Fabulous.Avalonia/releases/tag/2.3.0
[2.2.0]: https://github.com/fabulous-dev/Fabulous.Avalonia/releases/tag/2.2.0
[2.1.0]: https://github.com/fabulous-dev/Fabulous.Avalonia/releases/tag/2.1.0
Expand Down
7 changes: 6 additions & 1 deletion templates/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
_No unreleased changes_

## [2.4.0] - 2025-04-07
### Added
- Add desktop specific template by @edgarfgp in https://github.com/fabulous-dev/Fabulous.Avalonia/pull/286

## [2.3.0] - 2024-01-17
### Added
- No changes
Expand Down Expand Up @@ -38,7 +42,8 @@ _No unreleased changes_
- Add a new template for a multi-project Fabulous.Avalonia app.
- Fix black screen in multi-project template when targeting Browser

[unreleased]: https://github.com/fabulous-dev/Fabulous.Avalonia.Templates/compare/2.3.0...HEAD
[unreleased]: https://github.com/fabulous-dev/Fabulous.Avalonia.Templates/compare/2.4.0...HEAD
[2.4.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.Templates/releases/tag/2.4.0
[2.3.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.Templates/releases/tag/2.3.0
[2.2.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.Templates/releases/tag/2.2.0
[2.1.0]: https://github.com/fabulous-dev/Fabulous.Avalonia.Templates/releases/tag/2.1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{

}
74 changes: 74 additions & 0 deletions templates/content/desktop/.template.config/template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"author": "fabulous-dev",
"classifications": [
"Fabulous",
"Avalonia"
],
"name": "Fabulous Avalonia Desktop",
"groupIdentity": "Fabulous.Avalonia.App.Desktop",
"identity": "Fabulous.Avalonia.Desktop",
"shortName": "fabulous-avalonia-desktop",
"tags": {
"language": "F#",
"type": "project"
},
"sourceName": "NewApp",
"primaryOutputs": [
{
"path": "NewApp\\App.fs"
}
],
"defaultName": "App",
"preferNameDirectory": "true",
"postActions": [],
"sources": [
{
"include": ["**"],
"exclude": [
".template.config/**/*",
"[Bb]in/**/*",
"[Oo]bj/**/*"
]
}
],
"guids": [
"0E9CB125-F04D-4E4A-8A20-7EB1FD9B43FB"
],
"symbols": {
"AppIdentifier": {
"type": "parameter",
"datatype": "string",
"defaultValue": "com.companyname"
},
"FabulousPkgVersion": {
"type": "parameter",
"dataType": "string",
"replaces": "FabulousPkgVersion",
"defaultValue": "2.4.0"
},
"FabulousAvaloniaPkgVersion": {
"type": "parameter",
"dataType": "string",
"replaces": "FabulousAvaloniaPkgVersion",
"defaultValue": "PKG_VERSION"
},
"FSharpCorePkgVersion": {
"type": "parameter",
"dataType": "string",
"replaces": "FSharpCorePkgVersion",
"defaultValue": "8.0.100"
},
"AvaloniaDesktopPkgVersion": {
"type": "parameter",
"dataType": "string",
"replaces": "AvaloniaDesktopPkgVersion",
"defaultValue": "11.0.7"
},
"AvaloniaThemesFluentPkgVersion": {
"type": "parameter",
"dataType": "string",
"replaces": "AvaloniaThemesFluentPkgVersion",
"defaultValue": "11.0.7"
}
}
}
82 changes: 82 additions & 0 deletions templates/content/desktop/App.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
namespace NewApp

open Avalonia.Themes.Fluent
open Fabulous
open Fabulous.Avalonia

open type Fabulous.Avalonia.View

module App =
type Model =
{ Count: int; Step: int; TimerOn: bool }

type Msg =
| Increment
| Decrement
| Reset
| SetStep of float
| TimerToggled of bool
| TimedTick

let initModel = { Count = 0; Step = 1; TimerOn = false }

let timerCmd () =
async {
do! Async.Sleep 200
return TimedTick
}
|> Cmd.ofAsyncMsg

let init () = initModel, Cmd.none

let update msg model =
match msg with
| Increment ->
{ model with
Count = model.Count + model.Step },
Cmd.none
| Decrement ->
{ model with
Count = model.Count - model.Step },
Cmd.none
| Reset -> initModel, Cmd.none
| SetStep n -> { model with Step = int(n + 0.5) }, Cmd.none
| TimerToggled on -> { model with TimerOn = on }, (if on then timerCmd() else Cmd.none)
| TimedTick ->
if model.TimerOn then
{ model with
Count = model.Count + model.Step },
timerCmd()
else
model, Cmd.none

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

Button("Increment", Increment).centerHorizontal()

Button("Decrement", Decrement).centerHorizontal()

(HStack() {
TextBlock("Timer").centerVertical()

ToggleSwitch(model.TimerOn, TimerToggled)
})
.margin(20.)
.centerHorizontal()

Slider(1., 10, float model.Step, SetStep)

TextBlock($"Step size: %d{model.Step}").centerText()

Button("Reset", Reset).centerHorizontal()

})
.center()

let app model = DesktopApplication(Window(view model))

let theme = FluentTheme()

let program = Program.statefulWithCmd init update app
22 changes: 22 additions & 0 deletions templates/content/desktop/NewApp.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<PublishTrimmed>true</PublishTrimmed>
<WarningsAsErrors>FS0025</WarningsAsErrors>
<NoWarn>MT7091;NETSDK1206</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Compile Include="App.fs" />
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="AvaloniaDesktopPkgVersion" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="AvaloniaThemesFluentPkgVersion" />
<PackageReference Include="FSharp.Core" Version="FSharpCorePkgVersion" />
<PackageReference Include="Fabulous" Version="FabulousPkgVersion" />
<PackageReference Include="Fabulous.Avalonia" Version="FabulousAvaloniaPkgVersion" />
</ItemGroup>
</Project>
28 changes: 28 additions & 0 deletions templates/content/desktop/NewApp.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "NewApp", "NewApp.fsproj", "{0E9CB125-F04D-4E4A-8A20-7EB1FD9B43FB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0E9CB125-F04D-4E4A-8A20-7EB1FD9B43FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E9CB125-F04D-4E4A-8A20-7EB1FD9B43FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E9CB125-F04D-4E4A-8A20-7EB1FD9B43FB}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{0E9CB125-F04D-4E4A-8A20-7EB1FD9B43FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E9CB125-F04D-4E4A-8A20-7EB1FD9B43FB}.Release|Any CPU.Build.0 = Release|Any CPU
{0E9CB125-F04D-4E4A-8A20-7EB1FD9B43FB}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
EndGlobalSection
EndGlobal
21 changes: 21 additions & 0 deletions templates/content/desktop/Program.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace NewApp

open System
open Avalonia
open Fabulous.Avalonia

module Program =

[<CompiledName "BuildAvaloniaApp">]
let buildAvaloniaApp () =
AppBuilder
.Configure(fun () ->
let app = Program.startApplication App.program
app.Styles.Add(App.theme)
app)
.LogToTrace(areas = Array.empty)
.UsePlatformDetect()

[<EntryPoint; STAThread>]
let main argv =
buildAvaloniaApp().StartWithClassicDesktopLifetime(argv)