Note that there are some explanatory texts on larger screens.

plurals
  1. POLayoutTransformer on Windows Phone not Updating
    primarykey
    data
    text
    <p>I am working on a WP7 app using Location Services and Bing Maps. I would like the Bing Maps control to rotate to always have the current heading at the top. I understand this isn't possible with the Bing Maps Control, so I'm trying to use a Rotation Transform to rotate the entire control.</p> <p>I'm using the LayoutTransformerOnWindowsPhone assembly found here:</p> <p><a href="http://blogs.msdn.com/b/delay/archive/2010/08/26/your-phone-can-turn-into-a-robot-layouttransformer-works-great-on-the-windows-phone-platform.aspx" rel="nofollow">http://blogs.msdn.com/b/delay/archive/2010/08/26/your-phone-can-turn-into-a-robot-layouttransformer-works-great-on-the-windows-phone-platform.aspx</a></p> <p>When the page loads, the control gets rotated to the correct heading, but it doesn't keep rotating as the heading changes. Here's my code:</p> <p>Xaml:</p> <pre><code>&lt;Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"&gt; &lt;toolkit:LayoutTransformer&gt; &lt;toolkit:LayoutTransformer.LayoutTransform&gt; &lt;RotateTransform x:Name="mapRotation" /&gt; &lt;/toolkit:LayoutTransformer.LayoutTransform&gt; &lt;my:Map Name="map1" Margin="0,0,0,0" CredentialsProvider="xyz"/&gt; &lt;/toolkit:LayoutTransformer&gt; &lt;/Grid&gt; </code></pre> <p>cs:</p> <pre><code>if (Compass.IsSupported) { _compass = new Compass {TimeBetweenUpdates = TimeSpan.FromMilliseconds(500)}; _compass.CurrentValueChanged += new EventHandler&lt;SensorReadingEventArgs&lt;CompassReading&gt;&gt;(compass_CurrentValueChanged); _compass.Start(); } void compass_ValueChanged(object sender, SensorReadingEventArgs&lt;CompassReading&gt; e) { Dispatcher.BeginInvoke(() =&gt; UpdateUI(e.SensorReading)); } private void UpdateUI(CompassReading compassReading) { _currentHeading = compassReading.TrueHeading; mapRotation.Angle = _currentHeading; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload