protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            DataContext = vm = new Vidyano.ViewModel.Pages.SignInPage(this);
            await vm.Connect();

            base.OnNavigatedTo(e);
        }
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            if (!Service.Current.IsConnected)
                e.Cancel = true;
            else if (vm != null)
            {
                vm.Dispose();
                vm = null;
            }

            base.OnNavigatingFrom(e);
        }
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            DataContext = vm = new Vidyano.ViewModel.Pages.SignInPage(this);

            // For App consistency, clear the entire page stack
            while (Client.RootFrame.RemoveBackEntry() != null) { ; /* do nothing */ }

            if (PhoneApplicationFrameEx.NavigatePendingStateRestore())
                return;

            if (!Service.Current.IsConnected)
                await vm.Connect();
            else
                await vm.RedirectToHomePage();

            base.OnNavigatedTo(e);
        }