Reputation: 139
I'm trying to create a windows phone landscape layout a below, but i can't get the overlap any further than the default setting. I have tried to force it to by over stretching the next item but when i scroll to the next item it cuts it off, any ideas how to get this layout.
Upvotes: 2
Views: 68
Reputation: 8161
Borrowing from panorama-item-to-be-full-screen. We can modify it to use any margin you like.
public class PanoramaFullScreen : Panorama
{
protected override System.Windows.Size MeasureOverride(System.Windows.Size availableSize)
{
int _extraMargin = -150; // calculate how much you need
availableSize.Width += _extraMargin;
return base.MeasureOverride(availableSize);
}
}
Then added the namespace of your project to the XAML so you can use your custom control.
<phone:PhoneApplicationPage
xmlns:custom="clr-namespace:YOUR_NAME_SPACE">
Then you can use your Custom Panorama.
<custom:PanoramaFullScreen>
<phone:PanoramaItem Header="One">
<TextBlock Text="One"/>
</phone:PanoramaItem>
<phone:PanoramaItem Header="Two">
<TextBlock Text="Two"/>
</phone:PanoramaItem>
</custom:PanoramaFullScreen>
Upvotes: 1