0
votes

I have tried to show my SearchBar in my navigation page,

I have 3 tabs, and I would like put in the first tab (Search) a navigation search

    <TabbedPage {some namespace} >
            <views:Search Title="Search"/>
            <!-- Other tabs -->
    </TabbedPage>


     <CustomControls:CustomSearchPage 
          {some namespace}
         xmlns:CustomControls="myNamespace" 
         SearchPlaceHolderText="Type to Search"
         SearchCommand="{Binding SearchCommand}">
     </CustomControls:CustomSearchPage>

I read this, and I put the same code like these demos here:

Demo 1

Demo 2

Demo 3

My problem:

Does anyone know the reason for the error? When I run the application I get the following error, and I do not know what to do.

1
What is the error?Christian Findlay
When I run the application I get the following error, and I do not know what to do. I have my CustomSearchPage in a PCL project, my CustomRenderer in android and I did the override OnCreateOptionsMenu method in my MainActivity. I do not know why that mistake is due.Jorge MHT
Please post your MainActivity code.York Shen

1 Answers

0
votes

The error you are experiencing means that one of the objects you are using is null, and therefore you are not able to use one of the properties here. The null object could be:

MainActivity MainActivity.ToolBar or Element

Put a breakpoint before this line of code gets hit, and drag these objects in to the watch window. You will be able to see which one is null.