Brush 类

定义

定义用于绘制区域的核心行为和内置颜色。

public ref class Brush abstract : Microsoft::Maui::Controls::Element
[System.ComponentModel.TypeConverter(typeof(Microsoft.Maui.Controls.BrushTypeConverter))]
public abstract class Brush : Microsoft.Maui.Controls.Element
[<System.ComponentModel.TypeConverter(typeof(Microsoft.Maui.Controls.BrushTypeConverter))>]
type Brush = class
    inherit Element
Public MustInherit Class Brush
Inherits Element
继承
派生
属性

注解

派生类描述绘制区域的不同方式。

构造函数

Brush()

定义用于绘制区域的核心行为和内置颜色。

属性

AliceBlue

SolidColorBrush获取系统定义的颜色AliceBlue

AntiqueWhite

SolidColorBrush获取系统定义的颜色AntiqueWhite

Aqua

SolidColorBrush获取系统定义的颜色Aqua

Aquamarine

SolidColorBrush获取系统定义的颜色Aquamarine

AutomationId

获取或设置允许自动化框架查找此元素并与其交互的值。

(继承自 Element)
Azure

SolidColorBrush获取系统定义的颜色Azure

Beige

SolidColorBrush获取系统定义的颜色Beige

BindingContext

获取或设置一个对象,该对象包含由属于此 BindableObject属性的绑定属性所面向的属性。 这是一种可绑定属性。

(继承自 BindableObject)
Bisque

SolidColorBrush获取系统定义的颜色Bisque

Black

SolidColorBrush获取系统定义的颜色Black

BlanchedAlmond

SolidColorBrush获取系统定义的颜色BlanchedAlmond

Blue

SolidColorBrush获取系统定义的颜色Blue

BlueViolet

SolidColorBrush获取系统定义的颜色BlueViolet

Brown

SolidColorBrush获取系统定义的颜色Brown

BurlyWood

SolidColorBrush获取系统定义的颜色BurlyWood

CadetBlue

SolidColorBrush获取系统定义的颜色CadetBlue

Chartreuse

SolidColorBrush获取系统定义的颜色Chartreuse

Chocolate

SolidColorBrush获取系统定义的颜色Chocolate

ClassId

获取或设置用于标识语义相似元素集合的值。

(继承自 Element)
Coral

SolidColorBrush获取系统定义的颜色Coral

CornflowerBlue

SolidColorBrush获取系统定义的颜色CornflowerBlue

Cornsilk

SolidColorBrush获取系统定义的颜色Cornsilk

Crimson

SolidColorBrush获取系统定义的颜色Crimson

Cyan

SolidColorBrush获取系统定义的颜色Cyan

DarkBlue

SolidColorBrush获取系统定义的颜色DarkBlue

DarkCyan

SolidColorBrush获取系统定义的颜色DarkCyan

DarkGoldenrod

SolidColorBrush获取系统定义的颜色DarkGoldenrod

DarkGray

SolidColorBrush获取系统定义的颜色DarkGray

DarkGreen

SolidColorBrush获取系统定义的颜色DarkGreen

DarkKhaki

SolidColorBrush获取系统定义的颜色DarkKhaki

DarkMagenta

SolidColorBrush获取系统定义的颜色DarkMagenta

DarkOliveGreen

SolidColorBrush获取系统定义的颜色DarkOliveGreen

DarkOrange

SolidColorBrush获取系统定义的颜色DarkOrange

DarkOrchid

SolidColorBrush获取系统定义的颜色DarkOrchid

DarkRed

SolidColorBrush获取系统定义的颜色DarkRed

DarkSalmon

SolidColorBrush获取系统定义的颜色DarkSalmon

DarkSeaGreen

SolidColorBrush获取系统定义的颜色DarkSeaGreen

DarkSlateBlue

SolidColorBrush获取系统定义的颜色DarkSlateBlue

DarkSlateGray

SolidColorBrush获取系统定义的颜色DarkSlateGray

DarkTurquoise

SolidColorBrush获取系统定义的颜色DarkTurquoise

DarkViolet

SolidColorBrush获取系统定义的颜色DarkViolet

DeepPink

SolidColorBrush获取系统定义的颜色DeepPink

DeepSkyBlue

SolidColorBrush获取系统定义的颜色DeepSkyBlue

Default

