WPF: Изменение свойства другого элемента управления в триггере некоторого элемента управления

Вот мой текстовый блок.

    <Image x:Name:imgAnother/>

    <TextBlock>
        this is my text block
        <TextBlock.Style>
            <Style TargetType="TextBlock">
                <Setter Property="TextDecorations" Value="None"/>
                <Style.Triggers>
                    <Trigger Property="TextBlock.IsMouseOver" Value="True">
                        <Setter Property="Foreground" Value="RoyalBlue"/>
                        <!--I like to insert a code at here that changes another control's property...-->
                    </Trigger>
                    <Trigger Property="TextBlock.IsMouseOver" Value="False">
                        <Setter Property="Foreground" Value="#FF808080"/>
                        <!--..and this line too.-->
                   </Trigger>
                </Style.Triggers>                    
            </Style>
        </TextBlock.Style>
    </TextBlock>

Мне нравится делать код xaml который может изменить свойство другого элемента управления, например imgAnother.

как я могу это сделать?

7
задан H.B. 6 August 2011 в 14:41
поделиться