Malcolm
Malcolm

Reputation: 12864

WPF - using user controls and setting design time height and width

Maybe someone has an answer for this.

I am designing user controls that are to be added to other containers and they are to fit the available space of their container.

So this means not setting the height and width of the user control.

But when I am designing the control I want to see it with a width and height.

So surely I dont have to keep setting and removing the wdth and height of the control

How can this be handled???

Malcolm

Upvotes: 4

Views: 7137

Answers (1)

Sauron
Sauron

Reputation: 16903

Use this

<UserControl x:Class="MyApp.UserControl1"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" 
         d:DesignHeight="500" d:DesignWidth="600">

Upvotes: 6

Related Questions