表示默认的(空)画笔。

DimGray

SolidColorBrush获取系统定义的颜色DimGray

Dispatcher

获取创建此可绑定对象时可用的调度程序,否则会尝试查找最近的可用调度程序(可能是窗口的/应用)。

(继承自 BindableObject)
DodgerBlue

SolidColorBrush获取系统定义的颜色DodgerBlue

EffectControlProvider

供 .NET MAUI 内部使用。

(继承自 Element)
Effects

获取或设置将在运行时应用于元素的样式和属性。

(继承自 Element)
Firebrick

SolidColorBrush获取系统定义的颜色Firebrick

FloralWhite

SolidColorBrush获取系统定义的颜色FloralWhite

ForestGreen

SolidColorBrush获取系统定义的颜色ForestGreen

Fuchsia

SolidColorBrush获取系统定义的颜色Fuchsia

Gainsboro

SolidColorBrush获取系统定义的颜色Gainsboro

GhostWhite

SolidColorBrush获取系统定义的颜色GhostWhite

Gold

SolidColorBrush获取系统定义的颜色Gold

Goldenrod

SolidColorBrush获取系统定义的颜色Goldenrod

Gray

SolidColorBrush获取系统定义的颜色Gray

Green

SolidColorBrush获取系统定义的颜色Green

GreenYellow

SolidColorBrush获取系统定义的颜色GreenYellow

Handler

获取或设置此元素的关联处理程序。

(继承自 Element)
Honeydew

SolidColorBrush获取系统定义的颜色Honeydew

HotPink

SolidColorBrush获取系统定义的颜色HotPink

Id

获取一个值,该值可用于在应用程序运行过程中唯一标识元素。

(继承自 Element)
IndianRed

SolidColorBrush获取系统定义的颜色IndianRed

Indigo

SolidColorBrush获取系统定义的颜色Indigo

IsEmpty

在派生类中重写时,指示给定的画笔是否表示空画笔。

Ivory

SolidColorBrush获取系统定义的颜色Ivory

Khaki

SolidColorBrush获取系统定义的颜色Khaki

Lavender

SolidColorBrush获取系统定义的颜色Lavender

LavenderBlush

SolidColorBrush获取系统定义的颜色LavenderBlush

LawnGreen

SolidColorBrush获取系统定义的颜色LawnGreen

LemonChiffon

SolidColorBrush获取系统定义的颜色LemonChiffon

LightBlue

SolidColorBrush获取系统定义的颜色LightBlue

LightCoral

SolidColorBrush获取系统定义的颜色LightCoral

LightCyan

SolidColorBrush获取系统定义的颜色LightCyan

LightGoldenrodYellow

SolidColorBrush获取系统定义的颜色LightGoldenrodYellow

LightGray

SolidColorBrush获取系统定义的颜色LightGray

LightGreen

SolidColorBrush获取系统定义的颜色LightGreen

LightPink

SolidColorBrush获取系统定义的颜色LightPink

LightSalmon

SolidColorBrush获取系统定义的颜色LightSalmon

LightSeaGreen

SolidColorBrush获取系统定义的颜色LightSeaGreen

LightSkyBlue

SolidColorBrush获取系统定义的颜色LightSkyBlue

LightSlateGray

SolidColorBrush获取系统定义的颜色LightSlateGray

LightSteelBlue

SolidColorBrush获取系统定义的颜色LightSteelBlue

LightYellow

SolidColorBrush获取系统定义的颜色LightYellow

Lime

SolidColorBrush获取系统定义的颜色Lime

LimeGreen

SolidColorBrush获取系统定义的颜色LimeGreen

Linen

SolidColorBrush获取系统定义的颜色Linen

LogicalChildren
已过时.

定义用于绘制区域的核心行为和内置颜色。

(继承自 Element)
Magenta

SolidColorBrush获取系统定义的颜色Magenta

Maroon

SolidColorBrush获取系统定义的颜色Maroon

MediumAquamarine

SolidColorBrush获取系统定义的颜色MediumAquamarine

MediumBlue

SolidColorBrush获取系统定义的颜色MediumBlue

MediumOrchid

SolidColorBrush获取系统定义的颜色MediumOrchid

MediumPurple

SolidColorBrush获取系统定义的颜色MediumPurple

MediumSeaGreen

