0
我發現的答案:How to rotate an image to a particular angle in Windows Phone 7 Silverlight Application?與我正在尋找的接近。在Windows Phone上旋轉樣式圖像
我的問題是 - 如果圖像是樣式的一部分,我該怎麼做?圖像基本上是指向運動方向(軌跡)的箭頭。
<Style x:Key="MyBoatPushPinStyle" TargetType="maps:Pushpin">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Image x:Name="MyBoatIcon"
Source="Resources/Icons/myboat.png"
Stretch="None">
<Image.RenderTransform>
<RotateTransform Angle="0" />
</Image.RenderTransform>
</Image>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
樣式應用於MapLayer:
<maps:MapLayer x:Name="LocationLayer">
<maps:Pushpin Style="{StaticResource MyBoatPushPinStyle}"
Location="{Binding CurrentLocation}" />
</maps:MapLayer>
我想不通的是如何風格中引用的圖像,如果可以真正實現。
喜歡的東西:
((RotateTransform)REFERENCE_TO_IMAGE.RenderTransform).Angle = _currentTrack;
感謝MyKuLLSKI。正是我需要的:) – Declan 2012-03-08 13:10:43