Update ci-build and fix fsharp project (#65)
* Update ci-build.yml * Update ci-build.yml * Trying to fix fsharp project. I have no idea what I'm doing, but apparently it seems like everything works.
This commit is contained in:
Родитель
a1ab34cdb1
Коммит
2164a90f44
|
@ -26,7 +26,7 @@ jobs:
|
|||
- name: Install .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: 5.0.100-rc.2.20479.15
|
||||
dotnet-version: 6.0.*
|
||||
|
||||
- name: NBGV
|
||||
id: nbgv
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<!-- region package versions -->
|
||||
<PropertyGroup>
|
||||
<AvaloniaVersion>11.0.0</AvaloniaVersion>
|
||||
<FuncUIVersion>0.5.0-beta</FuncUIVersion>
|
||||
<FuncUIVersion>1.0.1</FuncUIVersion>
|
||||
</PropertyGroup>
|
||||
<!-- endregion -->
|
||||
</Project>
|
|
@ -3,7 +3,7 @@
|
|||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<IsPackable>false</IsPackable>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -18,10 +18,10 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="FSharp.SystemTextJson" Version="1.1.23" />
|
||||
<PackageReference Include="JaggerJo.Avalonia.FuncUI" Version="$(FuncUIVersion)" />
|
||||
<PackageReference Include="JaggerJo.Avalonia.FuncUI.DSL" Version="$(FuncUIVersion)" />
|
||||
<PackageReference Include="JaggerJo.Avalonia.FuncUI.Elmish" Version="$(FuncUIVersion)" />
|
||||
<PackageReference Include="Avalonia.FuncUI" Version="$(FuncUIVersion)" />
|
||||
<PackageReference Include="Avalonia.FuncUI.Elmish" Version="$(FuncUIVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
open System
|
||||
open System.Text.Json
|
||||
open System.Text.Json.Serialization
|
||||
open Avalonia.Themes.Fluent
|
||||
open Elmish
|
||||
open Avalonia
|
||||
open Avalonia.Controls
|
||||
|
@ -10,7 +11,6 @@ open Avalonia.Controls.ApplicationLifetimes
|
|||
open Live.Avalonia
|
||||
open Avalonia.FuncUI
|
||||
open Avalonia.FuncUI.Elmish
|
||||
open Avalonia.FuncUI.Components.Hosts
|
||||
|
||||
let transferState<'t> oldState =
|
||||
let jsonOptions = JsonSerializerOptions()
|
||||
|
@ -34,7 +34,7 @@ let isProduction =
|
|||
#endif
|
||||
|
||||
type MainControl(window: Window) as this =
|
||||
inherit HostControl()
|
||||
inherit Hosts.HostControl()
|
||||
do
|
||||
// Instead of just creating default init state, try to recover state from window.DataContext
|
||||
let hotInit () =
|
||||
|
@ -47,7 +47,11 @@ type MainControl(window: Window) as this =
|
|||
Elmish.Program.mkSimple hotInit Counter.update Counter.view
|
||||
|> Program.withHost this
|
||||
// Every time state changes, save state to window.DataContext
|
||||
|> Program.withTrace (fun _ state -> window.DataContext <- state)
|
||||
|> Program.withTrace (fun model state ->
|
||||
let setDataContext (subIds: SubId list) =
|
||||
window.DataContext <- state
|
||||
() // return unit
|
||||
setDataContext)
|
||||
|> Program.run
|
||||
|
||||
|
||||
|
@ -59,8 +63,7 @@ type App() =
|
|||
MainControl(window) :> obj
|
||||
|
||||
override this.Initialize() =
|
||||
this.Styles.Load "avares://Avalonia.Themes.Default/DefaultTheme.xaml"
|
||||
this.Styles.Load "avares://Avalonia.Themes.Default/Accents/BaseDark.xaml"
|
||||
this.Styles.Add (FluentTheme())
|
||||
|
||||
override this.OnFrameworkInitializationCompleted() =
|
||||
match this.ApplicationLifetime with
|
||||
|
|
Загрузка…
Ссылка в новой задаче