SolidColorBrush获取系统定义的颜色MediumSeaGreen

MediumSlateBlue

SolidColorBrush获取系统定义的颜色MediumSlateBlue

MediumSpringGreen

SolidColorBrush获取系统定义的颜色MediumSpringGreen

MediumTurquoise

SolidColorBrush获取系统定义的颜色MediumTurquoise

MediumVioletRed

SolidColorBrush获取系统定义的颜色MediumVioletRed

MidnightBlue

SolidColorBrush获取系统定义的颜色MidnightBlue

MintCream

SolidColorBrush获取系统定义的颜色MintCream

MistyRose

SolidColorBrush获取系统定义的颜色MistyRose

Moccasin

SolidColorBrush获取系统定义的颜色Moccasin

NavajoWhite

SolidColorBrush获取系统定义的颜色NavajoWhite

Navy

SolidColorBrush获取系统定义的颜色Navy

OldLace

SolidColorBrush获取系统定义的颜色OldLace

Olive

SolidColorBrush获取系统定义的颜色Olive

OliveDrab

SolidColorBrush获取系统定义的颜色OliveDrab

Orange

SolidColorBrush获取系统定义的颜色Orange

OrangeRed

SolidColorBrush获取系统定义的颜色OrangeRed

Orchid

SolidColorBrush获取系统定义的颜色Orchid

PaleGoldenrod

SolidColorBrush获取系统定义的颜色PaleGoldenrod

PaleGreen

SolidColorBrush获取系统定义的颜色PaleGreen

PaleTurquoise

SolidColorBrush获取系统定义的颜色PaleTurquoise

PaleVioletRed

SolidColorBrush获取系统定义的颜色PaleVioletRed

PapayaWhip

SolidColorBrush获取系统定义的颜色PapayaWhip

Parent

获取或设置此元素的父 Element 级。

(继承自 Element)
PeachPuff

SolidColorBrush获取系统定义的颜色PeachPuff

Peru

SolidColorBrush获取系统定义的颜色Peru

Pink

SolidColorBrush获取系统定义的颜色Pink

Plum

SolidColorBrush获取系统定义的颜色Plum

PowderBlue

SolidColorBrush获取系统定义的颜色PowderBlue

Purple

SolidColorBrush获取系统定义的颜色Purple

RealParent

供 .NET MAUI 内部使用。

(继承自 Element)
Red

SolidColorBrush获取系统定义的颜色Red

RosyBrown

SolidColorBrush获取系统定义的颜色RosyBrown

RoyalBlue

SolidColorBrush获取系统定义的颜色RoyalBlue

SaddleBrown

SolidColorBrush获取系统定义的颜色SaddleBrown

Salmon

SolidColorBrush获取系统定义的颜色Salmon

SandyBrown

SolidColorBrush获取系统定义的颜色SandyBrown

SeaGreen

SolidColorBrush获取系统定义的颜色SeaGreen

SeaShell

SolidColorBrush获取系统定义的颜色SeaShell

Sienna

SolidColorBrush获取系统定义的颜色Sienna

Silver

SolidColorBrush获取系统定义的颜色Silver

SkyBlue

SolidColorBrush获取系统定义的颜色SkyBlue

SlateBlue

SolidColorBrush获取系统定义的颜色SlateBlue

SlateGray

SolidColorBrush获取系统定义的颜色SlateGray

Snow

SolidColorBrush获取系统定义的颜色Snow

SpringGreen

SolidColorBrush获取系统定义的颜色SpringGreen

SteelBlue

SolidColorBrush获取系统定义的颜色SteelBlue

StyleId

获取或设置用于唯一地标识元素的用户定义的值。

(继承自 Element)
Tan

SolidColorBrush获取系统定义的颜色Tan

Teal

SolidColorBrush获取系统定义的颜色Teal

Thistle

SolidColorBrush获取系统定义的颜色Thistle

Tomato

SolidColorBrush获取系统定义的颜色Tomato

Transparent

SolidColorBrush获取系统定义的颜色Transparent

Turquoise

SolidColorBrush获取系统定义的颜色Turquoise

Violet

SolidColorBrush获取系统定义的颜色Violet

Wheat

SolidColorBrush获取系统定义的颜色Wheat

White

SolidColorBrush获取系统定义的颜色White

WhiteSmoke

