如何在Xamarin中创建页面?

时间:2019-08-27 12:08:35

标签: xamarin xamarin.forms

我在创建页面时遇到以下问题,休息后我什么也没收到。请帮忙。

        private void ItemAction(DashboardMultipleTileItemData item)
    {
        switch (item.Title)

        {
            case "Contacts":
                new NavigationPage(new TabControlAndroidSamplePage());
                break;
            case "Documents":
                Application.Current.MainPage.Navigation.PushAsync(new EmployeePerformanceDashboardPage());
                break;
                //case "Enquiry":
                //  Application.Current.MainPage.Navigation.PushAsync(new WebSitePage()));
                //  break;
        }
    }

1 个答案:

答案 0 :(得分:0)

解决方案将是:-

private void ItemAction(DashboardMultipleTileItemData item)
    {
        switch (item.Title)

        {
            case "Contacts":
                Application.Current.MainPage = new NavigationPage(new TabControlAndroidSamplePage());
                break;
            case "Documents":
                Application.Current.MainPage.Navigation.PushAsync(new EmployeePerformanceDashboardPage());
                break;
                //case "Enquiry":
                //  Application.Current.MainPage.Navigation.PushAsync(new WebSitePage()));
                //  break;
        }
    }