What I'm finding is that Shape.ContentPart and Shape.ContentItem are null; and I can't find any way to access the Model that will end up in the view. I want to add a wrapper at this stage based on certain properties of the part but I can't find it.

IShapeTableProvider is used in Core.Shapes and other places to describe properties about a whole bunch of the shapes that you normally see on an Orchard page.

I want to use it to add a Wrapper around my Parts_Foo_Bar (obviously I have simplified an example from my real application, I don't really have a Parts_Foo_Bar, but I want to be able to do this with any part).

But I can't add the Wrapper until I've checked settings from my part. However I can't *find* the part because both Shape.ContentPart and Shape.ContentItem are null. I'm wondering how I can access the model that I created in my Driver.

I didn't know about that, will give it a try - but can you explain what the difference is between ShapeMetadata.OnDisplaying, IShapeDisplayEvents.Displaying, and IShapeTableProvider => build.Describe("...").OnDisplaying(...) . These look like three different
ways to hook into the same event. I've already tried it from IShapeDisplayEvents and IShapeTableProvider, still no access to ContentItem.

However - I'm pretty sure this is actually the correct result, I'm just trying to access it in the wrong way ... Shape Tracing confirms the Shape itself has no ContentItem property, it's on the
Model tab instead ... but I want to know where can I access the model at a point where I can also add a Wrapper?

The the shape Creating/Created events are really to build a named shape before any
specific information is available. You can think of those events as firing right before and right after a parameterless constructor.

So the best use for those two events is if you want to change a shape's base class (on creating) or attach shape-specific system-wide behaviors (on created) before any method invokation or property assignment occurs.

OnDisplaying, on the other hand, fires after all of the dust is settled and you're just about to render. That moment gives you the greatest possible chance you'll be able to work with the final values that all of the different bits of code have thrown onto
the shape, no matter when or how they occured.

One last observation - if you really want to jump into the shape from the beginning - is that in the OnCreating (or created) ﻿events for a shape you can attach an additional behavior. That behavior can then see all of the property assignments and method
invocations as they occur - so from that standpoint you can have code that adds or updates a wrapper template when the ContentItem property is assigned.

I think that's a nice place to do it - I couldn't manage it in a Handler as you suggested in that other thread, I ended up just creating my own Driver for part I wanted to move, building custom shapes and hiding the normal ones. But it could be a bit of
a pain where shapes have a more complicated Display method.

I think an ideal thing would be to just introduce it into Placement.info at some stage, so you can use <Zone Shape_Name="Header"/>. Eventually :)