Xamarin.forms Xamarin表单选项卡式结构-在所有选项卡底部显示相同的按钮

Xamarin.forms Xamarin表单选项卡式结构-在所有选项卡底部显示相同的按钮,xamarin.forms,tabbedpage,Xamarin.forms,Tabbedpage,我的xamarin表单应用程序基于选项卡式结构。我想实现的是:我想在所有标签页的底部显示一个按钮,它应该是相同的按钮。当我导航到其他选项卡时,相同的按钮应该以相同的逻辑出现。我怎样才能做到这一点 <TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:d="http://xama

我的xamarin表单应用程序基于选项卡式结构。我想实现的是:我想在所有标签页的底部显示一个按钮,它应该是相同的按钮。当我导航到其他选项卡时,相同的按钮应该以相同的逻辑出现。我怎样才能做到这一点

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
        xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
        xmlns:d="http://xamarin.com/schemas/2014/forms/design"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        xmlns:views="clr-namespace:DriverApp.Views"
        xmlns:vm="clr-namespace:DriverApp.ViewModels"
        x:Class="DriverApp.Views.PlanningDetailPage">

<TabbedPage.Children>

    <NavigationPage Title="Activity">
        <x:Arguments>
            <views:ActivityPage />
        </x:Arguments>
    </NavigationPage>

    <NavigationPage Title="Vehicle">
        <x:Arguments>
            <views:VehiclePage />
        </x:Arguments>
    </NavigationPage>

    <NavigationPage Title="Driver">
        <x:Arguments>
            <views:DriverPage />
        </x:Arguments>
    </NavigationPage>

    <NavigationPage Title="Checklist">
        <x:Arguments>
            <views:CheckListPage />
        </x:Arguments>
    </NavigationPage>

    <NavigationPage Title="Attachment">
        <x:Arguments>
            <views:AttachmentPage />
        </x:Arguments>
    </NavigationPage>

    <NavigationPage Title="Damage">
        <x:Arguments>
            <views:DamagePage />
        </x:Arguments>
    </NavigationPage>
</TabbedPage.Children>


创建一个所有内容页都从中继承的基本页,但内容页都有不同的绑定上下文,对吗?这取决于您,还是我应该使用Application.Resources中的ResourceDictionary中的ControlTemplate?App.xaml中的ResourceDictionary中的ControlTemplate?您所说的“相同按钮”是什么意思?是同一个按钮实例,还是仅仅是具有相同外观和相同逻辑的按钮?基本上,使用同一个实例是没有好处的,因为它会混淆生命周期。如果您想要一个外观相同的按钮,那么@Jason提到的BasePage和ControlTemplate都可以,但是如果您想要按钮点击背后的共享逻辑,ControlTemplate将稍微复杂一点。