And I set the datatemplate in my C# program on a ListViewItem like this:
DataTemplate template = (DataTemplate)this.FindResource("SkillListItem");
ListViewItem litem = new ListViewItem();
litem.ContentTemplate = template;
And on visual studio I got this error:
WPF Error 40 BindingExpression path error: 'Name 'property not found on 'object' Skill
It is a strange error that can solve by changing
public string Name;
to this
public string Name{ get; set; }
No comments:
Post a Comment