I have the ProjectItem, and want to get the IWPFTextView that is associated with it, if any.
I have tried to get an IVsTextManager, and then iterate through the view
I know it has been a while since this question has been answered, but hopefully the following code for retrieving the IWpfTextView from the IVsTextView will help someone else:
private IWpfTextView GetWpfTextView(IVsTextView vTextView)
{
IWpfTextView view = null;
IVsUserData userData = vTextView as IVsUserData;
if (null != userData)
{
IWpfTextViewHost viewHost;
object holder;
Guid guidViewHost = DefGuidList.guidIWpfTextViewHost;
userData.GetData(ref guidViewHost, out holder);
viewHost = (IWpfTextViewHost)holder;
view = viewHost.TextView;
}
return view;
}