Skip to content

Commit

Permalink
Merge pull request #842 from TimLariviere/xf-5.0-initial
Browse files Browse the repository at this point in the history
Initial support for Xamarin.Forms 5.0
  • Loading branch information
TimLariviere committed Jan 15, 2021
2 parents 832a41c + 5f050e1 commit a01b89f
Show file tree
Hide file tree
Showing 34 changed files with 258 additions and 597 deletions.
17 changes: 4 additions & 13 deletions Directory.Build.props
@@ -1,20 +1,11 @@
<Project>
<!-- NuGet Specs -->
<PropertyGroup>
<Version>0.60.0</Version>
<Version>0.61.0</Version>
<Authors>Fabulous Contributors</Authors>
<PackageVersion>0.60.0</PackageVersion>
<PackageReleaseNotes>BREAKING CHANGES: Please read the migration guide to know how to update to this new version (https://fsprojects.github.io/Fabulous/Fabulous.XamarinForms/migration-guide-to-0.60.html)
Also take a look here to learn more about F# 5.0 and Fabulous (https://fsprojects.github.io/Fabulous/Fabulous.XamarinForms/pitfalls.html)
[All] Reduced allocations (https://github.com/fsprojects/Fabulous/pull/805)
[All] Proper version constraints for the NuGet packages (https://github.com/fsprojects/Fabulous/pull/797)
[All] Add FSharp.Core as a public dependency (https://github.com/fsprojects/Fabulous/pull/796)
[Fabulous.XamarinForms] Fixed ViewRef to be updated each time the target control changes (https://github.com/fsprojects/Fabulous/pull/812)
[Fabulous.XamarinForms] CollectionView Header and Footer properties accept ViewElement and string values (https://github.com/fsprojects/Fabulous/pull/817/files)
[Fabulous.XamarinForms] [Templates] Add native main menu to MacOS template (https://github.com/fsprojects/Fabulous/pull/806)
[Fabulous.XamarinForms] [Templates] Updated templates to target Android 11 by default (https://github.com/fsprojects/Fabulous/pull/814)
[Fabulous.XamarinForms] [Templates] Fixed fabulous-cli version referenced in templates (https://github.com/fsprojects/Fabulous/pull/814)
[Fabulous.XamarinForms] [Templates] Added native main menu to macOS template (https://github.com/fsprojects/Fabulous/pull/806)</PackageReleaseNotes>
<PackageVersion>0.61.0-preview1</PackageVersion>
<PackageReleaseNotes>[Fabulous.XamarinForms] Add initial support for Xamarin.Forms (new features not included)
[Fabulous.XamarinForms] Changed diffing of Label.Text and Label.FormattedText to avoid crash in some edge cases</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/fsprojects/Fabulous</PackageProjectUrl>
Expand Down
Expand Up @@ -76,6 +76,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.macOS">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.macOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down
Expand Up @@ -13,8 +13,6 @@
<Compile Include="Samples\TestLabel.fs" />
<Compile Include="Samples\Controls\CarouselView.fs" />
<Compile Include="Samples\Controls\CollectionView.fs" />
<Compile Include="Samples\Controls\Expander.fs" />
<Compile Include="Samples\Controls\MediaElement.fs" />
<Compile Include="Samples\Controls\RefreshView.fs" />
<Compile Include="Samples\Controls\RadioButton.fs" />
<Compile Include="Samples\Controls\ScrollView.fs" />
Expand Down

This file was deleted.

This file was deleted.

Expand Up @@ -56,19 +56,19 @@ module RadioButton =
| Some mode -> sprintf "You selected: %A" mode
)
View.RadioButton(
text = "Car",
content = "Car",
checkedChanged = onTransportModeChecked Car
)
View.RadioButton(
text = "Bike",
content = "Bike",
checkedChanged = onTransportModeChecked Bike
)
View.RadioButton(
text = "Train",
content = "Train",
checkedChanged = onTransportModeChecked Train
)
View.RadioButton(
text = "Walking",
content = "Walking",
checkedChanged = onTransportModeChecked Walking
)

Expand All @@ -83,19 +83,19 @@ module RadioButton =
| Some mode -> sprintf "You selected: %A" mode
)
View.RadioButton(
text = "Cat",
content = "Cat",
groupName = "Pet",
isChecked = (model.PetKind = Some Cat),
checkedChanged = onPetKindChecked Cat
)
View.RadioButton(
text = "Dog",
content = "Dog",
groupName = "Pet",
isChecked = (model.PetKind = Some Dog),
checkedChanged = onPetKindChecked Dog
)
View.RadioButton(
text = "I don't have pets",
content = "I don't have pets",
groupName = "Pet",
isChecked = (model.PetKind = Some NoPet),
checkedChanged = onPetKindChecked NoPet
Expand Down
Expand Up @@ -6,33 +6,27 @@ open Xamarin.Forms

module MasterDetailPage =
type Msg =
| IsMasterPresentedChanged of bool
| SetDetailPage of string

type CmdMsg = Nothing

type Model =
{ IsMasterPresented: bool
DetailPage: string }
{ DetailPage: string }

let mapToCmd _ = Cmd.none

let init () =
{ IsMasterPresented = false
DetailPage = "A" }
{ DetailPage = "A" }

let update msg model =
match msg with
| IsMasterPresentedChanged b -> { model with IsMasterPresented = b }, []
| SetDetailPage s -> { model with DetailPage = s ; IsMasterPresented = false }, []
| SetDetailPage s -> { model with DetailPage = s }, []

let view model dispatch =
// MasterDetail where the Master acts as a hamburger-style menu
dependsOn (model.DetailPage, model.IsMasterPresented) (fun model (detailPage, isMasterPresented) ->
dependsOn (model.DetailPage) (fun model (detailPage) ->
View.MasterDetailPage(
masterBehavior = MasterBehavior.Popover,
isPresented = isMasterPresented,
isPresentedChanged = (fun b -> dispatch (IsMasterPresentedChanged b)),
master = View.ContentPage(
useSafeArea = true,
title = "Master",
Expand Down Expand Up @@ -71,8 +65,7 @@ module MasterDetailPage =
)
).HasNavigationBar(true)
.HasBackButton(true)
],
poppedToRoot = fun _ -> dispatch (IsMasterPresentedChanged true)
]
)
)
)
Expand Down
Expand Up @@ -46,13 +46,6 @@ module Samples =
Nodes =
[ Sample (createViewOnlyDefinition "CarouselView" Controls.CarouselView.view)
Sample (createViewOnlyDefinition "CollectionView" Controls.CollectionView.view)
Sample
({ Title = "Expander"
Init = Controls.Expander.init |> ignoreCmdMsgs
Update = Controls.Expander.update |> ignoreMsgAndExternalMsg
View = Controls.Expander.view
MapToCmd = ignoreMapToCmd } |> boxSampleDefinition)
Sample (createViewOnlyDefinition "MediaElement" Controls.MediaElement.view)
Sample
({ Title = "RadioButton"
Init = Controls.RadioButton.init |> ignoreCmdMsgs
Expand Down
Expand Up @@ -96,6 +96,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down
Expand Up @@ -76,6 +76,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.macOS">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.macOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down
Expand Up @@ -114,6 +114,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down
Expand Up @@ -76,6 +76,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.macOS">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.macOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down
Expand Up @@ -114,6 +114,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down
Expand Up @@ -76,6 +76,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.macOS">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.macOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down
Expand Up @@ -128,6 +128,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down
Expand Up @@ -126,6 +126,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down
Expand Up @@ -73,6 +73,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.macOS">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.macOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down
Expand Up @@ -127,6 +127,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down
Expand Up @@ -73,6 +73,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.macOS">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.macOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down
Expand Up @@ -142,6 +142,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>..\..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\..\packages\iosapp\Xamarin.Forms\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down
Expand Up @@ -78,6 +78,9 @@
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.macOS">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Platform.macOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\..\packages\macosapp\Xamarin.Forms\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
Expand Down

0 comments on commit a01b89f

Please sign in to comment.