Share via

WPF MVVM Calender DisplayMode Binding

Simon Ong 21 Reputation points
2021-02-07T11:04:22.283+00:00

Hi:
What is the property that need to bind DisplayMode of Calender?

  <Calendar  x:Name="StarCalender" SelectedDate="{Binding StartDateTime}" Background="Beige"  DisplayDate="{Binding DispDate}" DisplayMode="{Binding StartModeChange}"   >
</Calendar>


private ?? _startModeChange;
public  ?? StartModeChange
{
........
}

thanks

Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Ken Tucker 5,866 Reputation points
    2021-02-07T11:19:21.547+00:00

    It would need to be CalendarMode it is an enum

    https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.calendarmode?view=net-5.0

    FIELDS
    Decade 2
    The Calendar displays a decade at a time.

    Month 0
    The Calendar displays a month at a time.

    Year 1
    The Calendar displays a year at a time.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.