If your Windows Phone 7 application includes a Panorama with a background, you may have seen seams—one pixel wide lines darker than the background image’s color—where the background loops around and the right edge meets the left edge, or vice versa. This happens when background is being animated, during panning, flicking, etc., and the background doesn’t happen to be drawn on a whole pixel boundary.
I had a heck of a time trying to get a screen shot of a Panorama with this artifact, since that means I’d need to take a screen shot of the emulator while panning, during a flick, etc. (Actually, I gave up almost instantly.) I was going to draw a picture with Paint, but I think everybody can imagine what a vertical line that goes from the top to the bottom of a Panorama looks like. I bet you can even imagine it flashing while you pan. So let’s move on.
The trick to getting rid of that line is to overlap the edges of the background. And the way to do that is to retemplate the Panorama to use some negative Margin.
Here’s what that XAML looks like:
Notice the Margin added to the Border named “background” (line 29). That’s the only change in the Panorama template.