Skip to content

Commit

Permalink
Merge pull request #226 from mallibone/UpdateXamarinForms
Browse files Browse the repository at this point in the history
Update Xamarin Forms to 3.6.0.264807
  • Loading branch information
praeclarum authored Mar 22, 2019
2 parents 95b0dbd + f6e889c commit 06431b2
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 13 deletions.
6 changes: 6 additions & 0 deletions Ooui.Forms/Forms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ protected override void EnableTimer ()
public void QuitApplication()
{
}

public SizeRequest GetNativeSize(VisualElement view, double widthConstraint, double heightConstraint)
{
var renderer = Ooui.Forms.Platform.GetRenderer(view);
return renderer.GetDesiredSize(widthConstraint, heightConstraint);
}
}

public class ViewInitializedEventArgs
Expand Down
4 changes: 2 additions & 2 deletions Ooui.Forms/Ooui.Forms.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.0.0</Version>
Expand All @@ -18,7 +18,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.0.0.482510" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.264807" />
</ItemGroup>
<ItemGroup>
<Folder Include="Extensions\" />
Expand Down
20 changes: 17 additions & 3 deletions Ooui.Forms/Platform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

namespace Ooui.Forms
{
public class Platform : BindableObject, IPlatform, INavigation, IDisposable
public class Platform : BindableObject, INavigation, IDisposable
#pragma warning disable CS0618 // Type or member is obsolete
, IPlatform
#pragma warning restore CS0618 // Type or member is obsolete
{
bool _disposed;

Expand Down Expand Up @@ -99,7 +102,7 @@ protected override void OnBindingContextChanged ()
base.OnBindingContextChanged ();
}

public SizeRequest GetNativeSize (VisualElement view, double widthConstraint, double heightConstraint)
public static SizeRequest GetNativeSize (VisualElement view, double widthConstraint, double heightConstraint)
{
var renderView = GetRenderer (view);
if (renderView == null || renderView.NativeView == null)
Expand All @@ -116,8 +119,12 @@ public void SetPage (Page newRoot)
throw new NotImplementedException ();
Page = newRoot;

#pragma warning disable CS0618 // Type or member is obsolete
// The Platform property is no longer necessary, but we have to set it because some third-party
// library might still be retrieving it and using it
Page.Platform = this;
AddChild (Page);
#pragma warning restore CS0618 // Type or member is obsolete
AddChild(Page);

Page.DescendantRemoved += HandleChildRemoved;

Expand Down Expand Up @@ -232,5 +239,12 @@ void INavigation.RemovePage (Page page)
{
throw new NotImplementedException ();
}

#region obsolete
SizeRequest IPlatform.GetNativeSize (VisualElement view, double widthConstraint, double heightConstraint)
{
return GetNativeSize(view, widthConstraint, heightConstraint);
}
#endregion
}
}
8 changes: 6 additions & 2 deletions Ooui.Forms/Renderers/NavigationPageRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Net;
using System.Text;
using Xamarin.Forms;
using Xamarin.Forms.Internals;
using System.Linq;
Expand Down Expand Up @@ -161,18 +159,24 @@ private void OnChildrenChanged(object sender, NotifyCollectionChangedEventArgs e

private void OnPopToRootRequested(object sender, NavigationRequestedEventArgs e)
{
#pragma warning disable CS0618 // Type or member is obsolete
e.Realize = true;
#pragma warning restore CS0618 // Type or member is obsolete
}

private void OnPopRequested(object sender, NavigationRequestedEventArgs e)
{
#pragma warning disable CS0618 // Type or member is obsolete
e.Realize = true;
#pragma warning restore CS0618 // Type or member is obsolete
}

// This is where you would draw the new contents.
private void OnPushRequested(object sender, NavigationRequestedEventArgs e)
{
#pragma warning disable CS0618 // Type or member is obsolete
e.Realize = true;
#pragma warning restore CS0618 // Type or member is obsolete
}

private string GenerateFullHash()
Expand Down
4 changes: 2 additions & 2 deletions PlatformSamples/AspNetCoreMvc/AspNetCoreMvc.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
Expand All @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
<PackageReference Include="Xamarin.Forms" Version="3.0.0.482510" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.264807" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void Main (string[] args)
sample.Publish();
}

var samplePage = new SamplePickerSample(samples);
var samplePage = new SamplePicker(samples);
samplePage.Publish();

UI.Present (samplePage.Path);
Expand Down
4 changes: 2 additions & 2 deletions Samples/SamplePickerSample.cs → Samples/SamplePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

namespace Samples
{
public class SamplePickerSample : ISample
public class SamplePicker : ISample
{
private readonly IEnumerable<ISample> _samplePages;

public SamplePickerSample(IEnumerable<ISample> samplePages)
public SamplePicker(IEnumerable<ISample> samplePages)
{
_samplePages = samplePages.OrderBy(s => s.Title);
}
Expand Down
2 changes: 1 addition & 1 deletion Samples/Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.0.0.482510" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.264807" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 06431b2

Please sign in to comment.