diff --git a/MvvmNavigation.Core/Messages/PleadTheFifthMessage.cs b/MvvmNavigation.Core/Messages/PleadTheFifthMessage.cs new file mode 100644 index 0000000..3adceea --- /dev/null +++ b/MvvmNavigation.Core/Messages/PleadTheFifthMessage.cs @@ -0,0 +1,10 @@ +using BuildIt.Navigation.Messages; + +namespace MvvmNavigation.Messages +{ + public class PleadTheFifthMessage : CompletedMessage + { + public PleadTheFifthMessage() : base() { } + public PleadTheFifthMessage(object sender) : base(sender) { } + } +} diff --git a/MvvmNavigation.Core/MvvmApplicationServices.cs b/MvvmNavigation.Core/MvvmApplicationServices.cs index 0970b54..b4f6c03 100644 --- a/MvvmNavigation.Core/MvvmApplicationServices.cs +++ b/MvvmNavigation.Core/MvvmApplicationServices.cs @@ -31,6 +31,7 @@ protected override void InitializeApplicationServices(IServiceCollection service serviceRegistrations.AddSingleton(sp => { var routes = new NavigationMessageRoutes() + .RegisterNavigate() .RegisterNavigate() .Register>((vm, msg, nav) => { @@ -56,10 +57,6 @@ protected override void InitializeApplicationServices(IServiceCollection service return routes; }); - //serviceRegistrations.AddTransient(); - //serviceRegistrations.AddTransient(); - //serviceRegistrations.AddTransient(); - //serviceRegistrations.AddTransient(); RegisterServices(serviceRegistrations); } diff --git a/MvvmNavigation.Core/ViewModels/FifthViewModel.cs b/MvvmNavigation.Core/ViewModels/FifthViewModel.cs new file mode 100644 index 0000000..e849b5e --- /dev/null +++ b/MvvmNavigation.Core/ViewModels/FifthViewModel.cs @@ -0,0 +1,20 @@ +using BuildIt.Navigation; +using BuildIt.Navigation.Messages; +using System; + +namespace MvvmNavigation.ViewModels +{ + [Register] + public class FifthViewModel + { + [EventMessage(typeof(CloseMessage))] + public event EventHandler FifthDone; + + public string Title => "Page 5"; + + public void RaiseFifthDone() + { + FifthDone?.Invoke(this, EventArgs.Empty); + } + } +} diff --git a/MvvmNavigation/MvvmNavigation.Shared/FifthPage.xaml b/MvvmNavigation/MvvmNavigation.Shared/FifthPage.xaml new file mode 100644 index 0000000..4254b8c --- /dev/null +++ b/MvvmNavigation/MvvmNavigation.Shared/FifthPage.xaml @@ -0,0 +1,15 @@ + + + + + + diff --git a/MvvmNavigation/MvvmNavigation.Shared/MvvmNavigation.Shared.projitems b/MvvmNavigation/MvvmNavigation.Shared/MvvmNavigation.Shared.projitems index a0948db..23fb1f4 100644 --- a/MvvmNavigation/MvvmNavigation.Shared/MvvmNavigation.Shared.projitems +++ b/MvvmNavigation/MvvmNavigation.Shared/MvvmNavigation.Shared.projitems @@ -18,6 +18,9 @@ App.xaml + + FifthPage.xaml + FourthPage.xaml @@ -29,6 +32,10 @@ + + Designer + MSBuild:Compile + Designer MSBuild:Compile