How do you find the default values ​​for controls in XAML?

I saw that in Blend you can see which properties have been changed and use the reset parameter to return to the default values.

Is there any other way to define default values ​​for a control?

Jd

+3
source share
3 answers

You can determine the default property value by examining the DefaultMetadatastatic property DependencyPropertyfor a particular class, for example:

TextBlock.TextProperty.DefaultMetadata.DefaultValue
+2
source

Properties in XAML are set by default if they are not explicitly defined. Therefore, Reset in Blend actually just removes the property from XAML.

, Color:

<MyControl Width="100" Color="Blue"/>

:

<MyControl Width="100"/>

, Blend - .

. , , , , XAMLPad. , .

+1

Snoop (, ).

0

Source: https://habr.com/ru/post/1727522/


All Articles