첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

■ StaticResource 엘리먼트를 사용해 리소스를 사용하는 방법을 보여준다.

 

▶ 예제 코드 (XAML)

<StackPanel
    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">
    <StackPanel.Resources>
        <s:Double x:Key="FontSizeKey">
            20
        </s:Double>
    </StackPanel.Resources>
    <Button
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Margin="10">
        <Button.FontSize>
            <StaticResource ResourceKey="FontSizeKey" />
        </Button.FontSize>
        테스트
    </Button>
</StackPanel>
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요