Skip to content

Commit

Permalink
Merge pull request #1730 from PrismLibrary/forms36
Browse files Browse the repository at this point in the history
Updates for Forms & DryIoc
  • Loading branch information
dansiegel committed Mar 10, 2019
2 parents 5111104 + 6e1aa89 commit c0d9ed6
Show file tree
Hide file tree
Showing 20 changed files with 5,748 additions and 3,183 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
Expand Down Expand Up @@ -48,12 +48,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.5.0.129452" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.220655" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.1" />
</ItemGroup>
<ItemGroup>
<Compile Include="AndroidInitializer.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.HelloWorld">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="27" />
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
<application android:label="HelloWorld.Android"></application>
</manifest>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.5.0.129452" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.7" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.220655" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.9" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\Source\Prism\Prism.csproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.5.0.129452" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.220655" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.5.0.129452" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.220655" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Sandbox/Xamarin/HelloWorld/ModuleA/ModuleA.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.5.0.129452" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.220655" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 1 addition & 6 deletions Source/Prism/Prism.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="MSBuild.Sdk.Extras">

<PropertyGroup>
<TargetFrameworks>netstandard1.0;netstandard2.0;netcoreapp3.0;net45;uap10.0.15063;uap10.0.16299</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard1.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net45;uap10.0.15063;uap10.0.16299</TargetFrameworks>
<AssemblyName>Prism</AssemblyName>
<PackageId>Prism.Core</PackageId>
<DebugType>pdbonly</DebugType>
Expand All @@ -17,10 +16,6 @@
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Condition=" '$(TargetFramework)' == 'netstandard1.0' " Include="System.Resources.ResourceManager" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.0' Or $(TargetFramework.StartsWith('uap10.0')) ">
<Compile Remove="**\*.Desktop.cs" />
<None Include="**\*.Desktop.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="DryIoc.dll" Version="3.0.2" />
<PackageReference Include="DryIoc.dll" Version="4.0.0" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.9" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DryIoc.dll" Version="3.0.2" />
<PackageReference Include="DryIoc.dll" Version="4.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
Expand Down
2 changes: 1 addition & 1 deletion Source/Wpf/Prism.DryIoc.Wpf/Prism.DryIoc.Wpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DryIoc.dll" Version="3.0.2" />
<PackageReference Include="DryIoc.dll" Version="4.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Xamarin.Forms" Version="3.5.0.169047" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.220655" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
Expand Down
4 changes: 2 additions & 2 deletions Source/Xamarin/Prism.DryIoc.Forms/Prism.DryIoc.Forms.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="MSBuild.Sdk.Extras">

<PropertyGroup>
<TargetFrameworks>netstandard1.0;netstandard2.0;MonoAndroid80</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<Title>DryIoc for Prism for Xamarin.Forms</Title>
<!-- Summary is not actually supported at this time. Including the summary for future support. -->
<!--<Summary>DryIoc extensions for Prism for Xamarin.Forms.</Summary>-->
Expand All @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DryIoc.dll" Version="3.0.2" />
<PackageReference Include="DryIoc.dll" Version="4.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
25 changes: 0 additions & 25 deletions Source/Xamarin/Prism.DryIoc.Forms/PrismApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,6 @@ protected override IContainerExtension CreateContainerExtension()
return new DryIocContainerExtension(new Container(CreateContainerRules()));
}

#if __ANDROID__
/// <summary>
/// Sets the <see cref="DependencyResolver" /> to use the App Container for resolving types
/// </summary>
protected override void SetDependencyResolver(IContainerProvider containerProvider)
{
base.SetDependencyResolver(containerProvider);
DependencyResolver.ResolveUsing((Type type, object[] dependencies) =>
{
var container = containerProvider.GetContainer();
foreach(var dependency in dependencies)
{
if(dependency is Android.Content.Context context)
{
var resolver = container.Resolve<Func<Android.Content.Context, object>>(type);
return resolver.Invoke(context);
}
}
container.Resolve<ILoggerFacade>().Log($"Could not locate an Android.Content.Context to resolve {type.Name}", Category.Warn, Priority.High);
return container.Resolve(type);
});
}
#endif

