This commit is contained in:
Jim Bennett 2018-09-12 14:38:14 +01:00
Коммит 4ebeb73179
12 изменённых файлов: 670 добавлений и 0 удалений

45
.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,45 @@
# Autosave files
*~
# build
[Oo]bj/
[Bb]in/
packages/
TestResults/
# globs
Makefile.in
*.DS_Store
*.sln.cache
*.suo
*.cache
*.pidb
*.userprefs
*.usertasks
config.log
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.user
*.tar.gz
tarballs/
test-results/
Thumbs.db
.vs/
# Mac bundle stuff
*.dmg
*.app
# resharper
*_Resharper.*
*.Resharper
# dotCover
*.dotCover
*.db
*.ipa
.nuget

Двоичные данные
Images/RunningOnLinux.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 28 KiB

59
README.MD Normal file
Просмотреть файл

@ -0,0 +1,59 @@
# Squeaky app for Linux
This is a version of a Fabulous app created from the [Fabulous template](https://fsprojects.github.io/Fabulous/index.html#getting-started). The difference here is this runs on Linux using GTK#.
## How to recreate this
If you want to create this yourself, follow these steps.
### Create the solution
Install the template, and create a new project using:
```sh
dotnet new -i Fabulous.Templates
dotnet new fabulous-app -lang F# -n SqueakyApp
```
Launch the solution file using [MonoDevelop](https://www.monodevelop.com) - I used the [nightly builds](https://www.mono-project.com/download/nightly/#download-lin) as these have better support for the underlying technology used by Fabulous. Then delete the `Android` and `iOS` apps.
### Creating the Linux app
* Right-click on the solution and select _Add -> Add New Project..._. Choose _Other -> .NET -> Gtk# 2.0 project_. Select __F#__ from the drop down, then click __Next__. Give your project a name, such as `SqueakyApp.Gtk`, then click __Create__.
* Add the __Xamarin.Forms__ and __Xamarin.Forms.Platform.GTK__ NuGet packages to this project, and update the Xamarin.Forms package used by the _SqueakyApp_ .NET Standard project to the same version as you have just installed.
* Add a reference to the _SqueakyApp_ .NET Standard project to your new GTK project.
* Open up `Main.fs`, and change the code to match the following:
```fsharp
namespace SqueakyApp.Gtk
module Main =
open System
open Xamarin.Forms
open Xamarin.Forms.Platform.GTK
[<EntryPoint>]
let Main(args) =
Gtk.Application.Init()
Forms.Init()
let app = new SqueakyApp.App()
let window = new FormsWindow()
window.LoadApplication(app)
window.SetApplicationTitle("Hello Fabulous Linux")
window.Show();
Gtk.Application.Run()
0
```
This code will initialize GTK, initialize Xamarin.Forms, then launch the Forms app inside a GTK window.
* Run your app!
![The app running onLinux](./Images/RunOnLinux.png)
You can read more on adding Xamarin.Forms GTK support for Linux on [docs.microsoft.com](https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/gtk/?WT.mc_id=fabulouslinux-github-jabenn).

Просмотреть файл

@ -0,0 +1,20 @@
namespace SqueakyApp.Gtk
open System.Reflection
open System.Runtime.CompilerServices
[<assembly: AssemblyTitle("SqueakyApp.Gtk")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("")>]
[<assembly: AssemblyProduct("")>]
[<assembly: AssemblyCopyright("${AuthorCopyright}")>]
[<assembly: AssemblyTrademark("")>]
// The assembly version has the format {Major}.{Minor}.{Build}.{Revision}
[<assembly: AssemblyVersion("1.0.0.0")>]
//[<assembly: AssemblyDelaySign(false)>]
//[<assembly: AssemblyKeyFile("")>]
()

20
SqueakyApp.Gtk/Main.fs Normal file
Просмотреть файл

@ -0,0 +1,20 @@
namespace SqueakyApp.Gtk
module Main =
open System
open Xamarin.Forms
open Xamarin.Forms.Platform.GTK
[<EntryPoint>]
let Main(args) =
Gtk.Application.Init()
Forms.Init()
let app = new SqueakyApp.App()
let window = new FormsWindow()
window.LoadApplication(app)
window.SetApplicationTitle("Hello Fabulous Linux")
window.Show();
Gtk.Application.Run()
0

Просмотреть файл

@ -0,0 +1,25 @@
<configuration>
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
<!-- XQuartz compatibility (X11 on Mac) -->
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
</configuration>

Просмотреть файл

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C6A6BA94-897C-48B5-8046-3DF33897BA94}</ProjectGuid>
<UseStandardResourceNames>true</UseStandardResourceNames>
<OutputType>WinExe</OutputType>
<RootNamespace>SqueakyApp.Gtk</RootNamespace>
<AssemblyName>SqueakyApp.Gtk</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<PlatformTarget></PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants></DefineConstants>
<ErrorReport>prompt</ErrorReport>
<GenerateTailCalls>true</GenerateTailCalls>
<PlatformTarget></PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0' OR '$(VisualStudioVersion)' == '11.0'">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="gtk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="gdk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="glib-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>glib-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="glade-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="pango-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="atk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="OpenTK">
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.3.1.0.697729\lib\net45\OpenTK.dll</HintPath>
</Reference>
<Reference Include="webkit-sharp">
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.3.1.0.697729\lib\net45\webkit-sharp.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.GTK">
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.3.1.0.697729\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
</Reference>
<Reference Include="FSharp.Core">
<HintPath>..\packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.3.1.0.697729\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.3.1.0.697729\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.3.1.0.697729\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Fabulous.Core">
<HintPath>..\packages\Fabulous.Core.0.20.0\lib\netstandard2.0\Fabulous.Core.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Fabulous.LiveUpdate">
<HintPath>..\packages\Fabulous.LiveUpdate.0.20.0\lib\netstandard2.0\Fabulous.LiveUpdate.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Main.fs" />
<None Include="packages.config" />
<None Include="webkit-sharp.dll.config" />
<None Include="OpenTK.dll.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SqueakyApp\SqueakyApp.fsproj">
<Project>{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}</Project>
<Name>SqueakyApp</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(FSharpTargetsPath)" />
<Import Project="..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.targets')" />
</Project>

Просмотреть файл

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Fabulous.Core" version="0.20.0" targetFramework="net471" />
<package id="Fabulous.LiveUpdate" version="0.20.0" targetFramework="net471" />
<package id="FSharp.Core" version="4.5.2" targetFramework="net451" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net471" />
<package id="Xamarin.Forms" version="3.1.0.697729" targetFramework="net471" />
<package id="Xamarin.Forms.Platform.GTK" version="3.1.0.697729" targetFramework="net451" />
</packages>

Просмотреть файл

@ -0,0 +1,3 @@
<configuration>
<dllmap dll="webkit-1.0" target="/usr/lib/x86_64-linux-gnu/libwebkitgtk-1.0.so"/>
</configuration>

249
SqueakyApp.sln Normal file
Просмотреть файл

@ -0,0 +1,249 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.10
MinimumVisualStudioVersion = 10.0.40219.1
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "SqueakyApp", "SqueakyApp\SqueakyApp.fsproj", "{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}"
EndProject
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "SqueakyApp.Gtk", "SqueakyApp.Gtk\SqueakyApp.Gtk.fsproj", "{C6A6BA94-897C-48B5-8046-3DF33897BA94}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
Ad-Hoc|ARM = Ad-Hoc|ARM
Ad-Hoc|iPhone = Ad-Hoc|iPhone
Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator
Ad-Hoc|x64 = Ad-Hoc|x64
Ad-Hoc|x86 = Ad-Hoc|x86
AppStore|Any CPU = AppStore|Any CPU
AppStore|ARM = AppStore|ARM
AppStore|iPhone = AppStore|iPhone
AppStore|iPhoneSimulator = AppStore|iPhoneSimulator
AppStore|x64 = AppStore|x64
AppStore|x86 = AppStore|x86
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|iPhone = Debug|iPhone
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|iPhone = Release|iPhone
Release|iPhoneSimulator = Release|iPhoneSimulator
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.AppStore|ARM.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.AppStore|ARM.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.AppStore|iPhone.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.AppStore|x64.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.AppStore|x64.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.AppStore|x86.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.AppStore|x86.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Debug|ARM.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Debug|ARM.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Debug|iPhone.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Debug|x64.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Debug|x64.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Debug|x86.ActiveCfg = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Debug|x86.Build.0 = Debug|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Release|Any CPU.Build.0 = Release|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Release|ARM.ActiveCfg = Release|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Release|ARM.Build.0 = Release|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Release|iPhone.ActiveCfg = Release|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Release|iPhone.Build.0 = Release|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Release|x64.ActiveCfg = Release|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Release|x64.Build.0 = Release|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Release|x86.ActiveCfg = Release|Any CPU
{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}.Release|x86.Build.0 = Release|Any CPU
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|Any CPU.ActiveCfg = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|Any CPU.Build.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|Any CPU.Deploy.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|ARM.ActiveCfg = Release|ARM
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|ARM.Build.0 = Release|ARM
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|ARM.Deploy.0 = Release|ARM
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|iPhone.ActiveCfg = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|iPhone.Build.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|iPhone.Deploy.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|x64.ActiveCfg = Release|x64
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|x64.Build.0 = Release|x64
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|x64.Deploy.0 = Release|x64
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|x86.ActiveCfg = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|x86.Build.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Ad-Hoc|x86.Deploy.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|Any CPU.ActiveCfg = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|Any CPU.Build.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|Any CPU.Deploy.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|ARM.ActiveCfg = Release|ARM
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|ARM.Build.0 = Release|ARM
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|ARM.Deploy.0 = Release|ARM
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|iPhone.ActiveCfg = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|iPhone.Build.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|iPhone.Deploy.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|iPhoneSimulator.ActiveCfg = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|iPhoneSimulator.Build.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|iPhoneSimulator.Deploy.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|x64.ActiveCfg = Release|x64
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|x64.Build.0 = Release|x64
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|x64.Deploy.0 = Release|x64
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|x86.ActiveCfg = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|x86.Build.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.AppStore|x86.Deploy.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Debug|Any CPU.ActiveCfg = Debug|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Debug|ARM.ActiveCfg = Debug|ARM
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Debug|ARM.Build.0 = Debug|ARM
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Debug|ARM.Deploy.0 = Debug|ARM
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Debug|iPhone.ActiveCfg = Debug|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Debug|x64.ActiveCfg = Debug|x64
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Debug|x64.Build.0 = Debug|x64
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Debug|x64.Deploy.0 = Debug|x64
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Debug|x86.ActiveCfg = Debug|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Debug|x86.Build.0 = Debug|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Debug|x86.Deploy.0 = Debug|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Release|Any CPU.ActiveCfg = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Release|ARM.ActiveCfg = Release|ARM
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Release|ARM.Build.0 = Release|ARM
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Release|ARM.Deploy.0 = Release|ARM
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Release|iPhone.ActiveCfg = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Release|iPhoneSimulator.ActiveCfg = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Release|x64.ActiveCfg = Release|x64
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Release|x64.Build.0 = Release|x64
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Release|x64.Deploy.0 = Release|x64
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Release|x86.ActiveCfg = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Release|x86.Build.0 = Release|x86
{5665EFEB-0DA4-4F88-B8D5-12B3848593C9}.Release|x86.Deploy.0 = Release|x86
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Ad-Hoc|ARM.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Ad-Hoc|x64.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Ad-Hoc|x86.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.AppStore|Any CPU.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.AppStore|ARM.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.AppStore|ARM.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.AppStore|iPhone.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.AppStore|iPhone.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.AppStore|x64.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.AppStore|x64.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.AppStore|x86.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.AppStore|x86.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Debug|ARM.ActiveCfg = Debug|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Debug|ARM.Build.0 = Debug|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Debug|iPhone.Build.0 = Debug|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Debug|x64.ActiveCfg = Debug|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Debug|x64.Build.0 = Debug|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Debug|x86.ActiveCfg = Debug|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Debug|x86.Build.0 = Debug|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Release|Any CPU.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Release|ARM.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Release|ARM.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Release|iPhone.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Release|iPhone.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Release|x64.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Release|x64.Build.0 = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Release|x86.ActiveCfg = Release|Any CPU
{CAAD35CF-6E2D-41F1-AFD7-072CDC61FBA5}.Release|x86.Build.0 = Release|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.AppStore|ARM.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.AppStore|ARM.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.AppStore|iPhone.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.AppStore|x64.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.AppStore|x64.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.AppStore|x86.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.AppStore|x86.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Debug|ARM.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Debug|ARM.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Debug|iPhone.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Debug|x64.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Debug|x64.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Debug|x86.ActiveCfg = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Debug|x86.Build.0 = Debug|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Release|Any CPU.Build.0 = Release|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Release|ARM.ActiveCfg = Release|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Release|ARM.Build.0 = Release|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Release|iPhone.ActiveCfg = Release|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Release|iPhone.Build.0 = Release|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Release|x64.ActiveCfg = Release|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Release|x64.Build.0 = Release|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Release|x86.ActiveCfg = Release|Any CPU
{C6A6BA94-897C-48B5-8046-3DF33897BA94}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F6D05029-56B8-4E45-AF2D-0E76295DDBA2}
EndGlobalSection
EndGlobal

