I would like to define the DesignWidth
value with a constant but the view it does not seem to have the defined width in Blend.
I have a Constants.class
public static class Constants
{
public static int ApplicationWidth { get { return 1280;} }
public static int ApplicationHeight { get { return 720; } }
}
and the View.xaml
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:constants="clr-namespace:app.Constants"
d:DesignWidth="{x:Static constants:Constants.ApplicationWidth}">
</UserControl>
In Visual Studio the View Width is 267px
and in Blend is 262px
. How can I set the Width
without hard coding the values in the XAML
files in order to have the desired size in Blend an Visual Studio ?
Contants
class should be static? Just a thought. – Mike Eason Jul 3 '15 at 13:11