Archive

Archives pour 08/2017

Canvas to VisualBrush

For fill a Control you can use a canvas transformed to VisualBrush
If you change part of canvas you modify directly the render of VisualBrush

For this Canvas (set outside of window)

Create VisualBrush in Window.Resource

And using

If you want to specify using of this VisualBrush

Stretch= »None » Define how the render is made
TileMode= »Tile » Define how the render of each object is made
AlignmentX= »Left » First aligment on X on render
AlignmentY= »Top » First aligment on Y on render
ViewportUnits= »Absolute » Type of viewport unit, if absolute no dependency of control, otherwise else
Viewport= »0,0,12,12″ According of ViewportUnit definition

Sample

Result

canvas-view

Categories: Non classé, wpf Tags: