【问题标题】:WPF - using user controls and setting design time height and widthWPF - 使用用户控件并设置设计时的高度和宽度
【发布时间】:2011-07-29 03:57:41
【问题描述】:

也许有人对此有答案。

我正在设计要添加到的用户控件 其他容器,它们要适合可用空间 他们的容器。

所以这意味着不设置 用户控制。

但是当我设计控件时我想看到它 有宽度和高度。

所以我当然不必继续设置和删除 控件的宽度和高度

这个怎么处理???

马尔科姆

【问题讨论】:

标签: wpf user-controls autosize


【解决方案1】:

使用这个

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

【讨论】:

  • 如果您解释说这仅在 Blend 和 Visual Studio 2010 中可用会有所帮助,因为它会使那些使用 Visual Studio 2008 的人失望。
猜你喜欢
  • 1970-01-01
  • 2013-02-07
  • 2012-08-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-02
  • 2012-05-06
相关资源
最近更新 更多