public class ImageData
{
public int ImageIndex { get; set; }
public ImageSource ImgSource { get; set; }
public string SourceUrl { get; set; }
public DateTime CreateTime { get; set; }
public string ImageTitle { get; set; }
public string ImageClass { get; set; }
}
public partial class ImageListControl : UserControl
{
public static readonly DependencyProperty ImageDataListProperty = DependencyProperty.Register("ImageDataList",
typeof(System.Collections.ObjectModel.ObservableCollection<ImageData>), typeof(ImageListControl),
new FrameworkPropertyMetadata("NO DATA"));
public ImageListControl()
{
InitializeComponent();
}
public System.Collections.ObjectModel.ObservableCollection<ImageData> ImageDataList
{
get { return (System.Collections.ObjectModel.ObservableCollection<ImageData>)GetValue(ImageDataListProperty); }
set { SetValue(ImageDataListProperty, value); }
}
}
我使用 UserControl 注册了 DependencyProperty 错误。为什么我不能注册 DependencyProperty ?我不知道出了什么问题。请帮帮我,谢谢。