This is about 5th time I am changing this code, and every time when it looks right on Windows 7, popup position is way off on Windows 8, and vice versa. I don't know if it is the order of calling or something else.
Button b = (Button)sender;
Popup1.Placement = PlacementMode.Left;
Popup1.PlacementTarget = b;
Popup1.HorizontalOffset = b.RenderSize.Width; //original button shall be covered with popup
Popup1.VerticalOffset = 0;
Popup1.IsOpen = true;
It is always horizontally offset. I also tried Popup1.HorizontalOffset = b.ActualWidth;