Tuesday, 15 September 2015

winforms - C# ObservableCollection Add error -



winforms - C# ObservableCollection Add error -

i have custom control:

public class detail { public string text {get; set;} } public class header : detail { public int size {get; set;} public observablecollection<detail> details; } public class mycontrol : command { public observablecollection<header> headers; }

i add together command form, add together few header objects, each having few detail objects added them. far works fine.

however when close form , open again, i'm getting error:

message 1 method 'system.collections.objectmodel.observablecollection`1[[utils.header, utils, version=1.0.0.0, culture=neutral, publickeytoken=null]].add' not found.

and code in formdesigner class this:

header header1 = new utils.header(); resources.applyresources(header1, "header1"); this.taskbar1.headers.add(header1); //this line causes error

what can problem be?

i changed observablecollection bindinglist , implemented inotifypropertychanged on classes , looks it's working fine.

note: observablecollection wpf not winforms!

c# winforms user-controls

No comments:

Post a Comment