Beispiel #1
0
 void setNetworkStatus()
 {
     if (CrossConnectivity.Current != null && CrossConnectivity.Current.IsConnected)
     {
         MainPage = new NetworkViewPage();
     }
     else
     {
         MainPage = new NoNetworkPage();
     }
 }
Beispiel #2
0
 void CrossConnectivity_Current_ConnectivityChanged(object sender, Connectivity.Plugin.Abstractions.ConnectivityChangedEventArgs e)
 {
     if (e.IsConnected)
     {
         MainPage = new NetworkViewPage();
     }
     else
     {
         MainPage = new NoNetworkPage();
     }
 }
Beispiel #3
0
 public App()
 {
     InitializeComponent();
     if (CrossConnectivity.Current.IsConnected)
     {
         MainPage = new NetworkViewPage();
     }
     else
     {
         MainPage = new NoNetworkPage();
     }
 }
Beispiel #4
0
        private void Current_ConnectivityChanged(object sender, Plugin.Connectivity.Abstractions.ConnectivityChangedEventArgs e)
        {
            Type currentPage = MainPage.GetType();

            if (e.IsConnected && currentPage != typeof(NetworkViewPage))
            {
                MainPage = new NetworkViewPage();
            }
            else if (!e.IsConnected && currentPage != typeof(NoNetworkPage))
            {
                MainPage = new NoNetworkPage();
            }
        }
Beispiel #5
0
 protected override void OnStart()
 {
     // Handle when your app starts
     CrossConnectivity.Current.ConnectivityChanged += (s, e) =>
     {
         if (e.IsConnected)
         {
             this.MainPage = new NetworkViewPage();
         }
         else
         {
             MainPage = new NoNetworkPage();
         }
     };
 }
        protected void OnConnectivityChanged(object sender, ConnectivityChangedEventArgs e)
        {
            var currentType = MainPage.GetType();

            if (CrossConnectivity.Current.IsConnected)
            {
                if (currentType != typeof(NetworkViewPage))
                {
                    MainPage = new NetworkViewPage();
                }
            }
            else
            {
                if (currentType != typeof(NoNetworkPage))
                {
                    MainPage = new NoNetworkPage();
                }
            }
        }
Beispiel #7
0
 public App()
 {
     noNetworkPage = new NoNetworkPage();
     networkViewPage = new NetworkViewPage();
 }