What does the SmartPart attribute do?

Topics: CAB & Smart Client Software Factory
Jul 19, 2006 at 8:55 PM
originally posted by: glenmaroney

Sounds a basic question but I've been creating modules (which I was actually calling WorkItems until corrected in another thread!) without the SmartPart attribute on the UserControl and happily displaying them in WindowWorkspaces and DeckWorkspaces.

What does adding the SmartPart attribute actually give to me that I don't already have?

I know it's a trivial matter as it wouldn't hurt to add it but it's not there now and doesn't seem to cause any issues so the question is just to satisfy my curiosity really!

Jul 20, 2006 at 5:14 AM
originally posted by: ChrisHolmes

SmartPart is just a flag, as I understand it. In your WorkItem, you have an Items collection of objects that the WorkItem is holding, and that can be a mismash of SmartParts, Presenters, Workspaces, etc. You can also get at those objects in a type specific way via the .SmartParts and .Workspaces collections. If your UserControl is not flagged as a SmartPart then the only way to access it is via the .Items collection, but if you have it tagged as a SmartPart then you can add/get via the .SmartPart collection.
Jul 20, 2006 at 5:51 AM
originally posted by: glenmaroney

That makes sense....thanks very much