Forum Xamarin.Forms

Is it possible to have an entire ContentView be focusable?

ClintBClintB Member ✭✭

If I have a ContentView for a customized control is there a way to tell when the view is tapped in general? I want to be able to call a Focused method like a SearchBar or Entry would have.

Something like

<localNamespace:customView Focused="CustomView_Focused" />

Thanks in advance!

Tagged:

Best Answers

  • ClintBClintB ✭✭
    Accepted Answer

    I did end up attaching a GestureRecignizer to the entire ContenView. I have an Image but it doesn't cause issues as far as taps falling through it. I also have an Entry which is able to be focused on so I had to set its InputTransparent field to True so the tap would fall through.

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Looks like it should. Intellisense shows it hass the right properties.
    Did you try? When you try what problems do you run in to?

  • ClintBClintB Member ✭✭

    I realized I asked the wrong question. I'm just looking for when a ContentView is tapped in general so I can capture the event and direct focus to a specific element, such as an entry, within the view. It looks like there are some posts I hadn't seen before that talk bout that. Thanks for the help though!

  • ClintBClintB Member ✭✭
    Accepted Answer

    I did end up attaching a GestureRecignizer to the entire ContenView. I have an Image but it doesn't cause issues as far as taps falling through it. I also have an Entry which is able to be focused on so I had to set its InputTransparent field to True so the tap would fall through.

Sign In or Register to comment.