void EnterTransitionCoordinator::SetSharedElementMatrices()
{
    Int32 numSharedElements;
    mSharedElements->GetSize(&numSharedElements);
    if (numSharedElements > 0) {
        mSharedElementParentMatrices = new List<AutoPtr<IMatrix> >();
    }
    for (Int32 i = 0; i < numSharedElements; i++) {
        AutoPtr<IInterface> obj;
        mSharedElements->Get(i, (IInterface**)&obj);
        IView* view = IView::Probe(obj);

        // Find the location in the view's parent
        AutoPtr<IViewParent> vp;
        view->GetParent((IViewParent**)&vp);
        IView* parent = IView::Probe(vp);
        AutoPtr<IMatrix> matrix;
        CMatrix::New((IMatrix**)&matrix);
        parent->TransformMatrixToLocal(matrix);

        mSharedElementParentMatrices->PushBack(matrix);
    }
}