這裏如果有其他人需要這個。
<ControlTemplate TargetType="ToggleButton">
<Image Name="ExpanderImage" Height="24" Width="24" Source="..\Images\Icons\32x32\Blue\Open.png" />
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="ExpanderImage" Property="Source" Value="..\Images\Icons\32x32\Blue\Close.png" />
</Trigger>
<DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource TemplatedParent}}" Value="True">
<Setter TargetName="ExpanderImage" Property="Source" Value="..\Images\Icons\32x32\Green\Open.png" />
</DataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=IsChecked, RelativeSource={RelativeSource Self}}" Value="True" />
<Condition Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource TemplatedParent}}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter TargetName="ExpanderImage" Property="Source" Value="..\Images\Icons\32x32\Green\Close.png" />
</MultiDataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Well DataBinding with RelativeSource是我猜的正確方法。雖然我一直在尋找,但在發佈後幾秒鐘就發現了。只是沒有使用正確的搜索短語。 – 2010-07-01 14:59:47