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

C#WpfXaml

C# Problem Overview


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

And this row:

d:DesignHeight="500" 
d:DesignWidth="300"

C# Solutions


Solution 1 - C#

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.

Solution 2 - C#

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.

Solution 3 - C#

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser2209075View Question on Stackoverflow
Solution 1 - C#Reed CopseyView Answer on Stackoverflow
Solution 2 - C#MarcinJuraszekView Answer on Stackoverflow
Solution 3 - C#bash.dView Answer on Stackoverflow