Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Master Page and List error

NeidennXNeidennX Member ✭✭✭
edited October 12 in Xamarin.Forms

Hi Team,

Im creating a XamarinForms app, and now im trying to add a side navigation menu for the start page but when im trying to preview it an error pops up saying that "Master and Detail must be set before using a MasterDetailPage".

Also on the C# class in which i work the options for the menu im getting an error saying "Argument 1 cannot conver from App.Models.ListMenu to Xamarin.Forms.Menu"
And apparently there are some Libraries related to netstandard that could not be found, i already deleted my Bin and Obj folders and i have everything up to date.

Can you guys please help ?

Regards

Answers

  • ColeXColeX Member, Xamarin Team Xamurai
    edited October 12

    The first error

    You forget to initialize MasterDetailPage.Detail in Xaml , refer to the following official sample

    <MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
                      xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                      xmlns:local="clr-namespace:MasterDetailPageNavigation;assembly=MasterDetailPageNavigation"
                      x:Class="MasterDetailPageNavigation.MainPage">
        <MasterDetailPage.Master>
            <local:MasterPage x:Name="masterPage" />
        </MasterDetailPage.Master>
        <MasterDetailPage.Detail>
            <NavigationPage>
                <x:Arguments>
                    <local:ContactsPage />
                </x:Arguments>
            </NavigationPage>
        </MasterDetailPage.Detail>
    </MasterDetailPage>
    
    

    The second error

    The type is not compatible , why you want to add a ListMenu object into Menu List ? Does ListMenu inherit from Menu ?

Sign In or Register to comment.