7
これは私のテキストブロックです。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>
"imgAnother"のように別のコントロールのproerptyを変更できるxamlコードを作成するのが好きです。
どうすればいいですか?
その画像はどこですか? –
基本的に、私は同じウィンドウ内の別のコントロールのproeprtyを変更したい。しかし、コントロールは、アプリケーションリソース、ウィンドウのリソース、コントロールのリソースに配置することもできます。 – mjk6026