Skip to content

Commit

Permalink
prism 8 api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Nov 24, 2020
1 parent 186bf75 commit 676dfa3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 72 deletions.
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;
}
}
}
}
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
11 changes: 5 additions & 6 deletions tests/Prism.Forms.Extended.Mocks/Mocks/AppMock.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Prism.Forms.Extended.Mocks.Views;
using Prism.Ioc;
using Prism.Navigation;
using Xamarin.Forms;
Expand All @@ -11,7 +7,6 @@
namespace Prism.Forms.Extended.Mocks
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[AutoRegisterForNavigation]
public partial class AppMock : PrismApplication
{
public AppMock()
Expand All @@ -30,6 +25,10 @@ protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterForNavigation<TabbedPage>();
containerRegistry.RegisterForNavigation<NavigationPage>();
containerRegistry.RegisterForNavigation<ViewA>();
containerRegistry.RegisterForNavigation<ViewB>();
containerRegistry.RegisterForNavigation<ViewC>();
containerRegistry.RegisterForNavigation<ViewD>();
}
}
}
10 changes: 0 additions & 10 deletions tests/Shiny.Prism.Tests/Tests/ModularityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Shiny.Prism.Mocks;
using Shiny.Prism.Mocks.Modularity;
using Shiny.Prism.Mocks.Modularity.Services;
using Shiny.Prism.Modularity;
using Xunit;
using Xunit.Abstractions;

Expand Down Expand Up @@ -34,14 +33,5 @@ public void StartupModuleServicesAreNotRegisteredFromContainerRegistry()

Assert.False(((IContainerProvider)PrismContainerExtension.Current).IsRegistered<IMockModuleServiceB>());
}

[Fact]
public void GetNavigationSegmentNameInvokesInternalMethod()
{
var currentType = GetType();
var segmentName = IContainerRegistryAutoLoadExtensions.GetNavigationSegmentName(currentType);

Assert.Equal(currentType.Name, segmentName);
}
}
}

0 comments on commit 676dfa3

Please sign in to comment.