Browse Source

Fixed binding errors caused by DayTitleTemplate

Fixed by initializing the DataContext before adding elements to the
VisualTree
pull/1244/head
sdoroff 9 years ago
parent
commit
aa81573218
  1. 1
      src/Avalonia.Controls/Calendar/CalendarItem.cs

1
src/Avalonia.Controls/Calendar/CalendarItem.cs

@ -198,6 +198,7 @@ namespace Avalonia.Controls.Primitives
if (_dayTitleTemplate != null)
{
var cell = _dayTitleTemplate.Build();
cell.DataContext = string.Empty;
cell.SetValue(Grid.RowProperty, 0);
cell.SetValue(Grid.ColumnProperty, i);
MonthView.Children.Add(cell);

Loading…
Cancel
Save