locked
Check of Entry is clicked/focused RRS feed

  • Question

  • User350646 posted

    Hi,

    I have some code in which I want to detect which Entry has been selected, if possible I want to do this combined with a Binding so I can use it in my ViewModel. Is it possible to detect this?

    <Entry WidthRequest="100" Text="{Binding Text}" Focused="{Binding Entry1IsSelected}">

    public bool selected;
    
    public bool Entry1IsSelected{
        get{
            return selected;
        }
        set{
            selected = value;
        }
    }
    
    Thursday, October 26, 2017 11:12 AM

Answers

  • User2148 posted

    bind your entry to IsFocused not Focused

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, October 26, 2017 11:54 AM

All replies

  • User350646 posted

    If I do it with IsFocused I'll need to make the Entry in the ViewModel don't I?

    Thursday, October 26, 2017 11:49 AM
  • User2148 posted

    bind your entry to IsFocused not Focused

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, October 26, 2017 11:54 AM
  • User350646 posted

    Wow I'm feeling so stupid right now for not trying that earlier, thanks for the help :)

    Thursday, October 26, 2017 11:58 AM
  • User383109 posted

    Hi Freerk, How did you solve the problem? I have tried to solve so far without success.

    Thursday, March 28, 2019 12:58 PM
  • User350646 posted

    @jdonoso I think I did what Alessandro said, been a while since I worked on that project

    <Entry WidthRequest="100" Text="{Binding Text}" IsFocused="{Binding Entry1IsSelected}">

    Thursday, March 28, 2019 1:04 PM