AVLoop 1.4.1
See the version list below for details.
dotnet add package AVLoop --version 1.4.1
NuGet\Install-Package AVLoop -Version 1.4.1
<PackageReference Include="AVLoop" Version="1.4.1" />
paket add AVLoop --version 1.4.1
#r "nuget: AVLoop, 1.4.1"
// Install AVLoop as a Cake Addin #addin nuget:?package=AVLoop&version=1.4.1 // Install AVLoop as a Cake Tool #tool nuget:?package=AVLoop&version=1.4.1
AVLoop
A little bit of infractructure required to support Avalonia windows in F# interactive, courtesy of the discussion in this issue.
Run the following script code before creating Avalonia windows.
#r "nuget: AVLoop"
open FSharp.Compiler.Interactive
open AVLoop
let install(theme) =
fsi.EventLoop <- {new IEventLoop with
member x.Run() =
createApp(theme, [||])
false //dummy
member x.Invoke(f) = disp f
member x.ScheduleRestart() = () //dummy
}
install(Default,Dark) //wait till initialization message before submitting more code
Run the above snippent interactively first. Wait till you see a message "avalonia initialized" and then proceed to submit other code.
If you run this script along with window creation code in the same submit then that will not work. It seems the F# interactive main loop thread needs to be free to 'Run' the event loop (which actually initializes Avalonia).
Window example
Here is an example of a simple window
open Avalonia
let win1 = Controls.Window()
win1.Width <- 300
win1.Height <- 300
let btn1 = Controls.Button()
btn1.Width <- 100
btn1.Height <- 50
btn1.Content <- "Click me"
btn1.Click |> Observable.subscribe (fun _ -> btn1.Content <- "Clicked!")
win1.Content <- btn1
win1.Show()
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- Avalonia.Controls.DataGrid (>= 0.10.18)
- Avalonia.Desktop (>= 0.10.18)
- FSharp.Core (>= 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.