■ DynamicResource 엘리먼트 : 엘리먼트 리소스 사용하기

----------------------------------------------------------------------------------------------------

<Window

    x:Class="TestProject.MainWindow"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:s="clr-namespace:System;assembly=mscorlib"

    xmlns:src="clr-namespace:TestProject"

    Width="600"

    Height="450"

    Title="DynamicResource 엘리먼트 : 엘리먼트 리소스 사용하기">

    <Window.Resources>

        <Path x:Key="PathKey"

            HorizontalAlignment="Center"

            VerticalAlignment="Center"

            Stroke="Black"

            StrokeThickness="1"

            Fill="Transparent">

            <Path.Data>

                <Geometry>M 0 0 L 11.2 0 M 0 6.4 L 5.6 0 L 11.2 6.4 Z</Geometry>

            </Path.Data>

        </Path>

    </Window.Resources>

    <Grid>

        <Border

            Width="20"

            Height="20"

            BorderBrush="Blue"

            BorderThickness="2">

            <DynamicResource ResourceKey="PathKey" />

        </Border>

    </Grid>

</Window>

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요