Defines objects used to paint graphical objects. Classes that derive fromdescribe how the area is painted.
Assembly: PresentationCore (in PresentationCore.dll)
[LocalizabilityAttribute(LocalizationCategory.None, Readability = Readability.Unreadable)] [TypeConverterAttribute(typeof(BrushConverter))] public abstract class Brush : Animatable, IFormattable
[LocalizabilityAttribute(LocalizationCategory::None, Readability = Readability::Unreadable)] [TypeConverterAttribute((BrushConverter^::typeid))] public ref class Brush abstract : Animatable, IFormattable
[<AbstractClass>] [<LocalizabilityAttribute(LocalizationCategory.None, Readability = Readability.Unreadable)>] [<TypeConverterAttribute(typeof(BrushConverter))>] type Brush = class inherit Animatable interface IFormattable end
<LocalizabilityAttribute(LocalizationCategory.None, Readability := Readability.Unreadable)> <TypeConverterAttribute(GetType(BrushConverter))> Public MustInherit Class Brush Inherits Animatable Implements IFormattable
Gets a value that indicates whether the object can be made unmodifiable. (Inherited from Freezable.)
Gets a value that indicates whether the object is currently modifiable. (Inherited from Freezable.)
Gets a value that indicates whether this instance is currently sealed (read-only).(Inherited from DependencyObject.)
Gets or sets the degree of opacity of a.
Gets or sets the transformation that is applied to the brush using relative coordinates.
Gets or sets the transformation that is applied to the brush. This transformation is applied after the brush's output has been mapped and positioned.
Creates a modifiable clone of this, making deep copies of this object's values. When copying dependency properties, this method copies resource references and data bindings (but they might no longer resolve) but not animations or their current values.
Creates a modifiable clone of thisobject, making deep copies of this object's current values. Resource references, data bindings, and animations are not copied, but their current values are.
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Makes the current object unmodifiable and sets its property to true. (Inherited from Freezable.)
Re-evaluates the effective value for the specified dependency property(Inherited from DependencyObject.)
This member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.(Inherited from Freezable.)
Returns the local value of a dependency property, if it exists. (Inherited from DependencyObject.)
Sets the value of a dependency property without changing its value source. (Inherited from DependencyObject.)
Sets the local value of a dependency property, specified by its dependency property identifier. (Inherited from DependencyObject.)
Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property.(Inherited from DependencyObject.)
Return string representation of this ObjectToString.). (Overrides
Creates a string representation of this object based on the specified culture-specific formatting information.
Formats the value of the current instance using the specified format.
A"paints" or "fills" an area with its output. Different brushes have different types of output. Some brushes paint an area with a solid color, others with a gradient, pattern, image, or drawing. The following list describes the different types of WPF brushes:
LinearGradientBrush: Paints an area with a linear gradient.
RadialGradientBrush: Paints an area with a radial gradient.
VisualBrush: Paints an area with a Visual object. A VisualBrush enables you to duplicate content from one portion of your application into another area; it's very useful for creating reflection effects and magnifying portions of the screen.
Use the Brushes class to paint an object using a predefined solid color, such as or .
The following table lists the differenttypes that can be used in XAML and the syntax they support. For detailed syntax information for a specific brush, see that brush's type page.
Object Element Syntax
For an example showing how to quickly paint an area with a solid color, see How to: Paint an Area with a Solid Color.
For XAML information, see the Remarks section.
Notes to Inheritors:
When you inherit from the CreateInstanceCore method. Depending on whether your class must perform additional initialization work or contains non-dependency property data members, you might need to override additional Freezable methods. For more information about inheriting from Freezable types, see the Freezable Objects Overview.class, you must override the
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.