You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/styles-and-resources/troubleshooting.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,16 +24,16 @@ Check whether you have used a child selector where there are no children to matc
24
24
25
25
Styles are applied in order of declaration. If there are multiple style files included that target the same control property, the last style included will override the previous ones. For example:
26
26
27
-
```xml
27
+
```xml title="Style1.axaml"
28
28
<StyleSelector="TextBlock.header">
29
-
<StyleProperty="Foreground"Value="Green" />
29
+
<SetterProperty="Foreground"Value="Green" />
30
30
</Style>
31
31
```
32
32
33
-
```xml
33
+
```xml title="Style2.axaml"
34
34
<StyleSelector="TextBlock.header">
35
-
<StyleProperty="Foreground"Value="Blue" />
36
-
<StyleProperty="FontSize"Value="16" />
35
+
<SetterProperty="Foreground"Value="Blue" />
36
+
<SetterProperty="FontSize"Value="16" />
37
37
</Style>
38
38
```
39
39
@@ -58,7 +58,14 @@ A local value defined directly on a control often has higher priority than any s
58
58
59
59
You can see the full list of value priorities in the `BindingPriority` enum, where lower enum values have the higher priority.
60
60
61
-
<table><thead><tr><thwidth="218">BindingPriority </th><thwidth="147.33333333333331">Value</th><th>Comment</th></tr></thead><tbody><tr><td><code>Animation</code></td><td>-1</td><td>The highest priority - even overrides a local value</td></tr><tr><td><code>LocalValue</code></td><td>0</td><td>A local value is set on the property of the control.</td></tr><tr><td><code>StyleTrigger</code></td><td>1</td><td>This is triggered when a pseudo class becomes active.</td></tr><tr><td><code>TemplatedParent</code></td><td>2</td><td></td></tr><tr><td><code>Style</code></td><td>3</td><td></td></tr><tr><td><code>Unset</code></td><td>2147483647</td><td></td></tr></tbody></table>
|`Animation`| -1 | The highest priority - even overrides a local value |
64
+
|`LocalValue`| 0 | A local value is set on the property of the control. |
65
+
|`StyleTrigger`| 1 | This is triggered when a style becomes active. |
66
+
|`Template`| 2 ||
67
+
|`Style`| 3 ||
68
+
|`Unset`| 2147483647 ||
62
69
63
70
:::warning
64
71
The exception is that `Animation` values have the highest priority and can even override local values.
@@ -104,7 +111,7 @@ The following code example of styles that can be expected to work on top of defa
104
111
105
112
You might expect the `Button` to be red by default and blue when pointer is over it. In fact, only setter of first style will be applied, and second one will be ignored.
106
113
107
-
The reason is hidden in the Button's template. You can find the default templates in the Avalonia source code (old [Default](https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Themes.Default/Button.xaml) theme and new[Fluent](https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Themes.Fluent/Controls/Button.xaml) theme), but for convenience here we have simplified one from the Fluent theme:
114
+
The reason is hidden in the Button's template. You can find the default templates in the Avalonia source code ([Simple](https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Themes.Simple/Controls/Button.xaml) theme and [Fluent](https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Themes.Fluent/Controls/Button.xaml) theme), but for convenience here we have simplified one from the Fluent theme:
108
115
109
116
```xml
110
117
<StyleSelector="Button">
@@ -132,7 +139,7 @@ The actual background is rendered by a `ContentPresenter`, which in the default
132
139
```
133
140
134
141
:::info
135
-
You can see this behavior for all controls in the default themes (both old Default and the new Fluent), not just Button. And not just for Background, but also other state-dependent properties.
142
+
You can see this behavior for all controls in the default themes (both Simple and Fluent), not just Button. And not just for Background, but also other state-dependent properties.
Copy file name to clipboardExpand all lines: i18n/ru/docusaurus-plugin-content-docs/current/guides/styles-and-resources/troubleshooting.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,16 +24,16 @@ Check whether you have used a child selector where there are no children to matc
24
24
25
25
Styles are applied in order of declaration. If there are multiple style files included that target the same control property, the last style included will override the previous ones. For example:
26
26
27
-
```xml
27
+
```xml title="Style1.axaml"
28
28
<StyleSelector="TextBlock.header">
29
-
<StyleProperty="Foreground"Value="Green" />
29
+
<SetterProperty="Foreground"Value="Green" />
30
30
</Style>
31
31
```
32
32
33
-
```xml
33
+
```xml title="Style2.axaml"
34
34
<StyleSelector="TextBlock.header">
35
-
<StyleProperty="Foreground"Value="Blue" />
36
-
<StyleProperty="FontSize"Value="16" />
35
+
<SetterProperty="Foreground"Value="Blue" />
36
+
<SetterProperty="FontSize"Value="16" />
37
37
</Style>
38
38
```
39
39
@@ -58,7 +58,14 @@ A local value defined directly on a control often has higher priority than any s
58
58
59
59
You can see the full list of value priorities in the `BindingPriority` enum, where lower enum values have the higher priority.
60
60
61
-
<table><thead><tr><thwidth="218">BindingPriority </th><thwidth="147.33333333333331">Value</th><th>Comment</th></tr></thead><tbody><tr><td><code>Animation</code></td><td>-1</td><td>The highest priority - even overrides a local value</td></tr><tr><td><code>LocalValue</code></td><td>0</td><td>A local value is set on the property of the control.</td></tr><tr><td><code>StyleTrigger</code></td><td>1</td><td>This is triggered when a pseudo class becomes active.</td></tr><tr><td><code>TemplatedParent</code></td><td>2</td><td></td></tr><tr><td><code>Style</code></td><td>3</td><td></td></tr><tr><td><code>Unset</code></td><td>2147483647</td><td></td></tr></tbody></table>
|`Animation`| -1 | The highest priority - even overrides a local value |
64
+
|`LocalValue`| 0 | A local value is set on the property of the control. |
65
+
|`StyleTrigger`| 1 | This is triggered when a style becomes active. |
66
+
|`Template`| 2 ||
67
+
|`Style`| 3 ||
68
+
|`Unset`| 2147483647 ||
62
69
63
70
:::warning
64
71
The exception is that `Animation` values have the highest priority and can even override local values.
@@ -104,7 +111,7 @@ The following code example of styles that can be expected to work on top of defa
104
111
105
112
You might expect the `Button` to be red by default and blue when pointer is over it. In fact, only setter of first style will be applied, and second one will be ignored.
106
113
107
-
The reason is hidden in the Button's template. You can find the default templates in the Avalonia source code (old [Default](https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Themes.Default/Button.xaml) theme and new[Fluent](https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Themes.Fluent/Controls/Button.xaml) theme), but for convenience here we have simplified one from the Fluent theme:
114
+
The reason is hidden in the Button's template. You can find the default templates in the Avalonia source code ([Simple](https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Themes.Simple/Controls/Button.xaml) theme and [Fluent](https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Themes.Fluent/Controls/Button.xaml) theme), but for convenience here we have simplified one from the Fluent theme:
108
115
109
116
```xml
110
117
<StyleSelector="Button">
@@ -132,7 +139,7 @@ The actual background is rendered by a `ContentPresenter`, which in the default
132
139
```
133
140
134
141
:::info
135
-
You can see this behavior for all controls in the default themes (both old Default and the new Fluent), not just Button. And not just for Background, but also other state-dependent properties.
142
+
You can see this behavior for all controls in the default themes (both Simple and Fluent), not just Button. And not just for Background, but also other state-dependent properties.
0 commit comments