示例#1
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            INetworkManager nwm = DependencyService.Get <INetworkManager>();

            if (nwm != null && nwm.IsNetworkConnected())
            {
                var products = await ProductService.GetProductsAsync();

                BindingContext = products;
            }
            else
            {
                await DisplayAlert("Not Connected", "you are not connected to the network", "OK");
            }
        }
示例#2
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            INetworkManager mgr = DependencyService.Get <INetworkManager>();

            if (mgr.IsNetworkConnected())
            {
                var products = await ProductService.GetProductsAsync();

                BindingContext = products;
            }
            else
            {
                await DisplayAlert("Not connected", "you are not connected to a network", "Ok");
            }
        }