Ejemplo n.º 1
0
        protected async void ShowOptions(object sender, TabTappedEventArgs e)
        {
            var selection = await Navigation.ShowPopupAsync(new ActionSheet()) as ActionType?;

            if (selection == null)
            {
                return;
            }

            switch (selection.Value)
            {
            case ActionType.Manual:
                var manualResult = await Navigation.ShowPopupAsync(new ManualBookEntry());

                if (manualResult == null)
                {
                    return;
                }

                // refresh the library
                await pageHome.LoadData();

                await pageLibrary.LoadData();

                break;

            case ActionType.ByIsbn:
                var result = await Navigation.ShowPopupAsync(new ManualIsbn());

                if (result == null)
                {
                    return;
                }

                // refresh the library
                await pageHome.LoadData();

                await pageLibrary.LoadData();

                break;

            case ActionType.ByScan:
                var scanner = new Scanner();
                scanner.Disappearing += ScannerOnDisappearing;
                await Navigation.PushAsync(scanner);

                break;
            }
        }
Ejemplo n.º 2
0
        async void OnCartTabTapped(object sender, TabTappedEventArgs e)
        {
            if (sender is TabViewItem tabViewItem)
            {
                // Tap animation
                var tabViewOriginalScale = tabViewItem.Scale;
                await tabViewItem.ScaleTo(tabViewOriginalScale - 0.1, 50, Easing.Linear);

                await Task.Delay(100);

                await tabViewItem.ScaleTo(tabViewOriginalScale, 50, Easing.Linear);
            }

            if (App.Model.Cart.Count > 0)
            {
                await Navigation.PushAsync(new ShoppingCartPage(), true);
            }
            else
            {
                await DisplayAlert("Cart is empty", "There is nothing added to the cart.", "Ok");
            }
        }
 void OnTabViewItemTapTapped(object sender, TabTappedEventArgs e)
 {
     InfoEventsLabel.Text += $"TabTapped - Position: {e.Position} {Environment.NewLine}";
 }
 void OnFabTabTapped(object?sender, TabTappedEventArgs e) => DisplayAlert("FabTabGallery", "Tab Tapped.", "Ok");
Ejemplo n.º 5
0
 void OnFabTabTapped(object sender, TabTappedEventArgs e)
 {
     DisplayAlert("NTabViewWithXaml", "Tab Tapped.", "Ok");
 }