C# mc:Ignorable="d" 在 WPF 中是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15749584/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does mc:Ignorable="d" mean in WPF?
提问by user2209075
What does mc:Ignorable="d"
mean in WPF?
mc:Ignorable="d"
在 WPF中是什么意思?
And this row:
而这一行:
d:DesignHeight="500"
d:DesignWidth="300"
回答by Reed Copsey
The mc:Ignorable
namespace provides xaml definitions that are "ignored" by the xaml processor.
该mc:Ignorable
命名空间提供了由XAML处理器“忽略” XAML定义。
This allows you to specify information used by the designer at design time which is ignored at runtime. In your case, you can specify DesignHeight
and DesignWidth
, which are not "real" properties on a Window
, but work in the designer for providing a default design time experience.
这允许您指定设计人员在设计时使用的信息,而这些信息在运行时会被忽略。在您的情况下,您可以指定DesignHeight
and DesignWidth
,它们不是 上的“真实”属性Window
,而是在设计器中工作以提供默认设计时体验。
回答by MarcinJuraszek
mc:Ignorable="d"
sets d:
prefix as a mark for attributes used in design. Read more on MSDN: mc:Ignorable
Attribute
mc:Ignorable="d"
将d:
前缀设置为设计中使用的属性的标记。在 MSDN 上阅读更多信息:mc:Ignorable
属性
d:DesignHeight="500"
and d:DesignWidth="300"
use that d:
prefix, what makes them available only during design time - they are ignored after standard program compilation.
d:DesignHeight="500"
并d:DesignWidth="300"
使用该d:
前缀,这使得它们仅在设计时可用 - 在标准程序编译后它们将被忽略。
回答by bash.d
This a predefined namespace
in WPF to be used in design-time,r but will be ignored when actually compiled and executed. It will display your design-time choices but has no effect on the actual layout.
这是namespace
WPF 中预定义的,在设计时使用,但在实际编译和执行时将被忽略。它将显示您的设计时选择,但对实际布局没有影响。
There is an articleon the topic.