So, I'm trying to make a wpf calendar, but I have problem with GetValue() and SetValue() methods. I have declared all of the libraries and it shows me that these methods doesn't exist at all and doesn't recognise them.
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); }
}
}
}
I hope you could help me and thank you in advance!