2

I have designer using Blend to desing windows phone pages. It has d:DesignHeight and d:DesignWidth set.

I use Visual Studio 2010 Express for Windows Phone. Now if I open any .xaml file in DesignMode, it reset the DesignHeight and Width. It is really annoying as I have to manually change back those values before checking in my changes to sourceControl.

Saw this one WPF UserControl Design Time Size but to do it in every page would be a stupidity for me.

Hope there is a switch in VS, which I am not aware of.

Any ideas please?

Update I have the following:

SupportedOrientations="Landscape"  Orientation="Landscape" 
shell:SystemTray.IsVisible="True" d:DesignHeight="800" d:DesignWidth="480"> 

When I view in Design Mode it changes to

d:DesignHeight="480" d:DesignWidth="782">
Community
  • 1
  • 1
oms
  • 441
  • 7
  • 17

1 Answers1

1

The Windows Phone has a fixed Page size (480x800 pixels)

When you design a Page the designer determines the appropriate size in the designer by looking at the orientation of the page and the visibility of the SystemTray:

SupportedOrientations="Portrait"  Orientation="Portrait"
shell:SystemTray.IsVisible="False">

My guess is that because you can only design Pages that are full screen, the designer keeps replacing custom set values for the height and width.

When creating a User Control (not a Page!) you are free to change the Height and Width any way you want.

Emond
  • 50,210
  • 11
  • 84
  • 115
  • Check my updated question. From your explanation, I think because my Landscape mode it is causing that. But then in that case the designer should be seeing that as well right? I will try few thing based on your explanation. Thanks. – oms Dec 19 '11 at 17:49
  • Yes, that is the intended behavior to enable you to design/see the page in the designer in both orientations. – Emond Dec 19 '11 at 18:09