WPF Binding Problem

后端 未结 3 1048
陌清茗
陌清茗 2020-12-19 22:26

I have this object:

    class a 
    { 
        public string Application; 
        public DateTime From, To;
    }

And I declare this list

3条回答
  •  [愿得一人]
    2020-12-19 23:03

    Looks like WPF can't bind to fields directly, you have to use properties like so:

    class a
    {
        public string Application { get; set; }
        public DateTime From { get; set; }
        public DateTime To { get; set; }
    }
    

提交回复
热议问题