Skip to content

Commit

Permalink
Merge pull request #485 from bryanbcook/extend-xforms-pagenavigation
Browse files Browse the repository at this point in the history
Update Xamarin.Forms NavigationPageAdapter
  • Loading branch information
nigel-sampson committed Oct 23, 2017
2 parents e46151d + 51d76f0 commit 526a6c8
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/Caliburn.Micro.Platform/xforms/NavigationPageAdapter.cs
@@ -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

0 comments on commit 526a6c8

Please sign in to comment.