Skip to content

Commit

Permalink
Merge pull request #165 from dansiegel/prism8-releasecandidate
Browse files Browse the repository at this point in the history
Prism 8 - Updates
  • Loading branch information
dansiegel authored Nov 24, 2020
2 parents 43609f2 + a6e57a2 commit f226ee2
Show file tree
Hide file tree
Showing 38 changed files with 162 additions and 169 deletions.
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "3.1.300",
"version": "3.1.404",
"rollForward": "latestMinor",
"allowPrerelease": false
},
Expand Down
2 changes: 1 addition & 1 deletion sample/PrismSample.Android/PrismSample.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1269" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1364" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.3" />
</ItemGroup>
<ItemGroup>
Expand Down
13 changes: 0 additions & 13 deletions sample/PrismSample.Android/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,6 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

// Add some common permissions, these can be removed if not needed
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
2 changes: 1 addition & 1 deletion sample/PrismSample.UWP/PrismSample.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1269" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1364" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.10" />
</ItemGroup>
<ItemGroup>
Expand Down
12 changes: 0 additions & 12 deletions sample/PrismSample.UWP/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,4 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
4 changes: 2 additions & 2 deletions sample/PrismSample.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
using UIKit;
using Shiny;
using PrismSample.Shiny;
using PreserveAttribute = Prism.DryIoc.PreserveAttribute;
using Prism.DryIoc.Internals;

// Force the assembly into the App Domain
// Required for the Sample... this should be brought in automatically for NuGet references
[assembly: Preserve(typeof(PrismContainerExtension))]
[assembly: PrismContainerExtension]
namespace PrismSample.iOS
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
Expand Down
2 changes: 1 addition & 1 deletion sample/PrismSample.iOS/PrismSample.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1269" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1364" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
Expand Down
13 changes: 0 additions & 13 deletions sample/PrismSample.iOS/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,3 @@

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
2 changes: 1 addition & 1 deletion sample/PrismSample/PrismSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="Humanizer.Core" Version="2.8.26" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1269" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1364" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.ComponentModel;
using Prism.Ioc;

