Example #1
0
        /// <summary>
        /// Returns the string that describes the functionality of the
        /// GlobalCalendarDayButton that is associated with this
        /// GlobalCalendarDayButtonAutomationPeer.  This method is called by
        /// GetHelpText.
        /// </summary>
        /// <returns>
        /// The help text, or String.Empty if there is no help text.
        /// </returns>
        protected override string GetHelpTextCore()
        {
            GlobalCalendarDayButton button = OwningCalendarDayButton;

            if (button != null && button.DataContext is DateTime)
            {
                DateTime date = OwningCalendarDayButton.GetDate();
                string   text = OwningCalendar.Info.DateToLongString(date);

                return(!button.IsBlackout ?
                       text :
                       string.Format(
                           OwningCalendar.Info.DateFormatInfo,
                           System.Windows.Controls.Properties.Resources.CalendarAutomationPeer_BlackoutDayHelpText,
                           text));
            }

            return(base.GetHelpTextCore());
        }