■ MultiDataTrigger 엘리먼트 사용하기

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

<StackPanel

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

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

    <StackPanel.Resources>

        <Style TargetType="{x:Type CheckBox}">

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

            <Setter Property="Margin"              Value="12"     />

        </Style>

        <Style TargetType="{x:Type Button}">

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

            <Setter Property="Margin"              Value="12"     />

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

            <Setter Property="IsEnabled"           Value="False" />

            <Style.Triggers>

                <MultiDataTrigger>

                    <MultiDataTrigger.Conditions>

                        <Condition Binding="{Binding ElementName=checkBox1, Path=IsChecked}" Value="True" />

                        <Condition Binding="{Binding ElementName=checkBox2, Path=IsChecked}" Value="True" />

                    </MultiDataTrigger.Conditions>

                    <Setter Property="IsEnabled" Value="True" />

                </MultiDataTrigger>

            </Style.Triggers>

        </Style>

    </StackPanel.Resources>

    <CheckBox Name="checkBox1">Check 1</CheckBox>

    <CheckBox Name="checkBox2">Check 2</CheckBox>

    <Button>버튼 1</Button>

    <Button>버튼 2</Button>

    <Button>버튼 3</Button>

</StackPanel>

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

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요