■ Style 엘리먼트 사용하기

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

<Style TargetType="ContentControl">

    <Setter Property="Foreground"                 Value="#FF000000" />

    <Setter Property="HorizontalContentAlignment" Value="Left"      />

    <Setter Property="VerticalContentAlignment"   Value="Top"       />

    <Setter Property="Template">

        <Setter.Value>

            <ControlTemplate TargetType="ContentControl">

                <ContentPresenter

                    Content="{TemplateBinding Content}"

                    ContentTemplate="{TemplateBinding ContentTemplate}"

                    Cursor="{TemplateBinding Cursor}"

                    Margin="{TemplateBinding Padding}"

                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"

                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />

            </ControlTemplate>

        </Setter.Value>

    </Setter>

</Style>

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

Posted by 사용자 icodebroker
TAG