namespace Prism.Container.Extensions.Internals
{
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public abstract class ContainerExtensionAttribute : Attribute
{
public IContainerExtension GetContainer()
{
var container = Init();
ContainerLocator.SetContainerExtension(() => container);
return ContainerLocator.Current;
}

protected abstract IContainerExtension Init();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using Prism.Ioc;

namespace Prism.Container.Extensions.Internals
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static class ContainerLocationHelper
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static IContainerExtension LocateContainer(IContainerExtension container = null)
{
if(container != null)
{
ContainerLocator.SetContainerExtension(() => container);
}

var located = ContainerLocator.Current;
if (located != null)
return located;

var entryAssembly = Assembly.GetEntryAssembly();
var containerExtensionAttribute = entryAssembly.GetCustomAttributes().OfType<ContainerExtensionAttribute>().FirstOrDefault();
return containerExtensionAttribute?.GetContainer();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.10" />
<PackageReference Include="Prism.Core" Version="8.0.0.1909" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.ComponentModel;
using Prism.Container.Extensions.Internals;
using Prism.Ioc;

namespace Prism.DryIoc.Internals
{
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public sealed class PrismContainerExtensionAttribute : ContainerExtensionAttribute
{
protected override IContainerExtension Init() => PrismContainerExtension.Init();
}
}
2 changes: 1 addition & 1 deletion src/Prism.DryIoc.Extensions/Prism.DryIoc.Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="DryIoc.dll" Version="4.3.3" />
<PackageReference Include="DryIoc.dll" Version="4.5.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Prism.DryIoc;
using Prism.DryIoc.Internals;

// Force the assembly into the App Domain
[assembly: Preserve(typeof(global::Prism.DryIoc.PrismContainerExtension))]
[assembly: Preserve(typeof(global::DryIoc.Container))]
[assembly: PrismContainerExtension]
2 changes: 1 addition & 1 deletion src/Prism.Forms.Extended/Prism.Forms.Extended.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Prism.Forms" Version="8.0.0.1850-pre" />
<PackageReference Include="Prism.Forms" Version="8.0.0.1909" />
<PackageReference Include="Prism.Plugin.Logging.Abstractions" Version="8.0.11-beta" />
</ItemGroup>

Expand Down
4 changes: 3 additions & 1 deletion src/Prism.Forms.Extended/PrismApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Runtime.Serialization.Json;
using System.Text;
using System.Threading.Tasks;
using Prism.Container.Extensions.Internals;
using Prism.Events;
using Prism.Forms.Extended.ViewModels;
using Prism.Ioc;
Expand Down Expand Up @@ -44,7 +45,8 @@ protected override void RegisterRequiredTypes(IContainerRegistry containerRegist

protected override IContainerExtension CreateContainerExtension()
{
return ContainerLocator.Current ?? throw new NullReferenceException("Call PrismContainerExtension.Init() prior to initializing PrismApplication");
return ContainerLocationHelper.LocateContainer() ??
throw new NullReferenceException("Call PrismContainerExtension.Init() prior to initializing PrismApplication");
}

protected sealed override void InitializeModules()
Expand Down
15 changes: 12 additions & 3 deletions src/Prism.Forms.Extended/ViewModels/DefaultViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
using Prism.AppModel;
using Prism.Mvvm;
using Prism.Mvvm;
using Prism.Navigation;

namespace Prism.Forms.Extended.ViewModels
{
internal class DefaultViewModel : BindableBase, IAutoInitialize
internal class DefaultViewModel : BindableBase, IInitialize
{
private string _title;
public string Title
{
get => _title;
set => SetProperty(ref _title, value);
}

public void Initialize(INavigationParameters parameters)
{
if(parameters.TryGetValue("Title", out string title) ||
parameters.TryGetValue("title", out title))
{
Title = title;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.ComponentModel;
using Prism.Container.Extensions.Internals;
using Prism.Ioc;

namespace Prism.Microsoft.DependencyInjection.Internals
{
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public sealed class PrismContainerExtensionAttribute : ContainerExtensionAttribute
{
protected override IContainerExtension Init() => PrismContainerExtension.Init();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.10" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Prism.Microsoft.DependencyInjection;
using Prism.Microsoft.DependencyInjection.Internals;

// Force the assembly into the App Domain
[assembly: Preserve(typeof(global::Prism.Microsoft.DependencyInjection.PrismContainerExtension))]
[assembly: Preserve(typeof(global::Microsoft.Extensions.DependencyInjection.ServiceCollection))]
[assembly: Preserve(typeof(global::Microsoft.Extensions.DependencyInjection.ServiceProvider))]
[assembly: PrismContainerExtension]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.ComponentModel;
using Prism.Container.Extensions.Internals;
using Prism.Ioc;

namespace Prism.Unity.Internals
{
[EditorBrowsable(EditorBrowsableState.Never)]
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public sealed class PrismContainerExtensionAttribute : ContainerExtensionAttribute
{
protected override IContainerExtension Init() => PrismContainerExtension.Init();
}
}
2 changes: 1 addition & 1 deletion src/Prism.Unity.Extensions/Prism.Unity.Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Unity.Container" Version="5.11.8" />
<PackageReference Include="Unity.Container" Version="5.11.10" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Prism.Unity;
using Prism.Unity.Internals;

// Force the assembly into the App Domain
[assembly: Preserve(typeof(global::Prism.Unity.PrismContainerExtension))]
[assembly: Preserve(typeof(global::Unity.UnityContainer))]
[assembly: PrismContainerExtension]
52 changes: 0 additions & 52 deletions src/Shiny.Prism/Modularity/IContainerRegistryAutoLoadExtensions.cs

This file was deleted.

1 change: 0 additions & 1 deletion src/Shiny.Prism/Modularity/ShinyPrismModuleInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public void Initialize(IModuleInfo moduleInfo)
if (module != null)
{
module.RegisterTypes(_container);
module.GetType().AutoRegisterViews(_container);
module.OnInitialized(_container);
}
}
Expand Down
Loading

0 comments on commit f226ee2

Please sign in to comment.