diff --git a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/Examples.WebAssemblyPlayground.fsproj b/src/Examples/Component Examples/Examples.WebAssemblyPlayground/Examples.WebAssemblyPlayground.fsproj deleted file mode 100644 index 0afc8813..00000000 --- a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/Examples.WebAssemblyPlayground.fsproj +++ /dev/null @@ -1,50 +0,0 @@ - - - - net7.0 - browser-wasm - enable - - true - - - - - false - -O1 - false - - - - true - true - -O3 - -O3 - true - - - - - - - - - - - - - - - - - - - - <_ContentIncludedByDefault Remove="wwwroot\css\index.css" /> - <_ContentIncludedByDefault Remove="wwwroot\favicon.ico" /> - <_ContentIncludedByDefault Remove="wwwroot\index.html" /> - - - - - diff --git a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/Program.fs b/src/Examples/Component Examples/Examples.WebAssemblyPlayground/Program.fs deleted file mode 100644 index a463519e..00000000 --- a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/Program.fs +++ /dev/null @@ -1,205 +0,0 @@ -namespace Examples.WebAssemblyPlayground - -open Avalonia -open Avalonia.Controls -open Avalonia.Controls.ApplicationLifetimes -open Avalonia.Controls.Shapes -open Avalonia.FuncUI.Hosts -open Avalonia.FuncUI.Types -open Avalonia.Layout -open Avalonia.Media -open Avalonia.Themes.Fluent -open Avalonia.FuncUI -open Avalonia.FuncUI.DSL - -[] -type Views = - - static member canvas (brush: IReadable, size: IReadable) = - Component.create ("canvas", fun ctx -> - let canvasOutlet = ctx.useState (null, renderOnChange = false) - let isPressed = ctx.useState (false, renderOnChange = false) - let lastPoint = ctx.useState (None, renderOnChange = false) - - let brush = ctx.usePassedRead (brush, renderOnChange = false) - let size = ctx.usePassedRead (size, renderOnChange = false) - - ctx.attrs [ - Component.dock Dock.Top - ] - - View.createWithOutlet canvasOutlet.Set Canvas.create [ - Canvas.verticalAlignment VerticalAlignment.Stretch - Canvas.horizontalAlignment HorizontalAlignment.Stretch - Canvas.background Brushes.White - Canvas.onPointerPressed (fun _ -> - isPressed.Set true - ) - Canvas.onPointerReleased (fun _ -> - isPressed.Set false - lastPoint.Set None - ) - Canvas.onPointerMoved (fun args -> - let point = args.GetPosition(canvasOutlet.Current) - - if isPressed.Current then - match lastPoint.Current with - | Some lastPoint -> - let line = Line( - StartPoint = lastPoint, - EndPoint = point, - Stroke = brush.Current, - StrokeThickness = float size.Current, - StrokeLineCap = PenLineCap.Round - ) - - if canvasOutlet.Current <> null then - canvasOutlet.Current.Children.Add line - - | None -> - () - - lastPoint.Set (Some point) - else - () - ) - ] :> IView - ) - - static member colorPicker (brush: IWritable) = - Component.create ("color_picker", fun ctx -> - let brush = ctx.usePassed (brush, renderOnChange = true) - - let brushes: IBrush list = [ - Brushes.Black - Brushes.Red - Brushes.Green - Brushes.Blue - Brushes.Yellow - ] - - ctx.attrs [ - Component.dock Dock.Left - ] - - StackPanel.create [ - StackPanel.orientation Orientation.Horizontal - StackPanel.spacing 5.0 - StackPanel.children [ - for item in brushes do - Border.create [ - Border.width 32.0 - Border.height 32.0 - Border.cornerRadius 16.0 - Border.background item - Border.borderThickness 4.0 - Border.borderBrush ( - if item = brush.Current - then item - else Brushes.Transparent - ) - Border.onPointerPressed (fun _ -> - brush.Set item - ) - ] - ] - ] - :> IView - ) - - static member sizePicker (size: IWritable) = - Component.create ("size_picker", fun ctx -> - let size = ctx.usePassed (size, renderOnChange = true) - - let sizes: int list = [ 2; 4; 6; 8; 16; 32; ] - - ctx.attrs [ - Component.dock Dock.Right - ] - - StackPanel.create [ - StackPanel.orientation Orientation.Horizontal - StackPanel.spacing 5.0 - StackPanel.children [ - for item in sizes do - Border.create [ - Border.width (float item) - Border.height (float item) - Border.cornerRadius (float item / 2.0) - Border.background ( - if item = size.Current - then Brushes.Black - else Brushes.Gray - ) - Border.onPointerPressed (fun _ -> - size.Set item - ) - ] - ] - ] - :> IView - ) - - static member settings (brush: IWritable, size: IWritable) = - Component.create ("settings", fun ctx -> - let brush = ctx.usePassed (brush, renderOnChange = false) - let size = ctx.usePassed (size, renderOnChange = false) - - ctx.attrs [ - Component.dock Dock.Bottom - Component.margin 5.0 - Component.padding 5.0 - Component.cornerRadius 8.0 - Component.background "#bdc3c7" - ] - - DockPanel.create [ - DockPanel.lastChildFill false - DockPanel.children [ - Views.colorPicker brush - Views.sizePicker size - ] - ] - :> IView - ) - static member main () = - Component (fun ctx -> - let brush = ctx.useState (Brushes.Black :> IBrush, renderOnChange = false) - let size = ctx.useState (2, renderOnChange = false) - - DockPanel.create [ - DockPanel.lastChildFill true - DockPanel.background Brushes.White - DockPanel.children [ - Views.settings (brush, size) - Views.canvas (brush, size) - ] - ] - ) - -type MainWindow() as this = - inherit HostWindow() - do - base.Title <- "Drawing App" - base.Width <- 500.0 - base.Height <- 500.0 - - //this.VisualRoot.VisualRoot.Renderer.DrawFps <- true - //this.VisualRoot.VisualRoot.Renderer.DrawDirtyRects <- true - - this.Content <- Views.main () - -type App() = - inherit Application() - - override this.Initialize() = - this.Styles.Add (FluentTheme()) - this.RequestedThemeVariant <- Styling.ThemeVariant.Light - - override this.OnFrameworkInitializationCompleted() = - match this.ApplicationLifetime with - | :? IClassicDesktopStyleApplicationLifetime as desktopLifetime -> - desktopLifetime.MainWindow <- MainWindow() - - | :? ISingleViewApplicationLifetime as single -> - single.MainView <- Views.main () \ No newline at end of file diff --git a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/Properties/launchSettings.json b/src/Examples/Component Examples/Examples.WebAssemblyPlayground/Properties/launchSettings.json deleted file mode 100644 index 0539010e..00000000 --- a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/Properties/launchSettings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "profiles": { - "Examples.WebAssemblyPlayground": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:58473;http://localhost:58474" - } - } -} \ No newline at end of file diff --git a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/Startup.fs b/src/Examples/Component Examples/Examples.WebAssemblyPlayground/Startup.fs deleted file mode 100644 index 7615621c..00000000 --- a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/Startup.fs +++ /dev/null @@ -1,37 +0,0 @@ -namespace Examples.WebAssemblyPlayground - -open System -open Avalonia -open Avalonia.Browser.Blazor -open Bolero -open Bolero.Html -open Microsoft.AspNetCore.Components.WebAssembly.Hosting -open Avalonia.ReactiveUI - -type MainView () = - inherit Component() - - override this.SetParametersAsync (parameters) = - base.SetParametersAsync parameters - - override this.Render () = - comp { attr.empty() } - -module Program = - - [] - let Main args = - - let builder = WebAssemblyHostBuilder.CreateDefault(args) - builder.RootComponents.Add("#app") - let host = builder.Build() - - task { - do! AppBuilder.Configure() - .UseReactiveUI() - .StartBlazorAppAsync() - - do! host.RunAsync() - } |> ignore - - 0 diff --git a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/Logo.svg b/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/Logo.svg deleted file mode 100644 index 9685a23a..00000000 --- a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/Logo.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/css/app.css b/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/css/app.css deleted file mode 100644 index a118cb4f..00000000 --- a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/css/app.css +++ /dev/null @@ -1,79 +0,0 @@ -html, body { - font-family: "Nunito", sans-serif; - margin: 0; - height: 100vh; - overflow: hidden; -} - -a { - text-decoration: none; - color: white; -} - -#blazor-error-ui { - background: lightyellow; - bottom: 0; - box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); - display: none; - left: 0; - padding: 0.6rem 1.25rem 0.7rem 1.25rem; - position: fixed; - width: 100%; - z-index: 1000; -} - - #blazor-error-ui .dismiss { - cursor: pointer; - position: absolute; - right: 0.75rem; - top: 0.5rem; - } - -.canvas-container { - opacity:1; - position:fixed; - width:100%; - height:100%; - top:0px; - left:0px; - z-index:500; -} - -canvas -{ - opacity:1; - position:fixed; - width:100%; - height:100%; - top:0px; - left:0px; - z-index:500; -} - -#app, .page { - height: 100%; - background: #171C2C; - color: white; -} - -.navbar-brand { - font-size: 22px; -} - -.overlay{ - opacity:0.0; - position:fixed; - width:100vw; - height:100vh; - top:0px; - left:0px; - z-index:1000; -} - -#splash { - display: flex; - justify-content: center; - align-items: center; - text-align: center; - min-height: 100vh; -} \ No newline at end of file diff --git a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/favicon.ico b/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/favicon.ico deleted file mode 100644 index 8cbdd1ec..00000000 Binary files a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/favicon.ico and /dev/null differ diff --git a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/index.html b/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/index.html deleted file mode 100644 index 71dc0cf9..00000000 --- a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/index.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - Avalonia Sample - - - - - -
-
-

Powered by

- - Avalonia Logo - Avalonia - -
-
- -
- An unhandled error has occurred. - Reload - 🗙 -
- - - - - diff --git a/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/js/app.js b/src/Examples/Component Examples/Examples.WebAssemblyPlayground/wwwroot/js/app.js deleted file mode 100644 index e69de29b..00000000