示例#1
0
        private void FeelHeaders()
        {
            if (_daysOfWeek.Count == 0)
            {
                // build correct sequence of days of week
                var iCurrNext = 0;
                foreach (DayOfWeek d in Enum.GetValues(typeof(DayOfWeek)))
                {
                    // insert into the start first day of week
                    if (d == GlobalVariables.FirstDayOfWeek)
                    {
                        _daysOfWeek.Insert(iCurrNext++, d);
                    }

                    // when first day of week haven't been found add next day
                    else if (iCurrNext == 0)
                    {
                        _daysOfWeek.Add(d);
                    }

                    // when first day of week have been found insert next day after first day
                    else
                    {
                        _daysOfWeek.Insert(iCurrNext++, d);
                    }
                }

                for (int iCol = 0; iCol < 7; iCol++)
                {
                    var lbl = new Label()
                    {
                        Content                    = MultiLangResource.EnumItemDescription(typeof(DayOfWeek), _daysOfWeek[iCol]),
                        HorizontalAlignment        = HorizontalAlignment.Center,
                        HorizontalContentAlignment = HorizontalAlignment.Center
                    };

                    Grid.SetColumn(lbl, iCol);
                    dayHeadersGrid.Children.Add(lbl);
                }
            }
        }
 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
 {
     return(MultiLangResource.EnumItemDescription(value.GetType(), value));
 }