diff --git a/src/Avalonia.FuncUI.Templates/Avalonia.FuncUI.Templates.fsproj b/src/Avalonia.FuncUI.Templates/Avalonia.FuncUI.Templates.fsproj deleted file mode 100644 index 104a7684..00000000 --- a/src/Avalonia.FuncUI.Templates/Avalonia.FuncUI.Templates.fsproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - Template - 1.0.0-rc1.1.0 - Avalonia.FuncUI.Templates - Avalonia.FuncUI Templates - Josua Jäger, Kevin Schneider, Angel Daniel Munoz Gonzalez - Templates for Avalonia.FuncUI - dotnet-new;templates;avalonia;funcui;mvu - netstandard2.0 - - true - false - content - false - true - - - - - - - \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/README.md b/src/Avalonia.FuncUI.Templates/README.md deleted file mode 100644 index 43567663..00000000 --- a/src/Avalonia.FuncUI.Templates/README.md +++ /dev/null @@ -1,103 +0,0 @@ -# Avalonia FuncUI ProjectTemplates - -This project contains .NET Project templates for FuncUI, both for Component and Elmish projects. - -## Install - -``` -dotnet new --install Avalonia.FuncUI.Templates -``` - -## Create an App - -We currently offer templates for both Component projects and Elmish projects. If you are not sure what to choose -you can take a look at the [documentation](../../README.md) or the [examples](../Examples) to help you decide. - -### Using components - -### Create a new basic App - -This template only contains a simple view and no extra resources that serve as a starting point if you are only creating -a basic app. - -``` -dotnet new funcui.basic -n NewApp -``` - -### Create a new full App - -This template contains a more complex example with a `Style.xaml` file and other extras that you can find on more elaborate -applications. - -``` -dotnet new funcui.full -n NewApp -``` - -### Using Elmish - -### Create a new basic App - -This template only contains a simple view and no extra resources that serve as a starting point if you are only creating -a basic app. - -``` -dotnet new funcui.basic.mvu -n NewApp -``` - -### Create a new full App - -This template contains a more complex example with a `Style.xaml` file and other extras that you can find on more elaborate -applications. - -``` -dotnet new funcui.full.mvu -n NewApp -``` - -### Create a new cross platform App - -This template contains a cross platform example with a `Style.xaml` file and other extras that you can find on more elaborate -applications. Unlike other templates only for desktop, this template also targets iOS, Android and Browser through WebAsembly. - -``` -dotnet new funcui.xplat -n NewApp -``` - -Additional options include - -``` - -f, --framework The target framework for the solution. - Type: choice - net7.0 Target net7.0 - Default: net7.0 - -p, --platform The target platforms for the solution. - Type: choice - Desktop Desktop: Windows/Linux/MacOS - iOS Mobile: iOS - Android Mobile: Android - Browser Browser: WebAssembly - Multiple values are allowed: True - Default: Desktop|iOS|Android|Browser - -id The application ID for mobile projects (ApplicationId MSBuild property). Both Android and iOS restrict possible IDs: Any ID must have at least two segments (separated by one or more dots). Each segment must start with a letter. All characters must be alphanumeric [a-zA-Z0-9]. IDs are case sensitive and must be unique to each application. - Type: string - Default: com.companyname.AvaloniaFuncUIApplication - -vn, --version The application version for mobile projects (ApplicationVersion MSBuild property). Required to be integer on mobile projects and <=10000 on iOS. Must be incremented per store submission. - Type: integer - Default: 1 - -vd, --display-version The application display version for mobile projects (ApplicationDisplayVersion MSBuild property). Avoid inputting < and > characters which mess with source code. - Type: string - Default: 1.0-funcui - -t, --title The application title for all projects (ApplicationTitle MSBuild property for mobile). Avoid inputting ", < and > characters which mess with source code. - Type: string - Default: Avalonia FuncUI Application - -``` - -## Run the App - -All templates in both Components and Elmish flavors should create the same result: - -``` -dotnet run -``` - -![](img/NewApp_screenshot.png) diff --git a/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/.template.config/template.json b/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/.template.config/template.json deleted file mode 100644 index 217adeec..00000000 --- a/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/.template.config/template.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/template", - "author": "JaggerJo", - "classifications": [ - "Console", - "Avalonia", - "UI", - "Elmish" - ], - "name": "Avalonia FuncUI MVU Basic App", - "tags": { - "language": "F#", - "type": "project" - }, - "identity": "Avalonia.FuncUI.BasicMvuTemplate", - "shortName": "funcui.basic.mvu", - "sourceName": "BasicMvuTemplate", - "preferNameDirectory": true -} \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/BasicMvuTemplate.fsproj b/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/BasicMvuTemplate.fsproj deleted file mode 100644 index 08d51420..00000000 --- a/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/BasicMvuTemplate.fsproj +++ /dev/null @@ -1,28 +0,0 @@ -<Project Sdk="Microsoft.NET.Sdk"> - - <PropertyGroup> - <OutputType>Exe</OutputType> - <TargetFramework>net8.0</TargetFramework> - </PropertyGroup> - - <ItemGroup> - <Compile Include="Counter.fs" /> - <Compile Include="Program.fs" /> - </ItemGroup> - - <ItemGroup /> - - <ItemGroup> - <PackageReference Include="Avalonia" Version="11.0.0-rc1.1" /> - <PackageReference Include="Avalonia.Desktop" Version="11.0.0-rc1.1" /> - <PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0-rc1.1" /> - <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-rc1.1" /> - <PackageReference Include="Avalonia.FuncUI" Version="1.0.0-rc1.1.0" /> - <PackageReference Include="Avalonia.FuncUI.Elmish" Version="1.0.0-rc1.1.0" /> - </ItemGroup> - - <ItemGroup> - <EmbeddedResource Remove=".template.config\**" /> - </ItemGroup> - -</Project> diff --git a/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/Counter.fs b/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/Counter.fs deleted file mode 100644 index cb8bf6bc..00000000 --- a/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/Counter.fs +++ /dev/null @@ -1,60 +0,0 @@ - -namespace BasicMvuTemplate - -module Counter = - open Avalonia.Controls - open Avalonia.FuncUI - open Avalonia.FuncUI.DSL - open Avalonia.Layout - - type State = { count : int } - let init() = { count = 0 } - - type Msg = Increment | Decrement | Reset - - let update (msg: Msg) (state: State) : State = - match msg with - | Increment -> { state with count = state.count + 1 } - | Decrement -> { state with count = state.count - 1 } - | Reset -> init() - - let buttonStyles: Types.IAttr<Button> list = [ - Button.width 64 - Button.fontSize 16.0 - Button.horizontalAlignment HorizontalAlignment.Center - Button.horizontalContentAlignment HorizontalAlignment.Center - Button.margin 2. - ] - - let view (state: State) (dispatch) = - DockPanel.create [ - DockPanel.children [ - Button.create [ - Button.dock Dock.Bottom - Button.onClick (fun _ -> dispatch Reset) - Button.content "reset" - yield! buttonStyles - ] - Button.create [ - Button.dock Dock.Bottom - Button.onClick (fun _ -> dispatch Decrement) - Button.content "-" - Button.horizontalAlignment HorizontalAlignment.Center - yield! buttonStyles - ] - Button.create [ - Button.dock Dock.Bottom - Button.horizontalAlignment HorizontalAlignment.Center - Button.onClick (fun _ -> dispatch Increment) - Button.content "+" - yield! buttonStyles - ] - TextBlock.create [ - TextBlock.dock Dock.Top - TextBlock.fontSize 48.0 - TextBlock.verticalAlignment VerticalAlignment.Center - TextBlock.horizontalAlignment HorizontalAlignment.Center - TextBlock.text (string state.count) - ] - ] - ] \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/Program.fs b/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/Program.fs deleted file mode 100644 index e9950bec..00000000 --- a/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/Program.fs +++ /dev/null @@ -1,53 +0,0 @@ -namespace BasicMvuTemplate - -open Elmish -open Avalonia -open Avalonia.Controls.ApplicationLifetimes -open Avalonia.Diagnostics -open Avalonia.Input -open Avalonia.FuncUI -open Avalonia.FuncUI.Elmish -open Avalonia.Themes.Fluent -open Avalonia.FuncUI.Hosts - -type MainWindow() as this = - inherit HostWindow() - do - base.Title <- "BasicMvuTemplate" - base.Width <- 400.0 - base.Height <- 400.0 -//-:cnd -#if DEBUG - this.AttachDevTools(KeyGesture(Key.F12)) -#endif -//+:cnd - Elmish.Program.mkSimple Counter.init Counter.update Counter.view - |> Program.withHost this -//-:cnd -#if DEBUG - |> Program.withConsoleTrace -#endif -//+:cnd - |> Program.run - - -type App() = - inherit Application() - - override this.Initialize() = - this.Styles.Add (FluentTheme()) - - override this.OnFrameworkInitializationCompleted() = - match this.ApplicationLifetime with - | :? IClassicDesktopStyleApplicationLifetime as desktopLifetime -> - desktopLifetime.MainWindow <- MainWindow() - | _ -> () - -module Program = - - [<EntryPoint>] - let main(args: string[]) = - AppBuilder - .Configure<App>() - .UsePlatformDetect() - .StartWithClassicDesktopLifetime(args) \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/README.md b/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/README.md deleted file mode 100644 index e392d0d9..00000000 --- a/src/Avalonia.FuncUI.Templates/content/BasicMvuTemplate/README.md +++ /dev/null @@ -1,51 +0,0 @@ -[fantomas]: https://github.com/fsprojects/fantomas -[f# formatting]: https://marketplace.visualstudio.com/items?itemName=asti.fantomas-vs - -# BasicMvuTemplate - -This is an Avalonia.FuncUI Starter template, this template shows you in a brief way how you can create components and functions to render your UI. - -To run this application just type - -``` -dotnet run -``` - -You should briefly see your application window showing on your desktop. - -### Next Steps - -If you're using VSCode we recommend you to install [Fantomas] - -``` -dotnet new tool-manifest -dotnet tool install fantomas -``` - -and add the following `.editorconfig` - -```editorconfig -root = true - -[*] -indent_style=space -indent_size=4 -charset=utf-8 -trim_trailing_whitespace=true -insert_final_newline=false - -[*.fs] -fsharp_single_argument_web_mode=true -``` - -This should will allow Fantomas to format your code on save. - -Other editors like Rider and Visual Studio [F# Formatting] can also pick up these settings even if you don't install fantomas. - -### Feeling a little lost? - -Check out the documentation: - -https://funcui.avaloniaui.net/ - -The documentation is still work in progress and will change over the next few months, but feel free to contribute and ask questions if needed. diff --git a/src/Avalonia.FuncUI.Templates/content/BasicTemplate/.template.config/template.json b/src/Avalonia.FuncUI.Templates/content/BasicTemplate/.template.config/template.json deleted file mode 100644 index 5f3c7aa5..00000000 --- a/src/Avalonia.FuncUI.Templates/content/BasicTemplate/.template.config/template.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/template", - "author": "JaggerJo", - "classifications": [ - "Console", - "Avalonia", - "UI", - "Components" - ], - "name": "Avalonia FuncUI Component Basic App", - "tags": { - "language": "F#", - "type": "project" - }, - "identity": "Avalonia.FuncUI.BasicTemplate", - "shortName": "funcui.basic", - "sourceName": "BasicTemplate", - "preferNameDirectory": true -} \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/BasicTemplate/BasicTemplate.fsproj b/src/Avalonia.FuncUI.Templates/content/BasicTemplate/BasicTemplate.fsproj deleted file mode 100644 index 2c031152..00000000 --- a/src/Avalonia.FuncUI.Templates/content/BasicTemplate/BasicTemplate.fsproj +++ /dev/null @@ -1,20 +0,0 @@ -<Project Sdk="Microsoft.NET.Sdk"> - - <PropertyGroup> - <OutputType>Exe</OutputType> - <TargetFramework>net8.0</TargetFramework> - </PropertyGroup> - - <ItemGroup> - <Compile Include="Counter.fs" /> - <Compile Include="Program.fs" /> - </ItemGroup> - - <ItemGroup> - <PackageReference Include="Avalonia" Version="11.0.0-rc1.1" /> - <PackageReference Include="Avalonia.Desktop" Version="11.0.0-rc1.1" /> - <PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0-rc1.1" /> - <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-rc1.1" /> - <PackageReference Include="Avalonia.FuncUI" Version="1.0.0-rc1.1.0" /> - </ItemGroup> -</Project> diff --git a/src/Avalonia.FuncUI.Templates/content/BasicTemplate/Counter.fs b/src/Avalonia.FuncUI.Templates/content/BasicTemplate/Counter.fs deleted file mode 100644 index b1d64e17..00000000 --- a/src/Avalonia.FuncUI.Templates/content/BasicTemplate/Counter.fs +++ /dev/null @@ -1,48 +0,0 @@ -namespace BasicTemplate - -module Counter = - open Avalonia.Controls - open Avalonia.FuncUI - open Avalonia.FuncUI.DSL - open Avalonia.Layout - - let buttonStyles: Types.IAttr<Button> list = [ - Button.width 64 - Button.fontSize 16.0 - Button.horizontalAlignment HorizontalAlignment.Center - Button.horizontalContentAlignment HorizontalAlignment.Center - Button.margin 2. - ] - - let view = - Component(fun ctx -> - let state = ctx.useState 0 - DockPanel.create [ - DockPanel.children [ - Button.create [ - Button.dock Dock.Bottom - Button.content "Reset" - Button.onClick (fun _ -> state.Set 0) - yield! buttonStyles - ] - Button.create [ - Button.dock Dock.Bottom - Button.content "-" - Button.onClick (fun _ -> state.Current - 1 |> state.Set) - yield! buttonStyles - ] - Button.create [ - Button.dock Dock.Bottom - Button.content "+" - Button.onClick (fun _ -> state.Current + 1 |> state.Set) - yield! buttonStyles - ] - TextBlock.create [ - TextBlock.dock Dock.Top - TextBlock.fontSize 48.0 - TextBlock.horizontalAlignment HorizontalAlignment.Center - TextBlock.text (string state.Current) - ] - ] - ] - ) diff --git a/src/Avalonia.FuncUI.Templates/content/BasicTemplate/Program.fs b/src/Avalonia.FuncUI.Templates/content/BasicTemplate/Program.fs deleted file mode 100644 index 9c89711f..00000000 --- a/src/Avalonia.FuncUI.Templates/content/BasicTemplate/Program.fs +++ /dev/null @@ -1,42 +0,0 @@ -namespace BasicTemplate - -open Avalonia -open Avalonia.Controls.ApplicationLifetimes -open Avalonia.Input -open Avalonia.Themes.Fluent -open Avalonia.FuncUI.Hosts - -type MainWindow() as this = - inherit HostWindow() - do - base.Title <- "BasicTemplate" - base.Width <- 400.0 - base.Height <- 400.0 - this.Content <- Counter.view -//-:cnd -#if DEBUG - this.AttachDevTools(KeyGesture(Key.F12)) -#endif -//+:cnd - - -type App() = - inherit Application() - - override this.Initialize() = - this.Styles.Add (FluentTheme()) - - override this.OnFrameworkInitializationCompleted() = - match this.ApplicationLifetime with - | :? IClassicDesktopStyleApplicationLifetime as desktopLifetime -> - desktopLifetime.MainWindow <- MainWindow() - | _ -> () - -module Program = - - [<EntryPoint>] - let main(args: string[]) = - AppBuilder - .Configure<App>() - .UsePlatformDetect() - .StartWithClassicDesktopLifetime(args) \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/BasicTemplate/README.md b/src/Avalonia.FuncUI.Templates/content/BasicTemplate/README.md deleted file mode 100644 index d90effd2..00000000 --- a/src/Avalonia.FuncUI.Templates/content/BasicTemplate/README.md +++ /dev/null @@ -1,53 +0,0 @@ -[fantomas]: https://github.com/fsprojects/fantomas -[f# formatting]: https://marketplace.visualstudio.com/items?itemName=asti.fantomas-vs - -# BasicTemplate - -This is an Avalonia.FuncUI Starter template, this template shows you in a brief way how you can create components and functions to render your UI. - -To run this application just type - -``` -dotnet run -``` - -You should briefly see your application window showing on your desktop. - -### Next Steps - -If you're using VSCode we recommend you to install [Fantomas] - -``` -dotnet new tool-manifest -dotnet tool install fantomas -``` - -and add the following `.editorconfig` - -```editorconfig -root = true - -[*] -indent_style=space -indent_size=4 -charset=utf-8 -trim_trailing_whitespace=true -insert_final_newline=false - -[*.fs] -fsharp_newline_between_type_definition_and_members = false -fsharp_multiline_bracket_style = stroustrup -fsharp_newline_before_multiline_computation_expression = false -``` - -This should will allow Fantomas to format your code on save. - -Other editors like Rider and Visual Studio [F# Formatting] can also pick up these settings even if you don't install fantomas. - -### Feeling a little lost? - -Check out the documentation: - -https://funcui.avaloniaui.net/ - -The documentation is still work in progress and will change over the next few months, but feel free to contribute and ask questions if needed. diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.gitignore b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.gitignore deleted file mode 100644 index 2afa2e27..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.gitignore +++ /dev/null @@ -1,454 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET -project.lock.json -project.fragment.lock.json -artifacts/ - -# Tye -.tye/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd - -## -## Visual studio for Mac -## - - -# globs -Makefile.in -*.userprefs -*.usertasks -config.make -config.status -aclocal.m4 -install-sh -autom4te.cache/ -*.tar.gz -tarballs/ -test-results/ - -# Mac bundle stuff -*.dmg -*.app - -# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# JetBrains Rider -.idea/ -*.sln.iml - -## -## Visual Studio Code -## -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.template.config/dotnetcli.host.json b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.template.config/dotnetcli.host.json deleted file mode 100644 index 2b645e4c..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.template.config/dotnetcli.host.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/dotnetcli.host", - "symbolInfo": { - "Framework": { "longName": "framework" }, - "Platform": { "longName": "platform" }, - "ApplicationTitle": { "longName": "title", "shortName": "t" }, - "ApplicationId": { "longName": "id" }, - "ApplicationVersion": { "longName": "version", "shortName": "vn" }, - "ApplicationDisplayVersion": { "longName": "display-version", "shortName": "vd" } - }, - "usageExamples": [ - "" - ] -} \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.template.config/icon.png b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.template.config/icon.png deleted file mode 100644 index ac2864fb..00000000 Binary files a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.template.config/icon.png and /dev/null differ diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.template.config/ide.host.json b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.template.config/ide.host.json deleted file mode 100644 index d1168fbe..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.template.config/ide.host.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/ide.host", - "icon": "icon.png", - "symbolInfo": [ - { - "id": "Framework", - "name": { - "text": ".NET version" - }, - "isVisible": true - }, - { - "id": "Platform", - "name": { - "text": "Platforms to target" - }, - "isVisible": true - }, - { - "id": "ApplicationId", - "name": { - "text": "Application ID" - }, - "isVisible": true - }, - { - "id": "ApplicationVersion", - "name": { - "text": "Application Version" - }, - "isVisible": true - }, - { - "id": "ApplicationDisplayVersion", - "name": { - "text": "Application Display Version" - }, - "isVisible": true - }, - { - "id": "ApplicationTitle", - "name": { - "text": "Application Title" - }, - "isVisible": true - } - ] -} \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.template.config/template.json b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.template.config/template.json deleted file mode 100644 index 5eec084b..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/.template.config/template.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/template", - "author": "Happypig375", - "classifications": [ "Avalonia", "AvaloniaUI", "UI", "Desktop", "Windows", "Linux", "macOS", "Mobile", "Android", "iOS", "Web", "Elmish" ], - "name": "Avalonia FuncUI Cross Platform Application", - "description": "A cross-platform Avalonia.FuncUI Application with the Model-View-Update architecture. Targets Desktop, Mobile and Browser with WebAssembly.", - "tags": { "language": "F#", "type": "solution" }, - "identity": "Avalonia.FuncUI.CrossPlatform", - "shortName": "funcui.xplat", - "sourceName": "AvaApp", - "preferNameDirectory": true, - "defaultName": "AvaApp", - "symbols": { - "Framework": { - "type": "parameter", - "description": "The target framework for the solution.", - "datatype": "choice", - "choices": [ - { - "choice": "net7.0", - "description": "Target net7.0" - } - ], - "replaces": "FrameworkParameter", - "defaultValue": "net7.0" - }, - "Platform": { - "type": "parameter", - "description": "The target platforms for the solution.", - "datatype": "choice", - "allowMultipleValues": true, - "enableQuotelessLiterals": true, - "choices": [ - { - "choice": "Desktop", - "description": "Desktop: Windows/Linux/MacOS" - }, - { - "choice": "iOS", - "description": "Mobile: iOS" - }, - { - "choice": "Android", - "description": "Mobile: Android" - }, - { - "choice": "Browser", - "description": "Browser: WebAssembly" - } - ], - "defaultValue": "Desktop|iOS|Android|Browser" - }, - "ApplicationId": { - "type": "parameter", - "description": "The application ID for mobile projects (ApplicationId MSBuild property). Both Android and iOS restrict possible IDs: Any ID must have at least two segments (separated by one or more dots). Each segment must start with a letter. All characters must be alphanumeric [a-zA-Z0-9]. IDs are case sensitive and must be unique to each application.", - "datatype": "string", - "replaces": "AvaIdParameter", - "defaultValue": "com.companyname.AvaloniaFuncUIApplication" - }, - "ApplicationVersion": { - "type": "parameter", - "description": "The application version for mobile projects (ApplicationVersion MSBuild property). Required to be integer on mobile projects and <=10000 on iOS. Must be incremented per store submission.", - "datatype": "integer", - "replaces": "AvaVersionParameter", - "defaultValue": "1" - }, - "ApplicationDisplayVersion": { - "type": "parameter", - "description": "The application display version for mobile projects (ApplicationDisplayVersion MSBuild property). Avoid inputting < and > characters which mess with source code.", - "datatype": "string", - "replaces": "AvaDisplayVersionParameter", - "defaultValue": "1.0-funcui" - }, - "ApplicationTitle": { - "type": "parameter", - "description": "The application title for all projects (ApplicationTitle MSBuild property for mobile). Avoid inputting \", < and > characters which mess with source code.", - "datatype": "string", - "replaces": "AvaTitleParameter", - "defaultValue": "Avalonia FuncUI Application" - } - }, - "sources": [ - { - "modifiers": [ - { "condition": "Platform != Desktop", "exclude": ["AvaApp.Desktop/**"] }, - { "condition": "Platform != iOS", "exclude": ["AvaApp.iOS/**"] }, - { "condition": "Platform != Android", "exclude": ["AvaApp.Android/**"] }, - { "condition": "Platform != Browser", "exclude": ["AvaApp.Browser/**"] } - ] - } - ], - "primaryOutputs": [ - { - "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", - "path": "AvaApp/Counter.fs" - }, - { "path": "AvaApp/AvaApp.fsproj" }, - { "condition": "Platform == Android", "path": "AvaApp.Android/AvaApp.Android.fsproj" }, - { "condition": "Platform == Desktop", "path": "AvaApp.Desktop/AvaApp.Desktop.fsproj" }, - { "condition": "Platform == iOS", "path": "AvaApp.iOS/AvaApp.iOS.fsproj" }, - { "condition": "Platform == Browser", "path": "AvaApp.Browser/AvaApp.Browser.fsproj" } - ], - "postActions": [ - { - "id": "openInEditor", - "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", - "description": "Opens Counter.cs in the editor.", - "manualInstructions": [], - "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", - "args": { "files": "0" }, - "continueOnError": true - } - ] -} \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/AvaApp.Android.fsproj b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/AvaApp.Android.fsproj deleted file mode 100644 index 1b414b87..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/AvaApp.Android.fsproj +++ /dev/null @@ -1,32 +0,0 @@ -<Project Sdk="Microsoft.NET.Sdk"> - <PropertyGroup> - <OutputType>Exe</OutputType> - <TargetFramework>FrameworkParameter-android</TargetFramework> - <SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> - <AndroidPackageFormat>apk</AndroidPackageFormat> - </PropertyGroup> - - <PropertyGroup Condition="'$(Configuration)'=='Release'"> - <PublishTrimmed>True</PublishTrimmed> - <RunAOTCompilation>True</RunAOTCompilation> - <AndroidEnableProfiledAot>True</AndroidEnableProfiledAot> - <!-- https://github.com/dotnet/runtime/issues/79910 --> - <EnableLLVM>False</EnableLLVM> - <AndroidLinkTool>r8</AndroidLinkTool> - </PropertyGroup> - - <ItemGroup> - <PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.3.1.3" /> - <PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel" Version="2.3.1.3" /> - <PackageReference Include="Avalonia.Android" Version="$(AvaloniaVersion)" /> - <ProjectReference Include="..\AvaApp\AvaApp.fsproj" /> - - <None Include="Properties\AndroidManifest.xml" /> - <AndroidResource Include="Icon.png"> - <Link>Resources\drawable\Icon.png</Link> - </AndroidResource> - <AndroidResource Include="Resources\**\*" /> - <Compile Include="MainActivity.fs" /> - <Compile Include="SplashActivity.fs" /> - </ItemGroup> -</Project> diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Icon.png b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Icon.png deleted file mode 100644 index 41a2a618..00000000 Binary files a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Icon.png and /dev/null differ diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/MainActivity.fs b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/MainActivity.fs deleted file mode 100644 index 796ac73a..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/MainActivity.fs +++ /dev/null @@ -1,9 +0,0 @@ -namespace AvaApp.Android -open Android.App -open Android.Content.PM -open Avalonia.Android -open Avalonia - -[<Activity(Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", LaunchMode = LaunchMode.SingleInstance, ConfigurationChanges = (ConfigChanges.Orientation ||| ConfigChanges.ScreenSize))>] -type MainActivity() = - inherit AvaloniaMainActivity() \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Properties/AndroidManifest.xml b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Properties/AndroidManifest.xml deleted file mode 100644 index 69da501b..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Properties/AndroidManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto"> - <uses-permission android:name="android.permission.INTERNET" /> - <application android:icon="@drawable/Icon" /> -</manifest> diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Resources/drawable/splash_screen.xml b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Resources/drawable/splash_screen.xml deleted file mode 100644 index 2e920b4b..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Resources/drawable/splash_screen.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> - - <item> - <color android:color="@color/splash_background"/> - </item> - - <item android:drawable="@drawable/icon" - android:width="120dp" - android:height="120dp" - android:gravity="center" /> - -</layer-list> diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Resources/values/colors.xml b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Resources/values/colors.xml deleted file mode 100644 index 59279d5d..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Resources/values/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <color name="splash_background">#FFFFFF</color> -</resources> diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Resources/values/styles.xml b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Resources/values/styles.xml deleted file mode 100644 index 2759d290..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/Resources/values/styles.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<resources> - - <style name="MyTheme"> - </style> - - <style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar"> - <item name="android:windowActionBar">false</item> - <item name="android:windowNoTitle">true</item> - </style> - - <style name="MyTheme.Splash" parent ="MyTheme.NoActionBar"> - <item name="android:windowBackground">@drawable/splash_screen</item> - <item name="android:windowContentOverlay">@null</item> - </style> - -</resources> diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/SplashActivity.fs b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/SplashActivity.fs deleted file mode 100644 index 65aff641..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Android/SplashActivity.fs +++ /dev/null @@ -1,17 +0,0 @@ -namespace AvaApp.Android -open Android.App -open Android.Content -open Android.Net -open Avalonia.Android -type Application = Android.App.Application - -[<Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)>] -type SplashActivity() = - inherit AvaloniaSplashActivity<AvaApp.App>() - override this.CustomizeAppBuilder builder = - AvaApp.About.urlOpen <- fun url -> - this.StartActivity((new Intent(Intent.ActionView, Uri.Parse url)).SetFlags(ActivityFlags.ClearTop ||| ActivityFlags.NewTask)); - base.CustomizeAppBuilder builder - override this.OnResume() = - base.OnResume() - this.StartActivity(new Intent(Application.Context, typeof<MainActivity>)) \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/Logo.svg b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/Logo.svg deleted file mode 100644 index 9685a23a..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/Logo.svg +++ /dev/null @@ -1,5 +0,0 @@ -<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg"> -<path d="M30.4661 34.928C30.5364 34.928 30.6052 34.928 30.6754 34.928C32.8596 34.928 34.654 33.2918 34.9053 31.1752L34.9356 16.9955C34.6872 7.56697 26.9662 0 17.4777 0C7.83263 0 0.0137329 7.8189 0.0137329 17.464C0.0137329 27.0059 7.66618 34.7631 17.1687 34.928H30.4661Z" fill="white"/> -<path fill-rule="evenodd" clip-rule="evenodd" d="M17.5239 5.948C12.0268 5.948 7.42967 9.80117 6.286 14.954C7.38092 15.2609 8.18385 16.2664 8.18385 17.4593C8.18385 18.6523 7.38092 19.6577 6.286 19.9647C7.42966 25.1175 12.0268 28.9706 17.5239 28.9706C19.525 28.9706 21.4068 28.4601 23.0462 27.562V28.8927H29.0352V17.9365C29.0407 17.7908 29.0352 17.6063 29.0352 17.4593C29.0352 11.1018 23.8814 5.948 17.5239 5.948ZM12.0098 17.4593C12.0098 14.414 14.4786 11.9452 17.5239 11.9452C20.5693 11.9452 23.038 14.414 23.038 17.4593C23.038 20.5047 20.5693 22.9734 17.5239 22.9734C14.4786 22.9734 12.0098 20.5047 12.0098 17.4593Z" fill="#8B44AC"/> -<path d="M7.36841 17.4517C7.36841 18.4691 6.54368 19.2938 5.52631 19.2938C4.50894 19.2938 3.6842 18.4691 3.6842 17.4517C3.6842 16.4343 4.50894 15.6096 5.52631 15.6096C6.54368 15.6096 7.36841 16.4343 7.36841 17.4517Z" fill="#8B44AC"/> -</svg> diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/app.css b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/app.css deleted file mode 100644 index a424538b..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/app.css +++ /dev/null @@ -1,74 +0,0 @@ -:root { - --sat: env(safe-area-inset-top); - --sar: env(safe-area-inset-right); - --sab: env(safe-area-inset-bottom); - --sal: env(safe-area-inset-left); -} - -/* HTML styles for the splash screen */ - -.highlight { - color: white; - font-size: 2.5rem; - display: block; -} - -.purple { - color: #8b44ac; -} - -.icon { - opacity: 0.05; - height: 35%; - width: 35%; - position: absolute; - background-repeat: no-repeat; - right: 0px; - bottom: 0px; - margin-right: 3%; - margin-bottom: 5%; - z-index: 5000; - background-position: right bottom; - pointer-events: none; -} - -#avalonia-splash a { - color: whitesmoke; - text-decoration: none; -} - -.center { - display: flex; - justify-content: center; - align-items: center; - height: 100vh; -} - -#avalonia-splash { - position: relative; - height: 100%; - width: 100%; - color: whitesmoke; - background: #1b2a4e; - font-family: 'Nunito', sans-serif; - background-position: center; - background-size: cover; - background-repeat: no-repeat; - justify-content: center; - align-items: center; -} - -.splash-close { - animation: fadeout 0.25s linear forwards; -} - -@keyframes fadeout { - 0% { - opacity: 100%; - } - - 100% { - opacity: 0; - visibility: collapse; - } -} diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/favicon.ico b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/favicon.ico deleted file mode 100644 index da8d49ff..00000000 Binary files a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/favicon.ico and /dev/null differ diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/index.html b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/index.html deleted file mode 100644 index de6ae7c7..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/index.html +++ /dev/null @@ -1,30 +0,0 @@ -<!DOCTYPE html> -<html> - -<head> - <title>AvaTitleParameter - - - - - - - - - - -
-
-
-

