简体   繁体   English

Xamarin 社区工具包 TabView - 在选项卡内导航

[英]Xamarin Community Toolkit TabView - Navigate within Tabs

For the bottom navigation bar, I'm using a Tabbed Page, and inside of a Tabbed page, I'm using a Tabview from the Xamarin Community Toolkit.对于底部导航栏,我使用的是选项卡式页面,在选项卡式页面内部,我使用的是 Xamarin 社区工具包中的选项卡视图。 On each XCT tab, I'm loading a list of items using the collection view (Xamarin Community Toolkit TabView).在每个 XCT 选项卡上,我正在使用集合视图 (Xamarin Community Toolkit TabView) 加载项目列表。 I need to click an item in collection view and move to another page (detail page) within the same tab of the tabbed page.我需要在集合视图中单击一个项目并移动到选项卡式页面的同一选项卡内的另一个页面(详细信息页面)。 Although I am aware that Shell might be used, I prefer to use the method described above.虽然我知道可能会使用 Shell,但我更喜欢使用上述方法。

在此处输入图像描述

You can use the SelectionChangedCommand to bind with the ItemSelectedCommand command and then use Navigation.PushAsync(new DetailPage());您可以使用SelectionChangedCommandItemSelectedCommand命令绑定,然后使用Navigation.PushAsync(new DetailPage()); to navigate to the detail page as Jason suggested.按照 Jason 的建议导航到详细信息页面。

Here's the code snippet below for your reference:下面是代码片段供您参考:

INavigation Navigation => Application.Current.MainPage.Navigation;

public ICommand ItemSelectedCommand
  {
     get
     {
         return new Command(async () =>
         {
             if (SelectedItem == null) return;

             if(SelectedItem.Id ==1)
             {
                  await Navigation.PushAsync(new DetailPage());
             }
             //else if
             SelectedItem = null;
          });
       }
   }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xamarin 社区工具包 TabView 高度 - Xamarin Community Toolkit TabView height 重新选择当前选项卡以刷新 Xamarin 社区工具包上 TabView 控件上的页面 - ReSelect the current tab to refresh the Page on TabView Control on Xamarin Community Toolkit Xamarin 在滑动时形成社区 tabview 缓动 - Xamarin forms community tabview easing when swiping Xamarin 社区工具包弹出MVVM绑定问题 - Xamarin Community Toolkit Popup MVVM Binding Issue Xamarin Community Toolkit 输入验证在设置 BindingContext 时为真 - Xamarin Community Toolkit input validation is true when BindingContext is set 在标签内显示列表视图-Android Xamarin - Display listview within Tabs- Android Xamarin Xamarin 社区工具包 MediaElement 未显示播放控件或播放源中的视频 UWP - Xamarin Community Toolkit MediaElement not showing an Playback controls or play the video in the source UWP 如何在Visual Studio Community 2015中为Android更新Xamarin - How to update Xamarin for Android within Visual Studio Community 2015 谁能向我解释如何使用 Func<t, t, bool> ? validateValue = null) Xamarin 社区工具包 ObservableObject 中的验证?</t,> - Can anyone explain to me how I can use Func<T, T, bool>? validateValue = null) validation in the Xamarin Community Toolkit ObservableObject? Xamarin社区限制 - Xamarin Community Limitations
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM