Hello, I make my calendar with additional chips, but still at the stage of implementing the basic functionality I ran into a problem - I can not understand how to fill in the "Panel of days of the week", well, the one that says "Monday", "Tuesday", etc. , with the amendment on the first day of the week user. Indeed, in some countries, the week does not start on Monday, but on Sunday.
Here is what I tried:
private void LoadWeekPanel() { for (int i = 0; i < WeekPanel.ColumnDefinitions.Count; i++) { TextBlock tb = new TextBlock() { Text = ((DayOfWeek)i + (int)FirstDayOfWeek).ToString(), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }; WeekPanel.Children.Add(tb); Grid.SetColumn(tb, i); } } //WeekPanel - это Grid //FirstDayOfWeek - это CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek //DayOfWeek - это перечисление в пространстве имён System, описывающее дни недели As a result, I got the following result: 
I understand that the counter in the loop went beyond the limits of the enumeration, and thus this seven was added to the last TextBlock . But I can't figure out how to fix it.

WPF? He does not like when elements are added from the code. I remember you wrote something like one of your answers: “If you took WPF, then you need to know about data binding in and out.” ... Learn and implement Binding, otherwise you won't get away! - EvgeniyZWPFprojects, whileWPFitself is quite tolerant of this. - Arthur Edgarov