■ Style 엘리먼트 : 바인딩 설정하기

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

<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 Button}">

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

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

            <Setter Property="FontSize"            Value="{Binding ElementName=scrollBar, Path=Value}" />

        </Style>

    </StackPanel.Resources>

    <ScrollBar

        Name="scrollBar"

        Orientation="Horizontal"

        Margin="24"

        Minimum="11"

        Maximum="100"

        Value="24" />

    <Button>버튼 1</Button>

    <Button>버튼 2</Button>

    <Button>버튼 3</Button>

</StackPanel>

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

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요