WPF中UserControl中DesignWidth和Width的区别区别、UserControl、WPF、Width

2023-09-07 15:07:34 作者:酒肆饮几壶

When I create a new UserControl in WPF, studio creates some 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>

In UserContol I can also add Width property. What is difference between DesignWidth and Width?

解决方案 wpf中TabControl的TabItem如何平分宽度,让他平均分布在整个面板中

d:DesignHeight and d.DesignWidth are for the Designer (the WYSIWYG), in Visual Studio or in Expression Blend. Height and Width are actually for runtime.

 
精彩推荐