简体   繁体   中英

Silverlight AutoSize and Visual Studio 2010 for Windows Phone

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">

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM