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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 17:50:57  来源:igfitidea点击:

What does mc:Ignorable="d" mean in WPF?

c#wpfxaml

提问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:Ignorablenamespace 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 DesignHeightand DesignWidth, which are not "real" properties on a Window, but work in the designer for providing a default design time experience.

这允许您指定设计人员在设计时使用的信息,而这些信息在运行时会被忽略。在您的情况下,您可以指定DesignHeightand DesignWidth,它们不是 上的“真实”属性Window,而是在设计器中工作以提供默认设计时体验。

回答by MarcinJuraszek

mc:Ignorable="d"sets d:prefix as a mark for attributes used in design. Read more on MSDN: mc:IgnorableAttribute

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 namespacein 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.

这是namespaceWPF 中预定义的,在设计时使用,但在实际编译和执行时将被忽略。它将显示您的设计时选择,但对实际布局没有影响。

There is an articleon the topic.

一篇关于该主题的文章