/// <summary>
/// Create <see cref="Rules" /> to alter behavior of <see cref="IContainer" />
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Source/Xamarin/Prism.Forms.Tests/Prism.Forms.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Xamarin.Forms" Version="3.5.0.169047" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.220655" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
Expand Down
4 changes: 2 additions & 2 deletions Source/Xamarin/Prism.Forms/Prism.Forms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<RootNamespace>Prism</RootNamespace>
<TargetFrameworks>netstandard1.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;MonoAndroid81</TargetFrameworks>
<Title>Prism for Xamarin.Forms</Title>
<!-- Summary is not actually supported at this time. Including the summary for future support. -->
<!--<Summary>Prism for Xamarin.Forms helps you more easily design and build rich, flexible, and easy to maintain Xamarin.Forms applications.</Summary>-->
Expand All @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.5.0.169047" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.220655" />
</ItemGroup>

<ItemGroup>
Expand Down
19 changes: 18 additions & 1 deletion Source/Xamarin/Prism.Forms/PrismApplicationBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ protected virtual void ConfigureViewModelLocator()
});
}


protected INavigationService CreateNavigationService(Page page)
{
var navService = Container.Resolve<INavigationService>(NavigationServiceName);
Expand Down Expand Up @@ -145,8 +146,24 @@ public virtual void Initialize()
/// <summary>
/// Sets the <see cref="DependencyResolver" /> to use the App Container for resolving types
/// </summary>
protected virtual void SetDependencyResolver(IContainerProvider containerProvider) =>
protected virtual void SetDependencyResolver(IContainerProvider containerProvider)
{
DependencyResolver.ResolveUsing(type => containerProvider.Resolve(type));
#if __ANDROID__
DependencyResolver.ResolveUsing((Type type, object[] dependencies) =>
{
foreach(var dependency in dependencies)
{
if(dependency is Android.Content.Context context)
{
return containerProvider.Resolve(type, (typeof(Android.Content.Context), context));
}
}
containerProvider.Resolve<ILoggerFacade>().Log($"Could not locate an Android.Content.Context to resolve {type.Name}", Category.Warn, Priority.High);
return containerProvider.Resolve(type);
});
#endif
}


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Xamarin.Forms" Version="3.5.0.169047" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.220655" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
Expand Down
2 changes: 1 addition & 1 deletion Source/Xamarin/Prism.Unity.Forms/Prism.Unity.Forms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="MSBuild.Sdk.Extras">

<PropertyGroup>
<TargetFrameworks>netstandard1.0;netstandard2.0;MonoAndroid80</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<Title>Unity for Prism for Xamarin.Forms</Title>
<!-- Summary is not actually supported at this time. Including the summary for future support. -->
<!--<Summary>Unity extensions for Prism for Xamarin.Forms.</Summary>-->
Expand Down
30 changes: 0 additions & 30 deletions Source/Xamarin/Prism.Unity.Forms/PrismApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,36 +39,6 @@ protected PrismApplication(IPlatformInitializer platformInitializer)
protected PrismApplication(IPlatformInitializer platformInitializer, bool setFormsDependencyResolver)
: base(platformInitializer, setFormsDependencyResolver) { }

#if __ANDROID__
/// <summary>
/// Sets the <see cref="DependencyResolver" /> to use the App Container for resolving types
/// </summary>
protected override void SetDependencyResolver(IContainerProvider containerProvider)
{
base.SetDependencyResolver(containerProvider);
DependencyResolver.ResolveUsing((Type type, object[] dependencies) =>
{
var container = containerProvider.GetContainer();
List<ResolverOverride> overrides = new List<ResolverOverride>();
foreach(var dependency in dependencies)
{
if (dependency is Android.Content.Context context)
{
overrides.Add(new DependencyOverride(typeof(Android.Content.Context), context));
}
else
{
container.Resolve<ILoggerFacade>().Log($"Resolving an unknown type {dependency.GetType().Name}", Category.Warn, Priority.High);
overrides.Add(new DependencyOverride(dependency.GetType(), dependency));
}
}
return container.Resolve(type, overrides.ToArray());
});
}
#endif

protected override IContainerExtension CreateContainerExtension()
{
return new UnityContainerExtension(new UnityContainer());
Expand Down

0 comments on commit c0d9ed6

Please sign in to comment.