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

■ MultiTrigger 엘리먼트 사용하기

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

<StackPanel

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

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

    <StackPanel.Resources>

        <Style x:Key="normal">

            <Setter Property="Control.HorizontalAlignment" Value="Center" />

            <Setter Property="Control.FontSize"            Value="24"     />

            <Setter Property="Control.Margin"              Value="24"     />

            <Style.Triggers>

                <Trigger

                    Property="Button.IsPressed"

                    Value="True">

                    <Setter Property="Control.Foreground" Value="Red" />

                </Trigger>

                <MultiTrigger>

                    <MultiTrigger.Conditions>

                        <Condition Property="Control.IsMouseOver" Value="True"  />

                        <Condition Property="Button.IsPressed"    Value="False" />

                    </MultiTrigger.Conditions>

                    <Setter Property="Control.FontStyle"  Value="Italic" />

                    <Setter Property="Control.Foreground" Value="Blue"   />

                </MultiTrigger>

            </Style.Triggers>

        </Style>

    </StackPanel.Resources>

    <Button Style="{StaticResource normal}">버튼 1</Button>

    <Button Style="{StaticResource normal}">버튼 2</Button>

    <Button Style="{StaticResource normal}">버튼 3</Button>

</StackPanel>

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

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요