TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Achraf Ben Alaya
NA
134
4.2k
Xamarin navigation (current page)
Oct 18 2018 8:58 AM
I'm developing an application using xamarin forms , I have to check the connectivity , i'm using the connectivity plugin .
So , what I want , if there is no connection , I want to go to no navigation page , and after the navigation is back , I want to go back to the page where I was .
What I was able to do is , to go back to the main page of the application , doing this on my App.xaml.cs .
Is there any way I can go back to the page where Exactly I was ?!
public App()
{
InitializeComp*onent();
if (Device.Idiom == TargetIdiom.Tablet || Device.Idiom == TargetIdiom.Desktop)
MainPage = CrossConnectivity.Current.IsConnected ? (Page)new NavigationPage(new ClientPagetablet()) : new NoNetworkPage();
else
MainPage = CrossConnectivity.Current.IsConnected ? (Page)new NavigationPage(new ClientPage()) : new NoNetworkPage();
}
private void HandleConnectivityChanged(object sender, ConnectivityChangedEventArgs e)
{
Type CurrentPage = this.MainPage.GetType();
if (e.IsConnected && CurrentPage != typeof(ClientPage))
this.MainPage = new NavigationPage(new ClientPage());
else
if (!e.IsConnected && CurrentPage != typeof(NoNetworkPage))
this.MainPage = new NavigationPage(new NoNetworkPage());
}
protected override void OnStart()
{
// if there is no connectivity it's going to go to no network page
base.OnStart();
CrossConnectivity.Current.ConnectivityChanged += HandleConnectivityChanged;
}
Reply
Answers (
1
)
Data save in Excel in Samesheet.
Drag and drop pocture box to pannel