예제 #1
0
        private void showDecade()
        {
            DaysInfo.Clear();

            CalendarGUIData.UniformGridColumns = 3;
            CalendarGUIData.UniformGridRows    = 4;

            for (var i = 0; i < 12; i++)
            {
                DaysInfo.Add(new DayInfo
                {
                    Number          = (_currentYear - i).ToString(CultureInfo.InvariantCulture),
                    FontWeight      = FontWeights.Bold,
                    BackgroundBrush = CustomBrushes.HighlightBackground(),
                    BorderBrush     = CustomBrushes.HightlightBorderBrush(),
                    Foreground      = CustomBrushes.HightlightForeground(),
                    CellWidth       = 60,
                    CellHeight      = 40
                });
            }

            calendarMode = CalendarMode.Decade;
            if (StartAnimation != null)
            {
                StartAnimation();
            }
        }
예제 #2
0
        private void highlightThisday(int year, int month, int day)
        {
            if (_currentMonth + 1 != month || _currentYear != year)
            {
                return;
            }

            //reset
            if (_lastSelectedIdx != -1)
            {
                DaysInfo[_lastSelectedIdx].BackgroundBrush = CustomBrushes.BorderBlueBackground();
                DaysInfo[_lastSelectedIdx].BorderBrush     = CustomBrushes.CellsBorederBrush();
                DaysInfo[_lastSelectedIdx].Foreground      = CustomBrushes.CellsForeground();
                DaysInfo[_lastSelectedIdx].FontWeight      = FontWeights.Normal;
            }

            for (var i = 0; i <= 41; i++)
            {
                if (DaysInfo[i + 7].Number != day.ToString(CultureInfo.InvariantCulture))
                {
                    continue;
                }
                DaysInfo[i + 7].FontWeight      = FontWeights.Bold;
                DaysInfo[i + 7].BackgroundBrush = CustomBrushes.HighlightBackground();
                DaysInfo[i + 7].BorderBrush     = CustomBrushes.HightlightBorderBrush();
                _lastSelectedIdx = i + 7;
            }
        }