I have a VisulBrush like this:
<VisualBrush
x:Key="visualBrush"
TileMode="Tile"
Viewbox="0,0,5 5"
ViewboxUnits="Absolute"
Viewport="0,0,5,5"
ViewportUnits="Absolute">
<VisualBrush.Visual>
<Path
Data="M 0 5 L 5 0 M -2 2 L 2 -2 M 3 7 L 7 3"
RenderOptions.EdgeMode="Aliased"
Stroke="Black"
StrokeEndLineCap="Square" />
</VisualBrush.Visual>
</VisualBrush>
You can see this visualBrush create strip lines.And I set stripe line's color to "Black",now it looks like this:
Now I can bind any UIElement's Backgroud with this VisualBrush.But can I change stripe line's Color dynamic ?
For example: when I have a Grid which Background property has bound to this VisualBrush,and now it's stripe line is Black,I hope when I press a button,this Grid's Background stripe can turn to "yellow".
I tried many ways,but none works.Please give me some advice.Thanks.