Calendar year view issue
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
### Description
When a Calendar's DisplayMode is set to "Year" in XAML and a DataContext is set, the control will be very wide at runtime. If no DataContext is set either in the ancestors or in the control, it works fine. If DisplayMode = "Month" in XAML (or not set), then there is also no problem when switching to "Year" view.

### Reproduction Steps
**Wrong look:**
``
` `
` `
` `
``
**Wrong look:**
``
` `
` `
` `
``
**Right look:**
``
` `
` `
` `
``
### Expected behavior
Normal width as in Month view.
### Actual behavior
The all instances of CalendarItemStyle's "CalendarItem.DayTitleTemplateResourceKey" element (day titles) display data source string representation (ToString()), but not visible because the DataTrigger hides it (Visibility = Hidden). Set visible to display the text on the screen.
### Regression?
_No response_
### Known Workarounds
_No response_
### Impact
_No response_
### Configuration
_No response_
### Other information
_No response_
[WpfCalendarYearViewIssue.zip](https://github.com/dotnet/wpf/files/12826619/WpfCalendarYearViewIssue.zip)
Contributor guide
Assessment
This issue has not been assessed yet.