I have a problem using multiple instances of a web part using custom properties.
I made a web part using SilverLight 4, VS2010 and SP2010. The Web Part passes some custom properties to SilverLight using list data chosen from an EditorPart. The web part works fine but when I try to add more than one web part and make those depend on other lists and data, only the latest web part will appear showing the graphics made from the settings of the first web part and the first web part just appears empty.
What I really want is for the site to display each web part added with each different setup. How is this possible?
I've tried to prefix every property getter and setter with
[WebBrowsable(false), WebPartStorageAttribute(Storage.Shared)]
[Personalizable(PersonalizationScope.Shared)]
and played around with the Storage.Shared/Storage.Personal/Storage.None for the WebPartStoarageAttribute argument. That didn't fix the problem.
Also I've made sure that every web part and EditorPart have its own id as done by Victor Wiléns in SharePoint 2010 Web Parts in action:
EditorPartCollection IWebEditable.CreateEditorParts()
{
List<EditorPart> editors = new List<EditorPart>();
myWebPartEditor editorPart = new myWebPartEditor();
editorPart.ID = this.ID + "_editorPart";
editors.Add(editorPart);
return new EditorPartCollection(editors);
}
object IWebEditable.WebBrowsableObject
{
get { return this; }
}
I suspect that the Web Part is only able to use one XAP file at a time?
I hope I've described the problem well enough and that someone is able to help :) Thanks in advance.