SolidColorBrush获取系统定义的颜色WhiteSmoke

Yellow

SolidColorBrush获取系统定义的颜色Yellow

YellowGreen

SolidColorBrush获取系统定义的颜色YellowGreen

方法

AddLogicalChild(Element)

向逻辑子级添加一个 Element

(继承自 Element)
ApplyBindings()

将所有当前绑定应用于 BindingContext

(继承自 BindableObject)
ClearLogicalChildren()

删除所有子项 Element

(继承自 Element)
ClearValue(BindableProperty)

清除以前为可绑定属性设置的任何值。

(继承自 BindableObject)
ClearValue(BindablePropertyKey)

清除以前为其键标识的可绑定属性设置的任何值。

(继承自 BindableObject)
CoerceValue(BindableProperty)

强制指定可绑定属性的值。 这是通过调用 BindableProperty.CoerceValueDelegate 指定的可绑定属性来完成的。

(继承自 BindableObject)
CoerceValue(BindablePropertyKey)

强制指定可绑定属性的值。 这是通过调用 BindableProperty.CoerceValueDelegate 指定的可绑定属性来完成的。

(继承自 BindableObject)
EffectIsAttached(String)

供 .NET MAUI 内部使用。

(继承自 Element)
FindByName(String)

返回具有指定名称的元素。

(继承自 Element)
GetValue(BindableProperty)

返回给定可绑定属性中包含的值。

(继承自 BindableObject)
InsertLogicalChild(Int32, Element)

Element 指定的索引处插入逻辑子级。

(继承自 Element)
IsNullOrEmpty(Brush)

指示指定的 Brushnull 还是为空。

IsSet(BindableProperty)

确定可绑定属性是否存在并设置了值。

(继承自 BindableObject)
OnBindingContextChanged()

每当元素的绑定上下文发生更改时就会调用。 实现此方法可为此事件添加类处理。

(继承自 Element)
OnChildAdded(Element)

引发 ChildAdded 事件。 实现此方法可为此事件添加类处理。

(继承自 Element)
OnChildRemoved(Element, Int32)

引发 ChildRemoved 事件。 实现此方法以添加此事件的类处理

(继承自 Element)
OnHandlerChanged()

在派生类中重写时,应引发该 HandlerChanged 事件。

(继承自 Element)
OnHandlerChanging(HandlerChangingEventArgs)

在派生类中重写时,应引发该 HandlerChanging 事件。

(继承自 Element)
OnParentChanged()

在派生类中重写时,应引发该 ParentChanged 事件。

(继承自 Element)
OnParentChanging(ParentChangingEventArgs)

在派生类中重写时,应引发该 ParentChanging 事件。

(继承自 Element)
OnParentSet()

引发 (内部) ParentSet 事件。 实现此方法以便在将元素添加到父元素时添加行为。

(继承自 Element)
OnPropertyChanged(String)

更改绑定属性时调用的方法。

(继承自 Element)
OnPropertyChanging(String)

引发 PropertyChanging 事件。

(继承自 BindableObject)
RemoveBinding(BindableProperty)

从可绑定属性中删除以前设置的绑定。

(继承自 BindableObject)
RemoveDynamicResource(BindableProperty)

删除以前设置的动态资源。

(继承自 Element)
RemoveLogicalChild(Element)

从逻辑子级中删除特定 Element 项的第一个匹配项。

(继承自 Element)
SetBinding(BindableProperty, BindingBase)

将绑定分配给可绑定属性。

(继承自 BindableObject)
SetDynamicResource(BindableProperty, String)

BindableProperty使用提供的键设置要通过 DynamicResource 更新的此元素的属性。

(继承自 Element)
SetValue(BindableProperty, Object)

设置指定的可绑定属性的值。

(继承自 BindableObject)
SetValue(BindablePropertyKey, Object)

设置指定的可绑定属性的值。

(继承自 BindableObject)
SetValueFromRenderer(BindableProperty, Object)

供 .NET MAUI 内部使用。

(继承自 Element)
SetValueFromRenderer(BindablePropertyKey, Object)

供 .NET MAUI 内部使用。

(继承自 Element)
UnapplyBindings()

从当前上下文中删除所有当前绑定。

(继承自 BindableObject)

运算符

Implicit(Brush to Paint)

定义用于绘制区域的核心行为和内置颜色。