- Powered by - Avalonia UI -

-
- Avalonia Logo -
-
- - - - \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/main.js b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/main.js deleted file mode 100644 index 0dbe2e45..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AppBundle/main.js +++ /dev/null @@ -1,13 +0,0 @@ -import { dotnet } from './dotnet.js' - -const is_browser = typeof window != "undefined"; -if (!is_browser) throw new Error(`Expected to be running in a browser`); - -const dotnetRuntime = await dotnet - .withDiagnosticTracing(false) - .withApplicationArgumentsFromQuery() - .create(); - -const config = dotnetRuntime.getConfig(); - -await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]); \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AvaApp.Browser.fsproj b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AvaApp.Browser.fsproj deleted file mode 100644 index accf3634..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/AvaApp.Browser.fsproj +++ /dev/null @@ -1,20 +0,0 @@ - - - FrameworkParameter - browser-wasm - AppBundle\main.js - Exe - - - - - - - - - - - - - - diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/Program.fs b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/Program.fs deleted file mode 100644 index 05707f8f..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/Program.fs +++ /dev/null @@ -1,45 +0,0 @@ -open System.Runtime.Versioning -open Avalonia -open Avalonia.Browser -open AvaApp - -// Translated from C# source generator for -// [JSImport("globalThis.window.open")] -// internal static partial void Open([JSMarshalAs] string url); -#nowarn "9" -open FSharp.NativeInterop -open type System.MemoryExtensions -open System.Runtime.InteropServices.JavaScript -[] -type OpenUrl = - [] - static val mutable private __signature_Open_589601652 : JSFunctionBinding - static member Open(url: string) = - if isNull OpenUrl.__signature_Open_589601652 then - OpenUrl.__signature_Open_589601652 <- JSFunctionBinding.BindJSFunction("globalThis.window.open", null, [|JSMarshalerType.Discard; JSMarshalerType.String|].AsSpan()) - let __arguments_buffer = System.Span(NativePtr.stackalloc 3 |> NativePtr.toVoidPtr, 3) - let __arg_exception = &__arguments_buffer[0] - __arg_exception.Initialize() - let __arg_return = &__arguments_buffer[1] - __arg_return.Initialize() - // Setup - Perform required setup. - let __url_native__js_arg = &__arguments_buffer[2] - __url_native__js_arg.ToJS url - JSFunctionBinding.InvokeJS(OpenUrl.__signature_Open_589601652, __arguments_buffer) - -module Program = - [] - do () - - [] - let buildAvaloniaApp () = - AppBuilder - .Configure() - - [] - let main argv = - About.urlOpen <- OpenUrl.Open - buildAvaloniaApp() - .StartBrowserAppAsync("out") - |> ignore - 0 \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/Properties/launchSettings.json b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/Properties/launchSettings.json deleted file mode 100644 index f2c7cb16..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/Properties/launchSettings.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "profiles": { - "AvaApp.Browser": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/debug?browser={browserInspectUri}" - } - } -} \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/runtimeconfig.template.json b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/runtimeconfig.template.json deleted file mode 100644 index c6990ba7..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Browser/runtimeconfig.template.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "wasmHostProperties": { - "perHostConfig": [ - { - "name": "browser", - "html-path": "index.html", - "Host": "browser" - } - ] - } -} \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Desktop/AvaApp.Desktop.fsproj b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Desktop/AvaApp.Desktop.fsproj deleted file mode 100644 index 01ef67fd..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Desktop/AvaApp.Desktop.fsproj +++ /dev/null @@ -1,24 +0,0 @@ - - - WinExe - FrameworkParameter - enable - - copyused - true - - - - - - - - - - - - - - diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Desktop/Program.fs b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Desktop/Program.fs deleted file mode 100644 index f8aa2cb0..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.Desktop/Program.fs +++ /dev/null @@ -1,21 +0,0 @@ -open System -open System.Diagnostics -open Avalonia -open AvaApp - -// Initialization code. Don't use any Avalonia, third-party APIs or any -// SynchronizationContext-reliant code before AppMain is called: things aren't initialized -// yet and stuff might break. -[] -let Main(args: string array) = - About.urlOpen <- fun url -> - if OperatingSystem.IsWindows() then - Process.Start(ProcessStartInfo("cmd", $"/c start %s{url}")) |> ignore - elif OperatingSystem.IsLinux() || OperatingSystem.IsFreeBSD() then - Process.Start("xdg-open", url) |> ignore - elif OperatingSystem.IsMacOS() then - Process.Start("open", url) |> ignore - AppBuilder.Configure() - .UsePlatformDetect() - .LogToTrace(?level = None) - .StartWithClassicDesktopLifetime(args) \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/AppDelegate.fs b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/AppDelegate.fs deleted file mode 100644 index 2cbfa2dc..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/AppDelegate.fs +++ /dev/null @@ -1,13 +0,0 @@ -namespace AvaApp.iOS -open Foundation -open UIKit -open Avalonia -open Avalonia.Controls -open Avalonia.iOS -open Avalonia.Media - -// The UIApplicationDelegate for the application. This class is responsible for launching the -// User Interface of the application, as well as listening (and optionally responding) to -// application events from iOS. -type [] AppDelegate() = - inherit AvaloniaAppDelegate() \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/AvaApp.iOS.fsproj b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/AvaApp.iOS.fsproj deleted file mode 100644 index 534dad37..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/AvaApp.iOS.fsproj +++ /dev/null @@ -1,21 +0,0 @@ - - - Exe - FrameworkParameter-ios - 10.0 - manual - enable - iossimulator-x64 - - - - - - - - - - - - - diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/Entitlements.plist b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/Entitlements.plist deleted file mode 100644 index 0c67376e..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/Entitlements.plist +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/Info.plist b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/Info.plist deleted file mode 100644 index 9acc1758..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/Info.plist +++ /dev/null @@ -1,47 +0,0 @@ - - - - - CFBundleDisplayName - AvaDisplayName - CFBundleIdentifier - com.CompanyName.AvaApplicationId - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - MinimumOSVersion - 10.0 - UIDeviceFamily - - 1 - 2 - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIStatusBarHidden - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/Main.fs b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/Main.fs deleted file mode 100644 index 6a8e486e..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/Main.fs +++ /dev/null @@ -1,8 +0,0 @@ -open UIKit -// This is the main entry point of the application. -let [] Main(args: string array) = - AvaApp.About.urlOpen <- fun url -> new Foundation.NSUrl(url) |> UIApplication.SharedApplication.OpenUrl |> ignore - // if you want to use a different Application Delegate class from "AppDelegate" - // you can specify it here. - UIApplication.Main(args, null, typeof) - 0 \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/Resources/LaunchScreen.xib b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/Resources/LaunchScreen.xib deleted file mode 100644 index c941827c..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.iOS/Resources/LaunchScreen.xib +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.sln b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.sln deleted file mode 100644 index c59846dd..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp.sln +++ /dev/null @@ -1,74 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.2.32526.322 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{ABA8AB78-3A20-48AB-8E49-C5001869FA22}" - ProjectSection(SolutionItems) = preProject - Directory.Build.props = Directory.Build.props - global.json = global.json - nuget.config = nuget.config - EndProjectSection -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "AvaApp", "AvaApp\AvaApp.fsproj", "{F5326282-392A-4018-A065-72225A879492}" -EndProject -#if (Platform == Android) -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "AvaApp.Android", "AvaApp.Android\AvaApp.Android.fsproj", "{826164D6-5A87-4C91-B950-7A197CAD6026}" -EndProject -#endif -#if (Platform == Desktop) -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "AvaApp.Desktop", "AvaApp.Desktop\AvaApp.Desktop.fsproj", "{C2BEAE84-EFD1-4CB8-9323-4CF23DF2E310}" -EndProject -#endif -#if (Platform == iOS) -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "AvaApp.iOS", "AvaApp.iOS\AvaApp.iOS.fsproj", "{A87412B3-7CB7-4C27-933F-25853A1B860C}" -EndProject -#endif -#if (Platform == Browser) -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "AvaApp.Browser", "AvaApp.Browser\AvaApp.Browser.fsproj", "{68A88C98-EE56-4C1D-B895-31D6D40FAD4D}" -EndProject -#endif -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F5326282-392A-4018-A065-72225A879492}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F5326282-392A-4018-A065-72225A879492}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5326282-392A-4018-A065-72225A879492}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F5326282-392A-4018-A065-72225A879492}.Release|Any CPU.Build.0 = Release|Any CPU -#if (Platform == Android) - {826164D6-5A87-4C91-B950-7A197CAD6026}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {826164D6-5A87-4C91-B950-7A197CAD6026}.Debug|Any CPU.Build.0 = Debug|Any CPU - {826164D6-5A87-4C91-B950-7A197CAD6026}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {826164D6-5A87-4C91-B950-7A197CAD6026}.Release|Any CPU.ActiveCfg = Release|Any CPU - {826164D6-5A87-4C91-B950-7A197CAD6026}.Release|Any CPU.Build.0 = Release|Any CPU -#endif -#if (Platform == Desktop) - {C2BEAE84-EFD1-4CB8-9323-4CF23DF2E310}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C2BEAE84-EFD1-4CB8-9323-4CF23DF2E310}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C2BEAE84-EFD1-4CB8-9323-4CF23DF2E310}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C2BEAE84-EFD1-4CB8-9323-4CF23DF2E310}.Release|Any CPU.Build.0 = Release|Any CPU -#endif -#if (Platform == iOS) - {A87412B3-7CB7-4C27-933F-25853A1B860C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A87412B3-7CB7-4C27-933F-25853A1B860C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A87412B3-7CB7-4C27-933F-25853A1B860C}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {A87412B3-7CB7-4C27-933F-25853A1B860C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A87412B3-7CB7-4C27-933F-25853A1B860C}.Release|Any CPU.Build.0 = Release|Any CPU -#endif -#if (Platform == Browser) - {68A88C98-EE56-4C1D-B895-31D6D40FAD4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {68A88C98-EE56-4C1D-B895-31D6D40FAD4D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {68A88C98-EE56-4C1D-B895-31D6D40FAD4D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {68A88C98-EE56-4C1D-B895-31D6D40FAD4D}.Release|Any CPU.Build.0 = Release|Any CPU -#endif - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {5976E122-ADE7-4648-B2FD-553BA63FB66A} - EndGlobalSection -EndGlobal diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/About.fs b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/About.fs deleted file mode 100644 index a5058fd7..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/About.fs +++ /dev/null @@ -1,116 +0,0 @@ -namespace AvaApp - -/// You can use modules in Avalonia.FuncUI in the same way you would do -/// in [Elmish ](https://elmish.github.io/elmish/) -module About = - open Elmish - open Avalonia.FuncUI - open Avalonia.FuncUI.Types - open System.Diagnostics - open Avalonia.Controls - open Avalonia.Layout - open Avalonia.FuncUI.DSL - - - type State = - { noop: bool } - - type Links = - | AvaloniaRepository - | AvaloniaAwesome - | FuncUIRepository - | FuncUISamples - - type Msg = OpenUrl of Links - - let init = { noop = false }, Cmd.none - - let mutable urlOpen = Unchecked.defaultof unit> // Set this in platform projects - - let update (msg: Msg) (state: State) = - match msg with - | OpenUrl link -> - match link with - | AvaloniaRepository -> "https://github.com/AvaloniaUI/Avalonia" - | AvaloniaAwesome -> "https://github.com/AvaloniaCommunity/awesome-avalonia" - | FuncUIRepository -> "https://github.com/fsprojects/Avalonia.FuncUI" - | FuncUISamples -> "https://github.com/fsprojects/Avalonia.FuncUI/tree/master/src/Examples" - |> urlOpen - state, Cmd.none - - let headerView (dock: Dock): IView = - StackPanel.create [ - StackPanel.dock dock - StackPanel.verticalAlignment VerticalAlignment.Top - StackPanel.children [ - TextBlock.create [ - TextBlock.classes [ "title" ] - TextBlock.text "Thank you for using Avalonia.FuncUI" - ] - TextBlock.create [ - TextBlock.classes [ "subtitle" ] - TextBlock.text ( - "Avalonia.FuncUI is a project that provides you with an Elmish DSL for Avalonia Controls\n" + - "for you to use in an F# idiomatic way. We hope you like the project and spread the word :)\n" + - "Questions ? Reach to us on Gitter, also check the links below" - ) - ] - ] - ] |> Helpers.generalize - - - let avaloniaLinksView (dock: Dock) (dispatch: Msg -> unit) : IView = - StackPanel.create [ - StackPanel.dock dock - StackPanel.horizontalAlignment HorizontalAlignment.Left - StackPanel.children [ - TextBlock.create [ - TextBlock.classes [ "title" ] - TextBlock.text "Avalonia" - ] - TextBlock.create [ - TextBlock.classes [ "link" ] - TextBlock.onTapped(fun _ -> dispatch (OpenUrl AvaloniaRepository)) - TextBlock.text "Avalonia Repository" - ] - TextBlock.create [ - TextBlock.classes [ "link" ] - TextBlock.onTapped(fun _ -> dispatch (OpenUrl AvaloniaAwesome)) - TextBlock.text "Awesome Avalonia" - ] - ] - ] |> Helpers.generalize - - let avaloniaFuncUILinksView (dock: Dock) (dispatch: Msg -> unit) : IView = - StackPanel.create [ - StackPanel.dock dock - StackPanel.horizontalAlignment HorizontalAlignment.Right - StackPanel.children [ - TextBlock.create [ - TextBlock.classes [ "title" ] - TextBlock.text "Avalonia.FuncUI" - ] - TextBlock.create [ - TextBlock.classes [ "link" ] - TextBlock.onTapped(fun _ -> dispatch (OpenUrl FuncUIRepository)) - TextBlock.text "Avalonia.FuncUI Repository" - ] - TextBlock.create [ - TextBlock.classes [ "link" ] - TextBlock.onTapped(fun _ -> dispatch (OpenUrl FuncUISamples)) - TextBlock.text "Samples" - ] - ] - ] |> Helpers.generalize - - let view (state: State) (dispatch: Msg -> unit) = - DockPanel.create [ - DockPanel.horizontalAlignment HorizontalAlignment.Center - DockPanel.verticalAlignment VerticalAlignment.Top - DockPanel.margin (0.0, 20.0, 0.0, 0.0) - DockPanel.children [ - headerView Dock.Top - avaloniaLinksView Dock.Left dispatch - avaloniaFuncUILinksView Dock.Right dispatch - ] - ] \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/AvaApp.fsproj b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/AvaApp.fsproj deleted file mode 100644 index 30b81a18..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/AvaApp.fsproj +++ /dev/null @@ -1,22 +0,0 @@ - - - FrameworkParameter - latest - - - - - - - - - - - - - - - - - - diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/Counter.fs b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/Counter.fs deleted file mode 100644 index 406c7470..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/Counter.fs +++ /dev/null @@ -1,59 +0,0 @@ -namespace AvaApp - -module Counter = - open Avalonia.Controls - open Avalonia.FuncUI.DSL - open Avalonia.Layout - - type State = { count : int; text: string } - let init = { count = 0; text = "" } - - type Msg = Increment | Decrement | Reset | SetText of string - - let update (msg: Msg) (state: State) : State = - match msg with - | Increment -> { state with count = state.count + 1 } - | Decrement -> { state with count = state.count - 1 } - | Reset -> init - | SetText t -> { state with text = t } - - let view (state: State) (dispatch) = - DockPanel.create [ - DockPanel.children [ - StackPanel.create [ - StackPanel.dock Dock.Bottom - StackPanel.margin 5.0 - StackPanel.spacing 5.0 - StackPanel.children [ - TextBox.create [ - TextBox.text state.text - TextBox.onTextChanged (SetText >> dispatch) - TextBox.watermark "Put any text here" - ] - Button.create [ - Button.onClick (fun _ -> dispatch Increment) - Button.content "+" - Button.classes [ "plus" ] - ] - Button.create [ - Button.onClick (fun _ -> dispatch Decrement) - Button.content "-" - Button.classes [ "minus" ] - ] - Button.create [ - Button.onClick (fun _ -> dispatch Reset) - Button.content "reset" - ] - ] - ] - - TextBlock.create [ - TextBlock.dock Dock.Top - TextBlock.fontSize 48.0 - TextBlock.verticalAlignment VerticalAlignment.Center - TextBlock.horizontalAlignment HorizontalAlignment.Center - TextBlock.text (string state.count) - ] - - ] - ] \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/Program.fs b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/Program.fs deleted file mode 100644 index 2fd79893..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/Program.fs +++ /dev/null @@ -1,41 +0,0 @@ -namespace AvaApp - -open Elmish -open Avalonia -open Avalonia.Controls.ApplicationLifetimes -open Avalonia.FuncUI -open Avalonia.FuncUI.Elmish -open Avalonia.FuncUI.Hosts -open Avalonia.Themes.Fluent - -/// This is your application you can ose the initialize method to load styles -/// or handle Life Cycle events of your application -type App() = - inherit Application() - - override this.Initialize() = - this.Styles.Add (FluentTheme()) - this.RequestedThemeVariant <- Styling.ThemeVariant.Dark - this.Styles.Load "avares://AvaApp/Styles.xaml" - - override this.OnFrameworkInitializationCompleted() = - let init(this: 'T when 'T :> Controls.ContentControl and 'T :> IViewHost) (visualRoot: Rendering.IRenderRoot) = - Shell.program - |> Program.withHost this - |> Program.run - match this.ApplicationLifetime with - | :? IClassicDesktopStyleApplicationLifetime as lifetime -> - lifetime.MainWindow <- { - new HostWindow() with - override this.OnInitialized() = - base.Title <- "AvaTitleParameter" - init this this.VisualRoot - } - | :? ISingleViewApplicationLifetime as lifetime -> - lifetime.MainView <- { - new HostControl() with - override this.OnInitialized() = - init this this.VisualRoot - } - | _ -> () - base.OnFrameworkInitializationCompleted() \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/README.md b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/README.md deleted file mode 100644 index e1a17ae2..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/README.md +++ /dev/null @@ -1,50 +0,0 @@ -[fantomas]: https://github.com/fsprojects/fantomas -[f# formatting]: https://marketplace.visualstudio.com/items?itemName=asti.fantomas-vs - -# AvaApp - -This is an Avalonia.FuncUI Starter template, this template shows you in a brief way how you can create components and functions to render your UI. - -To run this application just type - -``` -dotnet run -``` - -You should briefly see your application window showing on your desktop. - -### Next Steps - -If you're using VSCode we recommend you to install [Fantomas] - -``` -dotnet new tool-manifest -dotnet tool install fantomas -``` - -and add the following `.editorconfig` - -```editorconfig -root = true - -[*] -indent_style=space -indent_size=4 -charset=utf-8 -trim_trailing_whitespace=true -insert_final_newline=false - -[*.fs] -fsharp_single_argument_web_mode=true -``` - -This should will allow Fantomas to format your code on save. - -Other editors like Rider and Visual Studio [F# Formatting] can also pick up these settings even if you don't install fantomas. - -### Feeling a little lost? - -Check out the documentation: -https://avaloniacommunity.github.io/Avalonia.FuncUI.Docs/ - -The documentation is still work in progress and will change over the next few months, but feel free to contribute and ask questions if needed. diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/Shell.fs b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/Shell.fs deleted file mode 100644 index 6f17a5e7..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/Shell.fs +++ /dev/null @@ -1,67 +0,0 @@ -namespace AvaApp - -/// This is the main module of your application -/// here you handle all of your child pages as well as their -/// messages and their updates, useful to update multiple parts -/// of your application, Please refer to the `view` function -/// to see how to handle different kinds of "*child*" controls -module Shell = - open Elmish - open Avalonia - open Avalonia.Controls - open Avalonia.Input - open Avalonia.FuncUI.DSL - open Avalonia.FuncUI - open Avalonia.FuncUI.Builder - open Avalonia.FuncUI.Hosts - open Avalonia.FuncUI.Elmish - - type State = - /// store the child state in your main state - { aboutState: About.State; counterState: Counter.State;} - - type Msg = - | AboutMsg of About.Msg - | CounterMsg of Counter.Msg - - let init = - let aboutState, aboutCmd = About.init - let counterState = Counter.init - { aboutState = aboutState; counterState = counterState }, - /// If your children controls don't emit any commands - /// in the init function, you can just return Cmd.none - /// otherwise, you can use a batch operation on all of them - /// you can add more init commands as you need - Cmd.batch [ aboutCmd ] - - let update (msg: Msg) (state: State): State * Cmd<_> = - match msg with - | AboutMsg bpmsg -> - let aboutState, cmd = - About.update bpmsg state.aboutState - { state with aboutState = aboutState }, - /// map the message to the kind of message - /// your child control needs to handle - Cmd.map AboutMsg cmd - | CounterMsg countermsg -> - let counterMsg = - Counter.update countermsg state.counterState - { state with counterState = counterMsg }, - /// map the message to the kind of message - /// your child control needs to handle - Cmd.none - - let view (state: State) (dispatch) = - DockPanel.create - [ DockPanel.children - [ TabControl.create - [ TabControl.tabStripPlacement Dock.Top - TabControl.viewItems - [ TabItem.create - [ TabItem.header "Counter Sample" - TabItem.content (Counter.view state.counterState (CounterMsg >> dispatch)) ] - TabItem.create - [ TabItem.header "About" - TabItem.content (About.view state.aboutState (AboutMsg >> dispatch)) ] ] ] ] ] - - let program = Program.mkProgram (fun () -> init) update view \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/Styles.xaml b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/Styles.xaml deleted file mode 100644 index 2bd9b071..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/AvaApp/Styles.xaml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/Directory.Build.props b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/Directory.Build.props deleted file mode 100644 index e137ab5b..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/Directory.Build.props +++ /dev/null @@ -1,14 +0,0 @@ - - - - - AvaIdParameter - AvaVersionParameter - AvaDisplayVersionParameter - AvaTitleParameter - - - 11.0.0-rc1.1 - 1.0.0-rc1.1.0 - - \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/LICENSE b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/LICENSE deleted file mode 100644 index 4d117e0e..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Hadrian Tang, Avalonia.FuncUI contributors, and Avalonia contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/global.json b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/global.json deleted file mode 100644 index b5d508d8..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/global.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "sdk": { - "version": "7.0.100", - "rollForward": "latestFeature" - }, - "msbuild-sdks": { - "Microsoft.Build.Traversal": "1.0.43", - "Xamarin.Legacy.Sdk": "0.1.2-alpha6", - "MSBuild.Sdk.Extras": "3.0.22", - "AggregatePackage.NuGet.Sdk" : "0.1.12" - } -} diff --git a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/nuget.config b/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/nuget.config deleted file mode 100644 index ad73f0a5..00000000 --- a/src/Avalonia.FuncUI.Templates/content/CrossPlatformMvuTemplate/nuget.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/.template.config/template.json b/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/.template.config/template.json deleted file mode 100644 index 203a8e05..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/.template.config/template.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/template", - "author": "JaggerJo", - "classifications": [ - "Console", - "Avalonia", - "UI", - "Elmish" - ], - "name": "Avalonia FuncUI MVU App (with extras)", - "tags": { - "language": "F#", - "type": "project" - }, - "identity": "Avalonia.FuncUI.FullMvuTemplate", - "shortName": "funcui.full.mvu", - "sourceName": "FullMvuTemplate", - "preferNameDirectory": true -} \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/About.fs b/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/About.fs deleted file mode 100644 index a21bf438..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/About.fs +++ /dev/null @@ -1,123 +0,0 @@ -namespace FullMvuTemplate - -/// You can use modules in Avalonia.FuncUI in the same way you would do -/// in [Elmish ](https://elmish.github.io/elmish/) -module About = - open Elmish - open Avalonia.FuncUI - open Avalonia.FuncUI.Types - open System.Diagnostics - open System.Runtime.InteropServices - open Avalonia.Controls - open Avalonia.Layout - open Avalonia.FuncUI.DSL - - - type State = - { noop: bool } - - type Links = - | AvaloniaRepository - | AvaloniaAwesome - | FuncUIRepository - | FuncUISamples - - type Msg = OpenUrl of Links - - let init() = { noop = false }, Cmd.none - - - let update (msg: Msg) (state: State) = - match msg with - | OpenUrl link -> - let url = - match link with - | AvaloniaRepository -> "https://github.com/AvaloniaUI/Avalonia" - | AvaloniaAwesome -> "https://github.com/AvaloniaCommunity/awesome-avalonia" - | FuncUIRepository -> "https://github.com/fsprojects/Avalonia.FuncUI" - | FuncUISamples -> "https://github.com/fsprojects/Avalonia.FuncUI/tree/master/src/Examples" - - if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then - let start = sprintf "/c start %s" url - Process.Start(ProcessStartInfo("cmd", start)) |> ignore - else if RuntimeInformation.IsOSPlatform(OSPlatform.Linux) then - Process.Start("xdg-open", url) |> ignore - else if RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then - Process.Start("open", url) |> ignore - state, Cmd.none - - let headerView (dock: Dock): IView = - StackPanel.create [ - StackPanel.dock dock - StackPanel.verticalAlignment VerticalAlignment.Top - StackPanel.children [ - TextBlock.create [ - TextBlock.classes [ "title" ] - TextBlock.text "Thank you for using Avalonia.FuncUI" - ] - TextBlock.create [ - TextBlock.classes [ "subtitle" ] - TextBlock.text ( - "Avalonia.FuncUI is a project that provides you with an Elmish DSL for Avalonia Controls\n" + - "for you to use in an F# idiomatic way. We hope you like the project and spread the word :)\n" - ) - ] - ] - ] |> Helpers.generalize - - - let avaloniaLinksView (dock: Dock) (dispatch: Msg -> unit) : IView = - StackPanel.create [ - StackPanel.dock dock - StackPanel.horizontalAlignment HorizontalAlignment.Left - StackPanel.children [ - TextBlock.create [ - TextBlock.classes [ "title" ] - TextBlock.text "Avalonia" - ] - TextBlock.create [ - TextBlock.classes [ "link" ] - TextBlock.onTapped(fun _ -> dispatch (OpenUrl AvaloniaRepository)) - TextBlock.text "Avalonia Repository" - ] - TextBlock.create [ - TextBlock.classes [ "link" ] - TextBlock.onTapped(fun _ -> dispatch (OpenUrl AvaloniaAwesome)) - TextBlock.text "Awesome Avalonia" - ] - ] - ] |> Helpers.generalize - - let avaloniaFuncUILinksView (dock: Dock) (dispatch: Msg -> unit) : IView = - StackPanel.create [ - StackPanel.dock dock - StackPanel.horizontalAlignment HorizontalAlignment.Right - StackPanel.children [ - TextBlock.create [ - TextBlock.classes [ "title" ] - TextBlock.text "Avalonia.FuncUI" - ] - TextBlock.create [ - TextBlock.classes [ "link" ] - TextBlock.onTapped(fun _ -> dispatch (OpenUrl FuncUIRepository)) - TextBlock.text "Avalonia.FuncUI Repository" - ] - TextBlock.create [ - TextBlock.classes [ "link" ] - TextBlock.onTapped(fun _ -> dispatch (OpenUrl FuncUISamples)) - TextBlock.text "Samples" - ] - ] - ] |> Helpers.generalize - - let view (state: State) (dispatch: Msg -> unit) = - DockPanel.create [ - DockPanel.horizontalAlignment HorizontalAlignment.Center - DockPanel.verticalAlignment VerticalAlignment.Top - DockPanel.margin (0.0, 20.0, 0.0, 0.0) - DockPanel.children [ - headerView Dock.Top - avaloniaLinksView Dock.Left dispatch - avaloniaFuncUILinksView Dock.Right dispatch - ] - ] \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/Counter.fs b/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/Counter.fs deleted file mode 100644 index 1f9b41d1..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/Counter.fs +++ /dev/null @@ -1,52 +0,0 @@ -namespace FullMvuTemplate - -module Counter = - open Avalonia.Controls - open Avalonia.FuncUI.DSL - open Avalonia.Layout - - type State = { count : int } - let init() = { count = 0 } - - type Msg = Increment | Decrement | Reset - - let update (msg: Msg) (state: State) : State = - match msg with - | Increment -> { state with count = state.count + 1 } - | Decrement -> { state with count = state.count - 1 } - | Reset -> init() - - let view (state: State) (dispatch) = - DockPanel.create [ - DockPanel.children [ - StackPanel.create [ - StackPanel.dock Dock.Bottom - StackPanel.margin 5.0 - StackPanel.spacing 5.0 - StackPanel.children [ - Button.create [ - Button.onClick (fun _ -> dispatch Increment) - Button.content "+" - Button.classes [ "plus" ] - ] - Button.create [ - Button.onClick (fun _ -> dispatch Decrement) - Button.content "-" - Button.classes [ "minus" ] - ] - Button.create [ - Button.onClick (fun _ -> dispatch Reset) - Button.content "reset" - ] - ] - ] - - TextBlock.create [ - TextBlock.dock Dock.Top - TextBlock.fontSize 48.0 - TextBlock.verticalAlignment VerticalAlignment.Center - TextBlock.horizontalAlignment HorizontalAlignment.Center - TextBlock.text (string state.count) - ] - ] - ] \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/FullMvuTemplate.fsproj b/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/FullMvuTemplate.fsproj deleted file mode 100644 index 077f7a6d..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/FullMvuTemplate.fsproj +++ /dev/null @@ -1,23 +0,0 @@ - - - Exe - net8.0 - - - - - - - - - - - - - - - - - - - diff --git a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/Program.fs b/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/Program.fs deleted file mode 100644 index 1a8074dc..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/Program.fs +++ /dev/null @@ -1,31 +0,0 @@ -namespace FullMvuTemplate - -open Avalonia -open Avalonia.Controls.ApplicationLifetimes -open Avalonia.FuncUI -open Avalonia.Themes.Fluent - - -/// This is your application you can ose the initialize method to load styles -/// or handle Life Cycle events of your application -type App() = - inherit Application() - - override this.Initialize() = - this.Styles.Add (FluentTheme()) - this.Styles.Load "avares://FullMvuTemplate/Styles.xaml" - - override this.OnFrameworkInitializationCompleted() = - match this.ApplicationLifetime with - | :? IClassicDesktopStyleApplicationLifetime as desktopLifetime -> - desktopLifetime.MainWindow <- Shell.MainWindow() - | _ -> () - -module Program = - - [] - let main (args: string []) = - AppBuilder.Configure() - .UsePlatformDetect() - .UseSkia() - .StartWithClassicDesktopLifetime(args) diff --git a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/README.md b/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/README.md deleted file mode 100644 index d2c1fd20..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/README.md +++ /dev/null @@ -1,53 +0,0 @@ -[fantomas]: https://github.com/fsprojects/fantomas -[f# formatting]: https://marketplace.visualstudio.com/items?itemName=asti.fantomas-vs - -# FullMvuTemplate - -This is an Avalonia.FuncUI Starter template, this template shows you in a brief way how you can create components and functions to render your UI. - -To run this application just type - -``` -dotnet run -``` - -You should briefly see your application window showing on your desktop. - -### Next Steps - -If you're using VSCode we recommend you to install [Fantomas] - -``` -dotnet new tool-manifest -dotnet tool install fantomas -``` - -and add the following `.editorconfig` - -```editorconfig -root = true - -[*] -indent_style=space -indent_size=4 -charset=utf-8 -trim_trailing_whitespace=true -insert_final_newline=false - -[*.fs] -fsharp_newline_between_type_definition_and_members = false -fsharp_multiline_bracket_style = stroustrup -fsharp_newline_before_multiline_computation_expression = false -``` - -This should will allow Fantomas to format your code on save. - -Other editors like Rider and Visual Studio [F# Formatting] can also pick up these settings even if you don't install fantomas. - -### Feeling a little lost? - -Check out the documentation: - -https://funcui.avaloniaui.net/ - -The documentation is still work in progress and will change over the next few months, but feel free to contribute and ask questions if needed. diff --git a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/Shell.fs b/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/Shell.fs deleted file mode 100644 index c4c1abb2..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/Shell.fs +++ /dev/null @@ -1,97 +0,0 @@ -namespace FullMvuTemplate - -/// This is the main module of your application -/// here you handle all of your child pages as well as their -/// messages and their updates, useful to update multiple parts -/// of your application, Please refer to the `view` function -/// to see how to handle different kinds of "*child*" controls -module Shell = - open Elmish - open Avalonia - open Avalonia.Controls - open Avalonia.Input - open Avalonia.FuncUI - open Avalonia.FuncUI.DSL - open Avalonia.FuncUI.Builder - open Avalonia.FuncUI.Hosts - open Avalonia.FuncUI.Elmish - - type State = - /// store the child state in your main state - { aboutState: About.State; counterState: Counter.State;} - - type Msg = - | AboutMsg of About.Msg - | CounterMsg of Counter.Msg - - let init() = - let aboutState, aboutCmd = About.init() - let counterState = Counter.init() - { aboutState = aboutState; counterState = counterState }, - /// If your children controls don't emit any commands - /// in the init function, you can just return Cmd.none - /// otherwise, you can use a batch operation on all of them - /// you can add more init commands as you need - Cmd.batch [ aboutCmd ] - - let update (msg: Msg) (state: State): State * Cmd<_> = - match msg with - | AboutMsg bpmsg -> - let aboutState, cmd = - About.update bpmsg state.aboutState - { state with aboutState = aboutState }, - /// map the message to the kind of message - /// your child control needs to handle - Cmd.map AboutMsg cmd - | CounterMsg countermsg -> - let counterMsg = - Counter.update countermsg state.counterState - { state with counterState = counterMsg }, - /// map the message to the kind of message - /// your child control needs to handle - Cmd.none - - let view (state: State) (dispatch) = - DockPanel.create [ - DockPanel.children [ - TabControl.create [ - TabControl.tabStripPlacement Dock.Top - TabControl.viewItems [ - TabItem.create [ - TabItem.header "Counter Sample" - TabItem.content (Counter.view state.counterState (CounterMsg >> dispatch)) ] - TabItem.create [ - TabItem.header "About" - TabItem.content (About.view state.aboutState (AboutMsg >> dispatch)) - ] - ] - ] - ] - ] - - /// This is the main window of your application - /// you can do all sort of useful things here like setting heights and widths - /// as well as attaching your dev tools that can be super useful when developing with - /// Avalonia - type MainWindow() as this = - inherit HostWindow() - do - base.Title <- "FullMvuTemplate" - base.Width <- 800.0 - base.Height <- 600.0 - base.MinWidth <- 800.0 - base.MinHeight <- 600.0 -//-:cnd -#if DEBUG - this.AttachDevTools(KeyGesture(Key.F12)) -#endif -//+:cnd - - Elmish.Program.mkProgram init update view - |> Program.withHost this -//-:cnd -#if DEBUG - |> Program.withConsoleTrace -#endif -//+:cnd - |> Program.run diff --git a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/Styles.xaml b/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/Styles.xaml deleted file mode 100644 index f85c78aa..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullMvuTemplate/Styles.xaml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/FullTemplate/.template.config/template.json b/src/Avalonia.FuncUI.Templates/content/FullTemplate/.template.config/template.json deleted file mode 100644 index d42ed727..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullTemplate/.template.config/template.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/template", - "author": "JaggerJo", - "classifications": [ - "Console", - "Avalonia", - "UI", - "Components" - ], - "name": "Avalonia FuncUI Component App (with extras)", - "tags": { - "language": "F#", - "type": "project" - }, - "identity": "Avalonia.FuncUI.FullTemplate", - "shortName": "funcui.full", - "sourceName": "FullTemplate", - "preferNameDirectory": true -} \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/FullTemplate/About.fs b/src/Avalonia.FuncUI.Templates/content/FullTemplate/About.fs deleted file mode 100644 index 4831732e..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullTemplate/About.fs +++ /dev/null @@ -1,112 +0,0 @@ -namespace FullTemplate - -module About = - open Avalonia.FuncUI - open Avalonia.FuncUI.Types - open System.Diagnostics - open System.Runtime.InteropServices - open Avalonia.Controls - open Avalonia.Layout - open Avalonia.FuncUI.DSL - - type Links = - | AvaloniaRepository - | AvaloniaAwesome - | FuncUIRepository - | FuncUISamples - - let openUrl url = - let url = - match url with - | AvaloniaRepository -> "https://github.com/AvaloniaUI/Avalonia" - | AvaloniaAwesome -> "https://github.com/AvaloniaCommunity/awesome-avalonia" - | FuncUIRepository -> "https://github.com/fsprojects/Avalonia.FuncUI" - | FuncUISamples -> "https://github.com/fsprojects/Avalonia.FuncUI/tree/master/src/Examples" - - if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then - let start = sprintf "/c start %s" url - Process.Start(ProcessStartInfo("cmd", start)) |> ignore - else if RuntimeInformation.IsOSPlatform(OSPlatform.Linux) then - Process.Start("xdg-open", url) |> ignore - else if RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then - Process.Start("open", url) |> ignore - - let headerView (dock: Dock): IView = - StackPanel.create [ - StackPanel.dock dock - StackPanel.verticalAlignment VerticalAlignment.Top - StackPanel.children [ - TextBlock.create [ - TextBlock.classes [ "title" ] - TextBlock.text "Thank you for using Avalonia.FuncUI" - ] - TextBlock.create [ - TextBlock.classes [ "subtitle" ] - TextBlock.text ( - "Avalonia.FuncUI is a project that provides you with an Elmish DSL for Avalonia Controls\n" + - "for you to use in an F# idiomatic way. We hope you like the project and spread the word :)\n" + - "Questions ? Reach to us on Gitter, also check the links below" - ) - ] - ] - ] - - - let avaloniaLinksView (dock: Dock) : IView = - StackPanel.create [ - StackPanel.dock dock - StackPanel.horizontalAlignment HorizontalAlignment.Left - StackPanel.children [ - TextBlock.create [ - TextBlock.classes [ "title" ] - TextBlock.text "Avalonia" - ] - TextBlock.create [ - TextBlock.classes [ "link" ] - TextBlock.onTapped(fun _ -> openUrl AvaloniaRepository) - TextBlock.text "Avalonia Repository" - ] - TextBlock.create [ - TextBlock.classes [ "link" ] - TextBlock.onTapped(fun _ -> openUrl AvaloniaAwesome) - TextBlock.text "Awesome Avalonia" - ] - ] - ] - - let avaloniaFuncUILinksView (dock: Dock) : IView = - StackPanel.create [ - StackPanel.dock dock - StackPanel.horizontalAlignment HorizontalAlignment.Right - StackPanel.children [ - TextBlock.create [ - TextBlock.classes [ "title" ] - TextBlock.text "Avalonia.FuncUI" - ] - TextBlock.create [ - TextBlock.classes [ "link" ] - TextBlock.onTapped(fun _ -> openUrl FuncUIRepository) - TextBlock.text "Avalonia.FuncUI Repository" - ] - TextBlock.create [ - TextBlock.classes [ "link" ] - TextBlock.onTapped(fun _ -> openUrl FuncUISamples) - TextBlock.text "Samples" - ] - ] - ] - - let view = - Component.create("About", fun _ -> - DockPanel.create [ - DockPanel.horizontalAlignment HorizontalAlignment.Center - DockPanel.verticalAlignment VerticalAlignment.Top - DockPanel.margin (0.0, 20.0, 0.0, 0.0) - DockPanel.children [ - headerView Dock.Top - avaloniaLinksView Dock.Left - avaloniaFuncUILinksView Dock.Right - ] - ] - ) - \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/FullTemplate/Counter.fs b/src/Avalonia.FuncUI.Templates/content/FullTemplate/Counter.fs deleted file mode 100644 index 42fcd60d..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullTemplate/Counter.fs +++ /dev/null @@ -1,48 +0,0 @@ -namespace FullTemplate - -module Counter = - open Avalonia.FuncUI - open Avalonia.Controls - open Avalonia.FuncUI.DSL - open Avalonia.Layout - - let view = - Component.create("Counter",fun ctx -> - let state = ctx.useState 0 - DockPanel.create [ - DockPanel.verticalAlignment VerticalAlignment.Center - DockPanel.horizontalAlignment HorizontalAlignment.Center - DockPanel.children [ - Button.create [ - Button.width 64 - Button.horizontalAlignment HorizontalAlignment.Center - Button.horizontalContentAlignment HorizontalAlignment.Center - Button.content "Reset" - Button.onClick (fun _ -> state.Set 0) - Button.dock Dock.Bottom - ] - Button.create [ - Button.width 64 - Button.horizontalAlignment HorizontalAlignment.Center - Button.horizontalContentAlignment HorizontalAlignment.Center - Button.content "-" - Button.onClick (fun _ -> state.Current - 1 |> state.Set) - Button.dock Dock.Bottom - ] - Button.create [ - Button.width 64 - Button.horizontalAlignment HorizontalAlignment.Center - Button.horizontalContentAlignment HorizontalAlignment.Center - Button.content "+" - Button.onClick (fun _ -> state.Current + 1 |> state.Set) - Button.dock Dock.Bottom - ] - TextBlock.create [ - TextBlock.dock Dock.Top - TextBlock.fontSize 48.0 - TextBlock.horizontalAlignment HorizontalAlignment.Center - TextBlock.text (string state.Current) - ] - ] - ] - ) \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/content/FullTemplate/FullTemplate.fsproj b/src/Avalonia.FuncUI.Templates/content/FullTemplate/FullTemplate.fsproj deleted file mode 100644 index 41734767..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullTemplate/FullTemplate.fsproj +++ /dev/null @@ -1,22 +0,0 @@ - - - Exe - net8.0 - - - - - - - - - - - - - - - - - - diff --git a/src/Avalonia.FuncUI.Templates/content/FullTemplate/Program.fs b/src/Avalonia.FuncUI.Templates/content/FullTemplate/Program.fs deleted file mode 100644 index 73e37eb0..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullTemplate/Program.fs +++ /dev/null @@ -1,30 +0,0 @@ -namespace FullTemplate - -open Avalonia -open Avalonia.Controls.ApplicationLifetimes -open Avalonia.FuncUI -open Avalonia.Themes.Fluent - -/// This is your application you can ose the initialize method to load styles -/// or handle Life Cycle events of your application -type App() = - inherit Application() - - override this.Initialize() = - this.Styles.Add (FluentTheme()) - this.Styles.Load "avares://FullTemplate/Styles.xaml" - - override this.OnFrameworkInitializationCompleted() = - match this.ApplicationLifetime with - | :? IClassicDesktopStyleApplicationLifetime as desktopLifetime -> - desktopLifetime.MainWindow <- Shell.MainWindow() - | _ -> () - -module Program = - - [] - let main (args: string []) = - AppBuilder.Configure() - .UsePlatformDetect() - .UseSkia() - .StartWithClassicDesktopLifetime(args) diff --git a/src/Avalonia.FuncUI.Templates/content/FullTemplate/README.md b/src/Avalonia.FuncUI.Templates/content/FullTemplate/README.md deleted file mode 100644 index f9079805..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullTemplate/README.md +++ /dev/null @@ -1,53 +0,0 @@ -[fantomas]: https://github.com/fsprojects/fantomas -[f# formatting]: https://marketplace.visualstudio.com/items?itemName=asti.fantomas-vs - -# FullTemplate - -This is an Avalonia.FuncUI Starter template, this template shows you in a brief way how you can create components and functions to render your UI. - -To run this application just type - -``` -dotnet run -``` - -You should briefly see your application window showing on your desktop. - -### Next Steps - -If you're using VSCode we recommend you to install [Fantomas] - -``` -dotnet new tool-manifest -dotnet tool install fantomas -``` - -and add the following `.editorconfig` - -```editorconfig -root = true - -[*] -indent_style=space -indent_size=4 -charset=utf-8 -trim_trailing_whitespace=true -insert_final_newline=false - -[*.fs] -fsharp_newline_between_type_definition_and_members = false -fsharp_multiline_bracket_style = stroustrup -fsharp_newline_before_multiline_computation_expression = false -``` - -This should will allow Fantomas to format your code on save. - -Other editors like Rider and Visual Studio [F# Formatting] can also pick up these settings even if you don't install fantomas. - -### Feeling a little lost? - -Check out the documentation: - -https://funcui.avaloniaui.net/ - -The documentation is still work in progress and will change over the next few months, but feel free to contribute and ask questions if needed. diff --git a/src/Avalonia.FuncUI.Templates/content/FullTemplate/Shell.fs b/src/Avalonia.FuncUI.Templates/content/FullTemplate/Shell.fs deleted file mode 100644 index 0efd7cae..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullTemplate/Shell.fs +++ /dev/null @@ -1,50 +0,0 @@ -namespace FullTemplate - -module Shell = - open Avalonia - open Avalonia.Input - open Avalonia.Controls - open Avalonia.FuncUI - open Avalonia.FuncUI.DSL - open Avalonia.FuncUI.Hosts - - let view = - Component(fun _ -> - DockPanel.create [ - - DockPanel.children [ - TabControl.create [ - TabControl.tabStripPlacement Dock.Top - TabControl.viewItems [ - TabItem.create [ - TabItem.header "Counter Sample" - TabItem.content Counter.view - ] - TabItem.create [ - TabItem.header "About" - TabItem.content About.view - ] - ] - ] - ] - ] - ) - - /// This is the main window of your application - /// you can do all sort of useful things here like setting heights and widths - /// as well as attaching your dev tools that can be super useful when developing with - /// Avalonia - type MainWindow() as this = - inherit HostWindow() - do - base.Title <- "FullTemplate" - base.Width <- 800.0 - base.Height <- 600.0 - base.MinWidth <- 800.0 - base.MinHeight <- 600.0 - this.Content <- view -//-:cnd -#if DEBUG - this.AttachDevTools(KeyGesture(Key.F12)) -#endif -//+:cnd diff --git a/src/Avalonia.FuncUI.Templates/content/FullTemplate/Styles.xaml b/src/Avalonia.FuncUI.Templates/content/FullTemplate/Styles.xaml deleted file mode 100644 index f85c78aa..00000000 --- a/src/Avalonia.FuncUI.Templates/content/FullTemplate/Styles.xaml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Avalonia.FuncUI.Templates/img/NewApp_screenshot.png b/src/Avalonia.FuncUI.Templates/img/NewApp_screenshot.png deleted file mode 100644 index 31c32786..00000000 Binary files a/src/Avalonia.FuncUI.Templates/img/NewApp_screenshot.png and /dev/null differ diff --git a/src/Avalonia.FuncUI.sln b/src/Avalonia.FuncUI.sln index 137bfe25..342d1470 100644 --- a/src/Avalonia.FuncUI.sln +++ b/src/Avalonia.FuncUI.sln @@ -70,14 +70,6 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Avalonia.FuncUI.Benchmarks" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Examples.Mobile.iOS", "Examples\Examples.Mobile.iOS\Examples.Mobile.iOS.fsproj", "{222A135C-23A4-471B-8A6A-630B7EEFAD4F}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Avalonia.FuncUI.Templates", "Avalonia.FuncUI.Templates\Avalonia.FuncUI.Templates.fsproj", "{1EEA7F36-3DCD-4A42-BE59-1E02E1B8E3BE}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{37594D05-9BE4-40C2-AC5B-83B0AC9F7B15}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Embedded", "Embedded", "{86429C85-F3D8-4F7D-A66F-24151C7236B9}" -EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "BasicTemplate", "Avalonia.FuncUI.Templates\content\BasicTemplate\BasicTemplate.fsproj", "{BB03E86D-4DAF-468F-BD0C-D85D6641F02D}" -EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Examples.TodoApp", "Examples\Examples.TodoApp\Examples.TodoApp.fsproj", "{70BDCE72-149A-435A-9910-E79DE329F978}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Examples.Elmish.Tetris", "Examples\Elmish\Examples.Elmish.Tetris\Examples.Elmish.Tetris.fsproj", "{EC63B886-E809-4B74-B533-BFF3D60017C9}" @@ -184,14 +176,6 @@ Global {222A135C-23A4-471B-8A6A-630B7EEFAD4F}.Debug|Any CPU.Build.0 = Debug|Any CPU {222A135C-23A4-471B-8A6A-630B7EEFAD4F}.Release|Any CPU.ActiveCfg = Release|Any CPU {222A135C-23A4-471B-8A6A-630B7EEFAD4F}.Release|Any CPU.Build.0 = Release|Any CPU - {1EEA7F36-3DCD-4A42-BE59-1E02E1B8E3BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1EEA7F36-3DCD-4A42-BE59-1E02E1B8E3BE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1EEA7F36-3DCD-4A42-BE59-1E02E1B8E3BE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1EEA7F36-3DCD-4A42-BE59-1E02E1B8E3BE}.Release|Any CPU.Build.0 = Release|Any CPU - {BB03E86D-4DAF-468F-BD0C-D85D6641F02D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB03E86D-4DAF-468F-BD0C-D85D6641F02D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB03E86D-4DAF-468F-BD0C-D85D6641F02D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB03E86D-4DAF-468F-BD0C-D85D6641F02D}.Release|Any CPU.Build.0 = Release|Any CPU {70BDCE72-149A-435A-9910-E79DE329F978}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {70BDCE72-149A-435A-9910-E79DE329F978}.Debug|Any CPU.Build.0 = Debug|Any CPU {70BDCE72-149A-435A-9910-E79DE329F978}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -221,27 +205,24 @@ Global {1401B46D-1F14-4D29-8E45-96E62D46405F} = {F6F4AAF7-2BDA-4D2F-B78D-F6D8A03F660E} {7A0CA9E2-AFB8-4BA0-A725-F80EB98717C4} = {F6F4AAF7-2BDA-4D2F-B78D-F6D8A03F660E} {C9BF89F2-6DE8-4F37-A6AD-6D40E982F265} = {F6F4AAF7-2BDA-4D2F-B78D-F6D8A03F660E} + {64F427DB-02F2-499C-B4F2-25BC18F65E85} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} + {769FB456-1B73-4D6C-BA86-47DB484E3651} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} + {8212649E-0ECD-49CD-BBBA-13AC0151666A} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} + {EB476DAF-C691-46B4-84FC-CA64E4C64A1A} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} + {BF5DC7CC-7ABF-40AB-97DD-6774C17FE005} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} + {5CC37986-D6E0-438B-B895-BC82DFD22307} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} + {B8D8C84B-05AD-475B-BE81-A30544CE0149} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} {24AD0B82-9D10-4929-8FFE-E5E048C11842} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} {4121CB46-AEBD-4047-B032-8682ADFF02A6} = {5DB968C6-935E-41AC-A252-644B4886AF8A} {01631D41-54F9-4815-8B26-9F1BEEC22F7A} = {5DB968C6-935E-41AC-A252-644B4886AF8A} {AD6796F9-45CA-4FBA-9673-E6FC9214C80D} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} + {90E18FDC-8B2A-4C21-B60D-B5B7A14648A3} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} + {71C50981-2E3D-476B-9FA5-971671A9BB7A} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} {8E3586BB-D43F-4FD7-9F8E-05F55EAEE850} = {681AB0E5-A733-4CFE-872A-10B810DAF86D} {222A135C-23A4-471B-8A6A-630B7EEFAD4F} = {AD6796F9-45CA-4FBA-9673-E6FC9214C80D} - {1EEA7F36-3DCD-4A42-BE59-1E02E1B8E3BE} = {37594D05-9BE4-40C2-AC5B-83B0AC9F7B15} - {86429C85-F3D8-4F7D-A66F-24151C7236B9} = {37594D05-9BE4-40C2-AC5B-83B0AC9F7B15} - {BB03E86D-4DAF-468F-BD0C-D85D6641F02D} = {86429C85-F3D8-4F7D-A66F-24151C7236B9} + {70BDCE72-149A-435A-9910-E79DE329F978} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} {EC63B886-E809-4B74-B533-BFF3D60017C9} = {F6F4AAF7-2BDA-4D2F-B78D-F6D8A03F660E} - {BF5DC7CC-7ABF-40AB-97DD-6774C17FE005} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} - {8212649E-0ECD-49CD-BBBA-13AC0151666A} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} - {5CC37986-D6E0-438B-B895-BC82DFD22307} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} - {71C50981-2E3D-476B-9FA5-971671A9BB7A} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} - {EB476DAF-C691-46B4-84FC-CA64E4C64A1A} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} - {90E18FDC-8B2A-4C21-B60D-B5B7A14648A3} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} - {769FB456-1B73-4D6C-BA86-47DB484E3651} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} - {B8D8C84B-05AD-475B-BE81-A30544CE0149} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} - {64F427DB-02F2-499C-B4F2-25BC18F65E85} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} {2C7F4542-65CE-4EC6-9876-C1C2215EE006} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} - {70BDCE72-149A-435A-9910-E79DE329F978} = {84811DB3-C276-4F0D-B3BA-78B88E2C6EF0} {C59DF473-A6F9-4D94-9308-9381F36CB71D} = {24AD0B82-9D10-4929-8FFE-E5E048C11842} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution