views:

171

answers:

1

I am working with Blend and Visual Studio to create Surface content. Pretty much every item I place and customize in Blend will look different at runtime or when looked at in Visual Studio.

The cause of this seems to be because width/height is not always set in the XAML-file - only margins. If the size of the workspace is different this will obviously cause problems.

Where do I check/set the size of the project in Blend and how do I make sure that the items/animations I make in Blend will look the same when i build the project? (using absolute placement?)

Resizing a button or 2 is no big deal, but when I've made an animation and every items has changed place at runtime, things looks really stupid.

EDIT: Even if I manually set the width in XAML, it will be removed (and margins will be updated) if I ever try to resize it in design mode.

+1  A: 

I got this question answered on the Surface community site:

"You will probably have better luck if you set the height and width of the main SurfaceWindow in the XAML file. At runtime the SurfaceWindow's height/width is set to the Surface screen's size, but at design time in Blend there is no height and width and this can cause problems with designers. So change your main window to something like this:"

<s:SurfaceWindow x:Class="SurfaceApplication1.SurfaceWindow1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:s="http://schemas.microsoft.com/surface/2008"
        Title="SurfaceApplication1"
        Height="768"
        Width="1024"
        >
Vargen