AdornmentPositioningBehavior.ViewportRelative seems to relative top left corner of viewport, but I wana to set adornment relative to the top right corner of a viewport. I also look into the code of 'Microsoft.VisualStudio.Platform.VSEditor.dll', the implement code seems to only care about Grid.Left and Grid.Top which does not care Grid.Right so when I attach Grid.Right to the custom element does not work.
Are there any other methods or suggestion?
Problem Details:
implement a custom adornment to the textedtior's AdornmentLayer and make its position relative to the top right corner of the viewport. The reason I want to make its position realtive to the top right corner of a viewport is that the element in the adornment has an automatic size.
msdn 论坛回复