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
已过时.

供 Microsoft.Maui.Controls 平台内部使用。

(继承自 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)

指示指定的 Brush 是还是 null 空。

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)
SetValueCore(BindableProperty, Object, SetValueFlags)

供 Microsoft.Maui.Controls 平台内部使用。

(继承自 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)

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

(继承自 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)

获取基于由坐标定义的矩形(以平台单位而不是像素指定的)的可视树元素子级的列表。

适用于