Gets or sets the brush's content.
Assembly: PresentationCore (in PresentationCore.dll)
There are two ways to specify the VisualBrush.content of a
Visual is quite high in the overall WPF class hierarchy, so a very large number of objects could possibly serve as the visual that you use for a VisualBrush; the entire list cannot be shown here. See Visual; refer to the "Inheritance Hierarchy" section, which will show the immediately derived classes. You can then click on the immediately derived classes and traverse the hierarchies to get a sense of the full range of possibilities. At a top level, the two most common categories of objects you might use for a VisualBrush are UIElement or ContainerVisual. UIElement encompasses basically any UI element that can otherwise participate in the UI for a WPF application. ContainerVisual contains a DrawingGroup that includes one or more Drawing-derived objects.
When you define a new VisualBrush and that Visual is a UIElement (such as a panel or control), the layout system runs on the UIElement and its child elements when the AutoLayoutContent property is set to true. However, the root UIElement is essentially isolated from the rest of the system; styles, storyboards, and external layout dictated by the parent where the brush is applied cannot permeate this boundary. Therefore, you should explicitly specify the size of the root UIElement, because its only parent is the VisualBrush and therefore it cannot automatically size itself to the area being painted. For more information about layout in Windows Presentation Foundation (WPF), see the Layout.for a
Updates to the visual tree of a VisualBrush will not propagate if a BitmapEffect is in the brush's parent chain. You can workaround this limitation by forcing an update of the scene on the object above the effect. You can call InvalidateVisual or include an animation to force a scene update.
A VisualBrush cannot be made read-only (frozen) when its property is set to any value other than null.
- or -
A single object element that defines a new visual element for the brush. This must be an object that derives from Visual. See Remarks.
A that evaluates to an existing Visual instance.
Available since 3.0