What does mc:Ignorable=“d” mean in WPF?

后端 未结 3 1540
执念已碎
执念已碎 2021-01-30 12:21

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

And this row:

d:DesignHeight=\"500\" 
d:DesignWidth=\"300\"
相关标签:
3条回答
  • 2021-01-30 12:41

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

    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.

    0 讨论(0)
  • 2021-01-30 12:55

    The mc:Ignorable namespace provides xaml definitions that are "ignored" by the xaml processor.

    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.

    0 讨论(0)
  • 2021-01-30 13:00

    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.

    There is an article on the topic.

    0 讨论(0)
提交回复
热议问题