■ o:Freeze 속성을 사용해 Freezable 엘리먼트의 IsFrozen 속성 상태를 true로 설정하는 방법을 보여준다.
▶ MainWindow.xaml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
<Window x:Class="TestProject.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:o="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options" Width="800" Height="600" Title="o:Freeze 속성 : Freezable 엘리먼트의 IsFrozen 속성 상태를 true로 설정하기" FontFamily="나눔고딕코딩" FontSize="16"> <Grid> <Ellipse Width="300" Height="300" Stroke="Black" StrokeThickness="2"> <Ellipse.Fill> <DrawingBrush o:Freeze="True" Viewport="0 0 10 10" ViewportUnits="Absolute" TileMode="Tile"> <DrawingBrush.Drawing> <DrawingGroup> <GeometryDrawing Brush="White"> <GeometryDrawing.Geometry> <RectangleGeometry Rect="0 0 100 100" /> </GeometryDrawing.Geometry> </GeometryDrawing> <GeometryDrawing Brush="LightGray"> <GeometryDrawing.Geometry> <GeometryGroup> <RectangleGeometry Rect="0 0 50 50" /> <RectangleGeometry Rect="50 50 50 50" /> </GeometryGroup> </GeometryDrawing.Geometry> </GeometryDrawing> </DrawingGroup> </DrawingBrush.Drawing> </DrawingBrush> </Ellipse.Fill> </Ellipse> </Grid> </Window> |