111
SqueakyApp/SqueakyApp.fs Normal file
Просмотреть файл

@ -0,0 +1,111 @@
// Copyright 2018 Fabulous contributors. See LICENSE.md for license.
namespace SqueakyApp
open System.Diagnostics
open Fabulous.Core
open Fabulous.DynamicViews
open Xamarin.Forms
module App =
type Model =
{ Count : int
Step : int
TimerOn: bool }
type Msg =
| Increment
| Decrement
| Reset
| SetStep of int
| TimerToggled of bool
| TimedTick
let initModel = { Count = 0; Step = 1; TimerOn=false }
let init () = initModel, Cmd.none
let timerCmd =
async { do! Async.Sleep 200
return TimedTick }
|> Cmd.ofAsyncMsg
let update msg model =
match msg with
| Increment -> { model with Count = model.Count + model.Step }, Cmd.none
| Decrement -> { model with Count = model.Count - model.Step }, Cmd.none
| Reset -> init ()
| SetStep n -> { model with Step = n }, Cmd.none
| TimerToggled on -> { model with TimerOn = on }, (if on then timerCmd else Cmd.none)
| TimedTick ->
if model.TimerOn then
{ model with Count = model.Count + model.Step }, timerCmd
else
model, Cmd.none
let view (model: Model) dispatch =
View.ContentPage(
content = View.StackLayout(padding = 20.0, verticalOptions = LayoutOptions.Center,
children = [
View.Label(text = sprintf "%d" model.Count, horizontalOptions = LayoutOptions.Center, fontSize = "Large")
View.Button(text = "Increment", command = (fun () -> dispatch Increment), horizontalOptions = LayoutOptions.Center, fontSize = "Large")
View.Button(text = "Decrement", command = (fun () -> dispatch Decrement), horizontalOptions = LayoutOptions.Center)
View.Label(text = "Timer", horizontalOptions = LayoutOptions.Center)
View.Switch(isToggled = model.TimerOn, toggled = (fun on -> dispatch (TimerToggled on.Value)), horizontalOptions = LayoutOptions.Center)
View.Slider(minimum = 0.0, maximum = 10.0, value = double model.Step, valueChanged = (fun args -> dispatch (SetStep (int (args.NewValue + 0.5)))), horizontalOptions = LayoutOptions.FillAndExpand)
View.Label(text = sprintf "Step size: %d" model.Step, horizontalOptions = LayoutOptions.Center)
View.Button(text = "Reset", horizontalOptions = LayoutOptions.Center, command = (fun () -> dispatch Reset), canExecute = (model <> initModel))
]))
// Note, this declaration is needed if you enable LiveUpdate
let program = Program.mkProgram init update view
type App () as app =
inherit Application ()
let runner =
App.program
#if DEBUG
|> Program.withConsoleTrace
#endif
|> Program.runWithDynamicView app
#if DEBUG
// Uncomment this line to enable live update in debug mode.
// See https://fsprojects.github.io/Fabulous/tools.html for further instructions.
//
do runner.EnableLiveUpdate()
#endif
// Uncomment this code to save the application state to app.Properties using Newtonsoft.Json
// See https://fsprojects.github.io/Fabulous/models.html for further instructions.
#if APPSAVE
let modelId = "model"
override __.OnSleep() =
let json = Newtonsoft.Json.JsonConvert.SerializeObject(runner.CurrentModel)
Console.WriteLine("OnSleep: saving model into app.Properties, json = {0}", json)
app.Properties.[modelId] <- json
override __.OnResume() =
Console.WriteLine "OnResume: checking for model in app.Properties"
try
match app.Properties.TryGetValue modelId with
| true, (:? string as json) ->
Console.WriteLine("OnResume: restoring model from app.Properties, json = {0}", json)
let model = Newtonsoft.Json.JsonConvert.DeserializeObject<App.Model>(json)
Console.WriteLine("OnResume: restoring model from app.Properties, model = {0}", (sprintf "%0A" model))
runner.SetCurrentModel (model, Cmd.none)
| _ -> ()
with ex ->
App.program.onError("Error while restoring model found in app.Properties", ex)
override this.OnStart() =
Console.WriteLine "OnStart: using same logic as OnResume()"
this.OnResume()
#endif

Просмотреть файл

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
</PropertyGroup>
<ItemGroup>
<Compile Include="SqueakyApp.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Essentials" Version="0.6.0-preview" />
<PackageReference Include="Fabulous.Core" Version="0.20.0" />
<PackageReference Include="Fabulous.LiveUpdate" Version="0.20.0" />
<PackageReference Include="FSharp.Core" Version="4.5.2" />
<PackageReference Update="FSharp.Core" Version="4.5.2" /> <!-- workaround for VSMac bug https://github.com/mono/monodevelop/pull/5137 -->
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Xamarin.Forms" Version="3.1.0.697729" />
</ItemGroup>
</Project>