moh*_*mad 28 c# wpf xaml user-controls
当我UserControl
在WPF中创建一个新的时,studio会创建一些XAML:
<UserControl x:Class="MOG.Objects.Date.Calender"
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="300" d:DesignWidth="300">
<Grid>
</Grid>
</UserControl>
Run Code Online (Sandbox Code Playgroud)
在UserContol
我还可以添加Width属性.DesignWidth
和之间有什么区别Width
?
Rhy*_*ous 70
d:DesignHeight
并且d.DesignWidth
是为设计师(所见即所得),在Visual Studio或Expression Blend中.Height
并且Width
实际上是用于运行时.