因此,我正在尝试制作wpf日历,但是GetValue()和SetValue()方法有问题。我已经声明了所有库,并向我表明这些方法根本不存在并且无法识别。
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Reflection;
namespace CustomControls
{
public class Calendar : Control
{
public ObservableCollection<Day> Days { get; set; }
public ObservableCollection<string> DayNames { get; set; }
public static readonly DependencyProperty CurrentDateProperty = DependencyProperty.Register("CurrentDate", typeof (DateTime), typeof (Calendar));
public event EventHandler<DayChangedEventArgs> DayChanged;
public DateTime CurrentDate
{
get { return (DateTime) GetValue(CurrentDateProperty); }
set { SetValue(CurrentDateProperty, value); }
}
}
}
希望您能帮助我并提前谢谢您!