两者都是,Height
并且当您为控件注册依赖属性时,您可以设置or可以使用的依赖属性的默认值。Width
Dependency Properties
Visual Studio
XAML designer
默认值在FrameworkPropertyMatadata
类构造函数中设置,如下代码所示:
//Default value is set to Top
Control.VerticalContentAlignmentProperty = DependencyProperty.Register("VerticalContentAlignment", typeof(VerticalAlignment), typeof(Control), new FrameworkPropertyMetadata(VerticalAlignment.Top), new ValidateValueCallback(FrameworkElement.ValidateVerticalAlignmentValue));
//Default value is set to Left
Control.HorizontalContentAlignmentProperty = DependencyProperty.Register("HorizontalContentAlignment", typeof(HorizontalAlignment), typeof(Control), new FrameworkPropertyMetadata(HorizontalAlignment.Left), new ValidateValueCallback(FrameworkElement.ValidateHorizontalAlignmentValue));