Implicit(Color to Brush)

定义用于绘制区域的核心行为和内置颜色。

Implicit(Paint to Brush)

定义用于绘制区域的核心行为和内置颜色。

事件

BindingContextChanged

BindingContext 属性的值更改时发生。

(继承自 BindableObject)
ChildAdded

每当将子元素添加到元素时引发。

(继承自 Element)
ChildRemoved

每当从元素中删除子元素时引发。

(继承自 Element)
DescendantAdded

每当将子元素添加到元素的子树时引发。

(继承自 Element)
DescendantRemoved

每当从元素子树中删除子元素时引发。

(继承自 Element)
HandlerChanged

每当元素的处理程序发生更改时引发。

(继承自 Element)
HandlerChanging

每当元素的处理程序开始更改时引发。

(继承自 Element)
ParentChanged

每当元素的父级发生更改时引发。

(继承自 Element)
ParentChanging

每当元素开始更改时引发。

(继承自 Element)
PropertyChanged

在属性值更改时发生。

(继承自 BindableObject)
PropertyChanging

在属性值更改时发生。

(继承自 BindableObject)

显式接口实现

IContextFlyoutElement.ContextFlyout

获取 ContextFlyout 视图。 菜单浮出控件、菜单浮出控件子项和菜单浮出控件分隔符可以添加到上下文浮出控件中。

(继承自 Element)
IDynamicResourceHandler.SetDynamicResource(BindableProperty, String)

定义用于绘制区域的核心行为和内置颜色。

(继承自 BindableObject)
IEffectControlProvider.RegisterEffect(Effect)

注册此元素的指定 effect 项。

(继承自 Element)
IElement.Parent

获取元素的父级。

(继承自 Element)
IElementController.Descendants()

供 .NET MAUI 内部使用。

(继承自 Element)
IElementController.LogicalChildren

供 .NET MAUI 内部使用。

(继承自 Element)
IElementController.SetValueFromRenderer(BindableProperty, Object)

供 .NET MAUI 内部使用。

(继承自 Element)
INameScope.RegisterName(String, Object)

供 .NET MAUI 内部使用。

(继承自 Element)
INameScope.UnregisterName(String)

供 .NET MAUI 内部使用。

(继承自 Element)
IToolTipElement.ToolTip

表示一个小矩形弹出窗口,当用户将指针放在视图上时,显示视图用途的简要说明。

(继承自 Element)
IVisualTreeElement.GetVisualChildren()

获取元素的视觉子级的只读列表。

(继承自 Element)
IVisualTreeElement.GetVisualParent()

获取元素的视觉父级。

(继承自 Element)

扩展方法

GetPropertyIfSet<T>(BindableObject, BindableProperty, T)

定义用于绘制区域的核心行为和内置颜色。

SetAppTheme<T>(BindableObject, BindableProperty, T, T)

定义用于绘制区域的核心行为和内置颜色。

SetAppThemeColor(BindableObject, BindableProperty, Color, Color)

定义用于绘制区域的核心行为和内置颜色。

SetBinding(BindableObject, BindableProperty, String, BindingMode, IValueConverter, String)

创建绑定并将其应用到属性。

FindByName<T>(Element, String)

定义用于绘制区域的核心行为和内置颜色。

ToHandler(IElement, IMauiContext)

定义用于绘制区域的核心行为和内置颜色。

ToPlatform(IElement, IMauiContext)

定义用于绘制区域的核心行为和内置颜色。

GetVisualElementWindow(IVisualTreeElement)

获取包含可视化树元素的窗口(如果元素包含在一个中)。

GetVisualTreeDescendants(IVisualTreeElement)

获取子代的整个层次结构,作为给定可视化树元素的子级列表。

GetVisualTreeElements(IVisualTreeElement, Point)

基于给定点获取可视化树元素的子元素的列表。

GetVisualTreeElements(IVisualTreeElement, Rect)

获取基于矩形的可视化树元素子项的列表。

GetVisualTreeElements(IVisualTreeElement, Double, Double)

获取基于给定 x、y 点的可视化树元素子项的列表。

GetVisualTreeElements(IVisualTreeElement, Double, Double, Double, Double)

基于由其坐标定义的矩形(而不是像素)定义的矩形的可视化树元素子项的列表,这些坐标在平台单位中指定。

适用于