Forum Xamarin.Forms

DatePicker Focused, UnFocused MVVM

Hello, in my application I use a datepicker which has property IsVisible=False and I use MVVM.
I have text and when I click the text with with Tap Gesture Recognizer , I want to Focus the Datepicker and control Focused and when Unfocused events, how can I do that ?

Best Answer

  • oguzhanorhaanoguzhanorhaan TRMember ✭✭
    Accepted Answer

    I passed the Datepicker as an argument to viewmodel's constructor and I created another datepicker inside viewmodel and I controlled behaviours inside the viewmodel.

Answers

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    I think it has a IsFocused property that you can bind. For event you can use behaviors
  • oguzhanorhaanoguzhanorhaan TRMember ✭✭
    Accepted Answer

    I passed the Datepicker as an argument to viewmodel's constructor and I created another datepicker inside viewmodel and I controlled behaviours inside the viewmodel.

  • X-ArielX-Ariel ARMember ✭✭

    "Datepicker as an argument to viewmodel's constructor" ====> Is not MVVM

Sign In or Register to comment.