예제 #1
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (Service.Current.IsConnected)
            {
                DataContext = vm = new Vidyano.ViewModel.Pages.HomePage(this);
                await vm.Initialize(e.NavigationMode == NavigationMode.Back);
            }
        }
예제 #2
0
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            if (e.NavigationMode == NavigationMode.Back && Service.Current.IsConnected && e.SourcePageType == typeof(SignInPage))
                e.Cancel = true;
            else if (vm != null)
            {
                vm.Dispose();
                vm = null;
            }

            base.OnNavigatingFrom(e);
        }
예제 #3
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            if (PhoneApplicationFrameEx.NavigatePendingStateRestore())
                return;

            if (Service.Current.IsConnected)
            {
                DataContext = vm = new Vidyano.ViewModel.Pages.HomePage(this);

                await vm.Initialize(e.NavigationMode == NavigationMode.Back);
            }

            base.OnNavigatedTo(e);
        }
예제 #4
0
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            if (e.NavigationMode == NavigationMode.Back && Service.Current.IsConnected && e.Uri.OriginalString.Contains("SignInPage.xaml"))
            {
                Client.CurrentClient.SuspendCache();
                Client.CurrentClient.Terminate();
            }
            else if (vm != null)
            {
                vm.Dispose();
                vm = null;
            }

            base.OnNavigatingFrom(e);
        }