Created
November 12, 2015 03:48
-
-
Save adamped/3eaf3da9612817e29bfa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Definition.Interfaces; | |
using Mobile.ViewModel; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Xamarin.Forms; | |
namespace Mobile.View | |
{ | |
public partial class BasePage : ContentPage, ICleanupPage | |
{ | |
public Guid PageInstanceId { get; set; } | |
public BasePage() | |
{ | |
InitializeComponent(); | |
PageInstanceId = Guid.NewGuid(); | |
} | |
protected override void OnAppearing() | |
{ | |
base.OnAppearing(); | |
var bindingContext = BindingContext as BaseViewModel; | |
if (bindingContext != null) | |
bindingContext.OnAppearing(); | |
} | |
protected override void OnDisappearing() | |
{ | |
base.OnDisappearing(); | |
var bindingContext = BindingContext as BaseViewModel; | |
if (bindingContext != null) | |
bindingContext.OnDisappearing(); | |
} | |
public virtual void Cleanup() { } | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment