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

728x90
반응형

■ MultiDataTrigger 엘리먼트 사용하기

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


TestProject.zip


MainWindow.xaml

 

 

<Window x:Class="TestProject.MainWindow"

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

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

    Width="800"

    Height="600"

    Title="MultiDataTrigger 엘리먼트 사용하기"

    FontFamily="나눔고딕코딩"

    FontSize="16">

    <StackPanel

        HorizontalAlignment="Center"

        VerticalAlignment="Center">

        <StackPanel.Resources>

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

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

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

            </Style>

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

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

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

                <Setter Property="Width"               Value="100"    />

                <Setter Property="Height"              Value="30"     />

                <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">체크 항목 1</CheckBox>

        <CheckBox Name="checkBox2">체크 항목 2</CheckBox>

        <Button>버튼 1</Button>

        <Button>버튼 2</Button>

        <Button>버튼 3</Button>

    </StackPanel>

</Window>

 

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

728x90
반응형
Posted by 사용자 icodebroker
TAG , ,

댓글을 달아 주세요