Exemplo n.º 1
0
        async Task PushTabbedPage(Account account = null)
        {
            if (Device.OS == TargetPlatform.iOS)
            {
                var customerDetailPage = new CustomerDetailPage()
                {
                    BindingContext = new CustomerDetailViewModel(account, this)
                    {
                        Navigation = this.Navigation
                    },
                    Icon = new FileImageSource()
                    {
                        File = "CustomersTab"
                    }                                                      // only used  on iOS
                };
                await Navigation.PushAsync(customerDetailPage);
            }
            else
            {
                var tabbedPage = new TabbedPage()
                {
                    Title = account.Company
                };

                var customerDetailPage = new CustomerDetailPage()
                {
                    BindingContext = new CustomerDetailViewModel(account, tabbedPage)
                    {
                        Navigation = this.Navigation
                    }, Title = TextResources.Customers_Detail_Tab_Title
                };

                var customerOrdersPage = new CustomerOrdersPage()
                {
                    BindingContext = new OrdersViewModel(account)
                    {
                        Navigation = this.Navigation
                    }, Title = TextResources.Customers_Orders_Tab_Title
                };

                var customerSalesPage = new CustomerSalesPage()
                {
                    BindingContext = new CustomerSalesViewModel(account)
                    {
                        Navigation = this.Navigation
                    }, Title = TextResources.Customers_Sales_Tab_Title
                };

                tabbedPage.Children.Add(customerDetailPage);
                tabbedPage.Children.Add(customerOrdersPage);
                tabbedPage.Children.Add(customerSalesPage);

                await Navigation.PushAsync(tabbedPage);
            }
        }
Exemplo n.º 2
0
        public CustomerTabbedPage(INavigation navigation, Account account)
        {
            Title = account.Company;
            // since we're modally presented this tabbed view (because Android doesn't natively support nested tabs),
            // this tool bar item provides a way to get back to the Customers list

            var customerDetailPage = new CustomerDetailPage(account)
            {
                BindingContext = new CustomerDetailViewModel(account)
                {
                    Navigation = this.Navigation
                },
                Title = TextResources.Customers_Detail_Tab_Title,
                Icon  = new FileImageSource()
                {
                    File = "CustomersTab"
                }                                                      // only used  on iOS
            };

            var customerOrdersPage = new CustomerOrdersPage()
            {
                BindingContext = new OrdersViewModel(account)
                {
                    Navigation = this.Navigation
                },
                Title = TextResources.Customers_Orders_Tab_Title,
                Icon  = new FileImageSource()
                {
                    File = "ProductsTab"
                }                                                     // only used  on iOS
            };

            var customerSalesPage = new CustomerSalesPage()
            {
                BindingContext = new CustomerSalesViewModel(account)
                {
                    Navigation = this.Navigation
                },
                Title = TextResources.Customers_Sales_Tab_Title,
                Icon  = new FileImageSource()
                {
                    File = "SalesTab"
                }                                                  // only used  on iOS
            };

            Children.Add(customerDetailPage);
            Children.Add(customerOrdersPage);
            Children.Add(customerSalesPage);
        }
Exemplo n.º 3
0
 async Task PushTabbedPage(Account account = null)
 {
     if (Device.OS == TargetPlatform.iOS)
     {
         var customerDetailPage = new CustomerDetailPage(account)
         {
             BindingContext = new CustomerDetailViewModel(account)
             {
                 Navigation = this.Navigation
             },
             Title = TextResources.Customers_Detail_Tab_Title,
             Icon  = new FileImageSource()
             {
                 File = "CustomersTab"
             }                                                          // only used  on iOS
         };
         await Navigation.PushAsync(customerDetailPage);
     }
     else
     {
         await Navigation.PushAsync(new CustomerTabbedPage(ViewModel.Navigation, account));
     }
 }