Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/216.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# xamarin母版页绑定内容页_C#_Android_Xamarin_Mobile_Cross Platform - Fatal编程技术网

C# xamarin母版页绑定内容页

C# xamarin母版页绑定内容页,c#,android,xamarin,mobile,cross-platform,C#,Android,Xamarin,Mobile,Cross Platform,我正在使用xamarin跨平台。 我想在every.xaml页面中添加相同的“浮动菜单项”。(home/logout/view/account) 我已经添加了以下母版页 <MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="ABCAPP.V

我正在使用xamarin跨平台。 我想在every.xaml页面中添加相同的“浮动菜单项”。(home/logout/view/account)

我已经添加了以下母版页

<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="ABCAPP.Views.MasterDetailPage1"
             xmlns:pages="clr-namespace:ABCAPP.Views">
  <MasterDetailPage.Master>
    <pages:MasterDetailPage1Master x:Name="MasterPage" />
  </MasterDetailPage.Master>
  <MasterDetailPage.Detail>
    <NavigationPage>
      <x:Arguments>
                <pages:MasterDetailPage1Detail>

                    <StackLayout>
                    <StackLayout Orientation="Horizontal" VerticalOptions="Start">
                         <!--top controls--> 
                    </StackLayout>

                    <StackLayout VerticalOptions="CenterAndExpand">
                         <!--middle controls--> 
                    </StackLayout>

                    <StackLayout Orientation="Horizontal" VerticalOptions="End">

                            <Button Text="A" FontAttributes="Bold"  BackgroundColor="MediumSlateBlue" BorderRadius="50" TextColor="White"></Button>
                            <Button Text="B" FontAttributes="Bold"  BackgroundColor="MediumSlateBlue"  TextColor="White"></Button>


                         <!--bottom controls--> 
                    </StackLayout>
                    </StackLayout>
                </pages:MasterDetailPage1Detail>
            </x:Arguments>
    </NavigationPage>
  </MasterDetailPage.Detail>
</MasterDetailPage>

如何将此布局添加到其他.xaml内容页

这是我的内容页

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="ABCAPP.Views.Confirmed">
    <ContentPage.Content>
        <ScrollView>
            <StackLayout Spacing="20" Padding="15" BackgroundColor="Orange">
                <Label Text="Thank you!" FontSize="50" FontAttributes="Bold" TextColor="White" HorizontalOptions="Center"   />
                <Label Text=" confirmed." FontSize="30" FontAttributes="Bold" TextColor="White" HorizontalOptions="Center"  />
                <Label x:Name="lblMsg" TextColor="Red"   IsVisible="False" ></Label>
                <Button Text="ADD " Clicked="NewAttend_Clicked" FontAttributes="Bold"  BackgroundColor="MediumSlateBlue" BorderRadius="5"  TextColor="White"></Button>

                <Button Text="RETURN " Clicked="List_Clicked" FontAttributes="Bold"  BackgroundColor="MediumSlateBlue"  BorderRadius="5" TextColor="White"></Button>
                <Image Source="drawable/icon"  ></Image>

            </StackLayout>
        </ScrollView>
    </ContentPage.Content>
</ContentPage>


创建您自己的BasePage类,该类继承自ContentPage并包含您的菜单。然后让你所有的页面都继承这个基本页面。你能举个例子吗。。我是应用程序新手