How become the Current Day (today) cliclable in Xamarin CalendarView?

I explanin, when load the CalendarView works the click for all days, unless current day.
Image is atachment.

Part of my code:

protected override void OnCreate( Bundle bundle ) // begin onCreate
{
base.OnCreate( bundle );

    SetContentView( Resource.Layout.Pro_Agenda );            
    var cal = FindViewById<CalendarView>( Resource.Id.agendaMensal );

    // works 
    cal.DateChange += Calendar_DateChange;   

    // works just when clicked in calendarView´s Header 
    cal.Click += CalendarView_Click; 

    // too works just clicked in header  
    //cal.Click += delegate
    //{
    //    Toast message ... 
    //};

    dateCurrent = cal.Date; // works just when load (onCreate, etc)


// but if need clic on calendarView´s today????? It is not works. 

} // end onCreate 

Answers

  • MabroukMabrouk USMember ✭✭✭
    edited September 2016

    Hi @Volmir
    You just need to add .... in your DateChanged event, like :
    private void Calendar_DateChange(object sender, CalendarView.DateChangeEventArgs args) { dateCurrent = cal.Date; // add the next part of your code here ... }

    But you have to add CalendarView cal; as a global object.

    Hope that helps.

  • VolmirVolmir BRMember
    edited September 2016

    Hi @Mabrouk. Firstly thanks for your response.
    But I alread was using your suggestion.
    Event .Calendar_DateChange allways worked.

    I need is clicked in "today" when load and show it "day".

  • VolmirVolmir BRMember

    And you Master @JamesMontemagno ????
    Maybe a bug in CalendarView?

Sign In or Register to comment.