Skip to content

Commit 6135b8f

Browse files
authored
SolidColorBrush.Content is the ContentProperty of the class (#1776)
* SolidColorBrush.Content is the ContentProperty of the class. * Fix linter error.
1 parent f614746 commit 6135b8f

File tree

13 files changed

+26
-15
lines changed

13 files changed

+26
-15
lines changed

docs/fundamentals/controltemplate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ The [`TemplateBinding`](xref:Microsoft.Maui.Controls.Xaml.TemplateBindingExtensi
162162
- <xref:Microsoft.Maui.Controls.Xaml.TemplateBindingExtension.ConverterParameter>, of type `object`, the parameter to the binding value converter.
163163
- <xref:Microsoft.Maui.Controls.Xaml.TemplateBindingExtension.StringFormat>, of type `string`, the string format for the binding.
164164

165-
The `ContentProperty` for the [`TemplateBinding`](xref:Microsoft.Maui.Controls.Xaml.TemplateBindingExtension) markup extension is <xref:Microsoft.Maui.Controls.Xaml.TemplateBindingExtension.Path>. Therefore, the "Path=" part of the markup extension can be omitted if the path is the first item in the [`TemplateBinding`](xref:Microsoft.Maui.Controls.Xaml.TemplateBindingExtension) expression. For more information about using these properties in a binding expression, see [Data binding](~/fundamentals/data-binding/index.md).
165+
The [`ContentProperty`](xref:Microsoft.Maui.Controls.ContentPropertyAttribute) for the [`TemplateBinding`](xref:Microsoft.Maui.Controls.Xaml.TemplateBindingExtension) markup extension is <xref:Microsoft.Maui.Controls.Xaml.TemplateBindingExtension.Path>. Therefore, the "Path=" part of the markup extension can be omitted if the path is the first item in the [`TemplateBinding`](xref:Microsoft.Maui.Controls.Xaml.TemplateBindingExtension) expression. For more information about using these properties in a binding expression, see [Data binding](~/fundamentals/data-binding/index.md).
166166

167167
> [!WARNING]
168168
> The [`TemplateBinding`](xref:Microsoft.Maui.Controls.Xaml.TemplateBindingExtension) markup extension should only be used within a <xref:Microsoft.Maui.Controls.ControlTemplate>. However, attempting to use a [`TemplateBinding`](xref:Microsoft.Maui.Controls.Xaml.TemplateBindingExtension) expression outside of a <xref:Microsoft.Maui.Controls.ControlTemplate> will not result in a build error or an exception being thrown.

docs/user-interface/brushes/gradient.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Classes that derive from <xref:Microsoft.Maui.Controls.GradientBrush> describe d
1818
The <xref:Microsoft.Maui.Controls.GradientBrush> class defines the <xref:Microsoft.Maui.Controls.GradientBrush.GradientStops> property, of type <xref:Microsoft.Maui.Controls.GradientStopCollection>, which represents the brush's gradient stops, each of which specifies a color and an offset along the brush's gradient axis. A <xref:Microsoft.Maui.Controls.GradientStopCollection> is an `ObservableCollection` of <xref:Microsoft.Maui.Controls.GradientStop> objects. The <xref:Microsoft.Maui.Controls.GradientBrush.GradientStops> property is backed by a <xref:Microsoft.Maui.Controls.BindableProperty> object, which means that it can be the target of data bindings, and styled.
1919

2020
> [!NOTE]
21-
> The <xref:Microsoft.Maui.Controls.GradientBrush.GradientStops> property is the `ContentProperty` of the <xref:Microsoft.Maui.Controls.GradientBrush> class, and so does not need to be explicitly set from XAML.
21+
> The <xref:Microsoft.Maui.Controls.GradientBrush.GradientStops> property is the [`ContentProperty`](xref:Microsoft.Maui.Controls.ContentPropertyAttribute) of the <xref:Microsoft.Maui.Controls.GradientBrush> class, and so does not need to be explicitly set from XAML.
2222
2323
## Gradient stops
2424

docs/user-interface/brushes/solidcolor.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ ms.date: 01/11/2022
1010

1111
The .NET Multi-platform App UI (.NET MAUI) <xref:Microsoft.Maui.Controls.SolidColorBrush> class derives from the <xref:Microsoft.Maui.Controls.Brush> class, and is used to paint an area with a solid color. There are a variety of approaches to specifying the color of a <xref:Microsoft.Maui.Controls.SolidColorBrush>. For example, you can specify its color with a <xref:Microsoft.Maui.Graphics.Color> value or by using one of the predefined <xref:Microsoft.Maui.Controls.SolidColorBrush> objects provided by the <xref:Microsoft.Maui.Controls.Brush> class.
1212

13+
::: moniker range="=net-maui-7.0"
14+
1315
The <xref:Microsoft.Maui.Controls.SolidColorBrush> class defines the `Color` property, of type <xref:Microsoft.Maui.Graphics.Color>, which represents the color of the brush. This property is backed by a <xref:Microsoft.Maui.Controls.BindableProperty> object, which means that it can be the target of data bindings, and styled.
1416

17+
::: moniker-end
18+
19+
::: moniker range=">=net-maui-8.0"
20+
21+
The <xref:Microsoft.Maui.Controls.SolidColorBrush> class defines the `Color` property, of type <xref:Microsoft.Maui.Graphics.Color>, which represents the color of the brush. This property is the [`ContentProperty`](xref:Microsoft.Maui.Controls.ContentPropertyAttribute) of the <xref:Microsoft.Maui.Controls.SolidColorBrush> class, and therefore does not need to be explicitly set from XAML. In addition, this property is backed by a <xref:Microsoft.Maui.Controls.BindableProperty> object, which means that it can be the target of data bindings, and styled.
22+
23+
::: moniker-end
24+
1525
The <xref:Microsoft.Maui.Controls.SolidColorBrush> class also has an `IsEmpty` method that returns a `bool` that represents whether the brush has been assigned a color.
1626

1727
## Create a SolidColorBrush

docs/user-interface/controls/border.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The .NET Multi-platform App UI (.NET MAUI) <xref:Microsoft.Maui.Controls.Border>
1212

1313
<xref:Microsoft.Maui.Controls.Border> defines the following properties:
1414

15-
- `Content`, of type `IView`, represents the content to display in the border. This property is the `ContentProperty` of the <xref:Microsoft.Maui.Controls.Border> class, and therefore does not need to be explicitly set from XAML.
15+
- `Content`, of type `IView`, represents the content to display in the border. This property is the [`ContentProperty`](xref:Microsoft.Maui.Controls.ContentPropertyAttribute) of the <xref:Microsoft.Maui.Controls.Border> class, and therefore does not need to be explicitly set from XAML.
1616
- `Padding`, of type `Thickness`, represents the distance between the border and its child element.
1717
- `StrokeShape`, of type `IShape`, describes the shape of the border. This property has a type converter applied to it that can convert a string to its equivalent `IShape`. It's default value is <xref:Microsoft.Maui.Controls.Shapes.Rectangle>. Therefore, a <xref:Microsoft.Maui.Controls.Border> will be rectangular by default.
1818
- `Stroke`, of type <xref:Microsoft.Maui.Controls.Brush>, indicates the brush used to paint the border.

docs/user-interface/controls/frame.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The <xref:Microsoft.Maui.Controls.Frame> class defines the following properties:
1616

1717
These properties are backed by <xref:Microsoft.Maui.Controls.BindableProperty> objects, which means that they can be targets of data bindings, and styled.
1818

19-
The <xref:Microsoft.Maui.Controls.Frame> class inherits from <xref:Microsoft.Maui.Controls.ContentView>, which provides a `Content` bindable property. The `Content` property is the `ContentProperty` of the <xref:Microsoft.Maui.Controls.Frame> class, and therefore does not need to be explicitly set from XAML.
19+
The <xref:Microsoft.Maui.Controls.Frame> class inherits from <xref:Microsoft.Maui.Controls.ContentView>, which provides a `Content` bindable property. The `Content` property is the [`ContentProperty`](xref:Microsoft.Maui.Controls.ContentPropertyAttribute) of the <xref:Microsoft.Maui.Controls.Frame> class, and therefore does not need to be explicitly set from XAML.
2020

2121
> [!NOTE]
2222
> The <xref:Microsoft.Maui.Controls.Frame> class existed in Xamarin.Forms and is present in .NET MAUI for users who are migrating their apps from Xamarin.Forms to .NET MAUI. If you're building a new .NET MAUI app it's recommended to use <xref:Microsoft.Maui.Controls.Border> instead, and to set shadows using the `Shadow` bindable property on <xref:Microsoft.Maui.Controls.VisualElement>. For more information, see [Border](border.md) and [Shadow](../shadow.md).

docs/user-interface/controls/label.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Alternatively, for greater readability the HTML can be inlined in a `CDATA` sect
186186
</Label>
187187
```
188188

189-
In this example, the `Text` property is set to the HTML string that's inlined in the `CDATA` section. This works because the `Text` property is the `ContentProperty` for the <xref:Microsoft.Maui.Controls.Label> class.
189+
In this example, the `Text` property is set to the HTML string that's inlined in the `CDATA` section. This works because the `Text` property is the [`ContentProperty`](xref:Microsoft.Maui.Controls.ContentPropertyAttribute) for the <xref:Microsoft.Maui.Controls.Label> class.
190190

191191
> [!IMPORTANT]
192192
> Displaying HTML in a <xref:Microsoft.Maui.Controls.Label> is limited to the HTML tags that are supported by the underlying platform.

docs/user-interface/controls/scrollview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The .NET Multi-platform App UI (.NET MAUI) <xref:Microsoft.Maui.Controls.ScrollV
2222

2323
These properties are backed by <xref:Microsoft.Maui.Controls.BindableProperty> objects, with the exception of the `Content` property, which means that they can be targets of data bindings and styled.
2424

25-
The `Content` property is the `ContentProperty` of the <xref:Microsoft.Maui.Controls.ScrollView> class, and therefore does not need to be explicitly set from XAML.
25+
The `Content` property is the [`ContentProperty`](xref:Microsoft.Maui.Controls.ContentPropertyAttribute) of the <xref:Microsoft.Maui.Controls.ScrollView> class, and therefore does not need to be explicitly set from XAML.
2626

2727
> [!WARNING]
2828
> <xref:Microsoft.Maui.Controls.ScrollView> objects should not be nested. In addition, <xref:Microsoft.Maui.Controls.ScrollView> objects should not be nested with other controls that provide scrolling, such as <xref:Microsoft.Maui.Controls.CollectionView>, <xref:Microsoft.Maui.Controls.ListView>, and <xref:Microsoft.Maui.Controls.WebView>.

docs/user-interface/controls/shapes/geometries.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ These properties are backed by <xref:Microsoft.Maui.Controls.BindableProperty> o
127127
For more information about the <xref:Microsoft.Maui.Controls.Shapes.FillRule> enumeration, see [.NET MAUI Shapes: Fill rules](fillrules.md).
128128

129129
> [!NOTE]
130-
> The <xref:Microsoft.Maui.Controls.Shapes.PathGeometry.Figures> property is the `ContentProperty` of the <xref:Microsoft.Maui.Controls.Shapes.PathGeometry> class, and so does not need to be explicitly set from XAML.
130+
> The <xref:Microsoft.Maui.Controls.Shapes.PathGeometry.Figures> property is the [`ContentProperty`](xref:Microsoft.Maui.Controls.ContentPropertyAttribute) of the <xref:Microsoft.Maui.Controls.Shapes.PathGeometry> class, and so does not need to be explicitly set from XAML.
131131
132132
A <xref:Microsoft.Maui.Controls.Shapes.PathGeometry> is made up of a collection of <xref:Microsoft.Maui.Controls.Shapes.PathFigure> objects, with each <xref:Microsoft.Maui.Controls.Shapes.PathFigure> describing a shape in the geometry. Each <xref:Microsoft.Maui.Controls.Shapes.PathFigure> is itself comprised of one or more <xref:Microsoft.Maui.Controls.Shapes.PathSegment> objects, each of which describes a segment of the shape. There are many types of segments:
133133

@@ -539,7 +539,7 @@ The <xref:Microsoft.Maui.Controls.Shapes.GeometryGroup> class defines the follow
539539
These properties are backed by <xref:Microsoft.Maui.Controls.BindableProperty> objects, which means that they can be targets of data bindings, and styled.
540540

541541
> [!NOTE]
542-
> The `Children` property is the `ContentProperty` of the <xref:Microsoft.Maui.Controls.Shapes.GeometryGroup> class, and so does not need to be explicitly set from XAML.
542+
> The `Children` property is the [`ContentProperty`](xref:Microsoft.Maui.Controls.ContentPropertyAttribute) of the <xref:Microsoft.Maui.Controls.Shapes.GeometryGroup> class, and so does not need to be explicitly set from XAML.
543543
544544
For more information about the <xref:Microsoft.Maui.Controls.Shapes.FillRule> enumeration, see [Fill rules](fillrules.md).
545545

docs/user-interface/pages/tabbedpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ A <xref:Microsoft.Maui.Controls.TabbedPage> can be populated with a collection o
5858
</TabbedPage>
5959
```
6060

61-
<xref:Microsoft.Maui.Controls.Page> objects that are added as child elements of <xref:Microsoft.Maui.Controls.TabbedPage> are added to the `Children` collection. The `Children` property of the `MultiPage<T>` class, from which <xref:Microsoft.Maui.Controls.TabbedPage> derives, is the `ContentProperty` of `MultiPage<T>`. Therefore, in XAML it's not necessary to explicitly assign the <xref:Microsoft.Maui.Controls.Page> objects to the `Children` property.
61+
<xref:Microsoft.Maui.Controls.Page> objects that are added as child elements of <xref:Microsoft.Maui.Controls.TabbedPage> are added to the `Children` collection. The `Children` property of the `MultiPage<T>` class, from which <xref:Microsoft.Maui.Controls.TabbedPage> derives, is the [`ContentProperty`](xref:Microsoft.Maui.Controls.ContentPropertyAttribute) of `MultiPage<T>`. Therefore, in XAML it's not necessary to explicitly assign the <xref:Microsoft.Maui.Controls.Page> objects to the `Children` property.
6262

6363
The following screenshot shows the appearance of the resulting tab bar on the <xref:Microsoft.Maui.Controls.TabbedPage>:
6464

docs/whats-new/dotnet-8.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ For information about what's new in .NET 8, see [What's new in .NET 8](/dotnet/c
2020
- <xref:Microsoft.Maui.Controls.PointerGestureRecognizer> gains `PointerPressedCommand`, `PointerPressedCommandParameter`, `PointerReleasedCommand`, `PointerReleasedCommandParameter` properties, and `PointerPressed` and `PointerReleased` events. For more information, see [Recognize a pointer gesture](~/fundamentals/gestures/pointer.md).
2121
- <xref:Microsoft.Maui.Devices.Flashlight> gains a `IsSupportedAsync` method that determines whether a flashlight is available on the device. For more information, see [Flashlight](~/platform-integration/device/flashlight.md).
2222
- <xref:Microsoft.Maui.Devices.Sensors.SensorSpeed> intervals have been unified across all platforms. For more information, see [Accessing device sensors](~/platform-integration/device/sensors.md).
23+
- <xref:Microsoft.Maui.Controls.SolidColorBrush.Color> is the [`ContentProperty`](xref:Microsoft.Maui.Controls.ContentPropertyAttribute) of the <xref:Microsoft.Maui.Controls.SolidColorBrush> class, and therefore does not need to be explicitly set from XAML.
2324

2425
The following members have been deprecated:
2526

0 commit comments

Comments
 (0)