0

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.

Community
  • 1
  • 1
Jorge MHT
  • 36
  • 6

1 Answers1

0

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.

Christian Findlay
  • 6,770
  • 5
  • 51
  • 103