Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Xamarin.Forms NavigationPageAdapter #485

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/Caliburn.Micro.Platform/xforms/NavigationPageAdapter.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Reflection;

namespace Caliburn.Micro.Xamarin.Forms {
namespace Caliburn.Micro.Xamarin.Forms {

using System;
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using global::Xamarin.Forms;

Expand Down Expand Up @@ -74,13 +73,21 @@ protected virtual ContentPage CreateContentPage(ContentView view, object viewMod
return page;
}

private static void DeactivateView(BindableObject view)
/// <summary>
/// Apply logic to deactivate the active view when it is popped off the navigation stack
/// </summary>
/// <param name="view">the previously active view</param>
protected virtual void DeactivateView(BindableObject view)
{
var deactivate = view?.BindingContext as IDeactivate;
deactivate?.Deactivate(false);
}

private static void ActivateView(BindableObject view)
/// <summary>
/// Apply logic to activate a view when it is popped onto the navigation stack
/// </summary>
/// <param name="view">the view to activate</param>
protected virtual void ActivateView(BindableObject view)
{
var activate = view?.BindingContext as IActivate;
activate?.Activate();
Expand Down