첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
유용한 소스 코드가 있으면 icodebroker@naver.com으로 보내주시면 감사합니다.
블로그 자료는 자유롭게 사용하세요.

■ ContentPresenter 엘리먼트 사용하기

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

<Window.Resources>

    <ControlTemplate

        x:Key="RadioButtonControlTemplateKey"

        TargetType="{x:Type RadioButton}">

        <Border

            Name="border"

            BorderBrush="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"

            CornerRadius="100"

            Padding="10">

            <ContentPresenter Content="{TemplateBinding ContentControl.Content}" />

        </Border>

        <ControlTemplate.Triggers>

            <Trigger Property="IsChecked" Value="True">

                <Setter

                    TargetName="border"

                    Property="BorderThickness"

                    Value="1" />

            </Trigger>

        </ControlTemplate.Triggers>

    </ControlTemplate>

</Window.Resources>

<GroupBox

    HorizontalAlignment="Center"

    VerticalAlignment="Center"

    Padding="10"

    FontSize="12pt"

    Header="옵션">

    <StackPanel>

        <RadioButton

            Template="{StaticResource RadioButtonControlTemplateKey}"

            HorizontalAlignment="Center"

            Content="옵션 1" />

        <RadioButton

            Template="{StaticResource RadioButtonControlTemplateKey}"

            HorizontalAlignment="Center"

            Content="옵션 2"

            IsChecked="True" />

        <RadioButton

            Template="{StaticResource RadioButtonControlTemplateKey}"

            HorizontalAlignment="Center"

            Content="옵션 3" />

        <RadioButton

            Template="{StaticResource RadioButtonControlTemplateKey}"

            HorizontalAlignment="Center"

            Content="옵션 4" />

    </StackPanel>

</GroupBox>

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

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요