Archive for the ‘Silverlight’ Category

Post

Add Map and Points to Windows Phone 7

In Bing Maps,Geo Spatial,Silverlight,SQL Saturday,Windows Phone 7 on January 15, 2011 by mws580

Here are the steps to add a map and point on the map.

1) Add a reference to Microsoft.Phone.Controls.Maps

2) Drag a ‘Map’ Windows Phone Control to the Page xaml.

3) Register on Bing Maps Portal and obtain an ID or Key.  Without this the map will display not register message.

4) Add the key obtained above to the xaml code.  Modify the xaml created by dragging the control and dropping it on the page.

    <Microsoft_Phone_Controls_Maps:Map    Name="map1" VerticalAlignment="Top" >     
            <Microsoft_Phone_Controls_Maps:Map.CredentialsProvider>
                <Microsoft_Phone_Controls_Maps:ApplicationIdCredentialsProvider ApplicationId="your key here" />
            </Microsoft_Phone_Controls_Maps:Map.CredentialsProvider>
    </Microsoft_Phone_Controls_Maps:Map>

 

5) Go to  the code behind

6) Add a using statement to reference the map control

using Microsoft.Phone.Controls.Maps;
using Microsoft.Phone.Controls.Maps.Platform;

7)  Add an instance variable for the page

MapLayer PinLayer1;

8) Create a pin and location

Pushpin MyPin = new Pushpin();
MyPin.Location = new Location();

9)  Set the Lat and Lon for the location.

MyPin.Location.Latitude = 27.96206353406851;
MyPin.Location.Longitude = -82.44960308074951;

10) Add a label to the Pin

MyPin.Content = "KForce";

11) Create a Map Layer

PinLayer1 = new MapLayer();

12) Add  Pin to Layer

PinLayer1.Children.Add(MyPin);

13) Add Layer to map

map1.Children.Add(PinLayer1);

14)  Center and Zoom on the location

map1.Center = MyPin.Location;
map1.ZoomLevel = 9;

Happy Coding

Comments Off

Post

My App is in the Win Phone 7 Marketplace

In Silverlight,Windows Phone 7 on December 21, 2010 by mws580

instantMBA99x99Woohoo! My first Phone is available for purchase in the Marketplace.

Instant MBA can be downloaded now.  Enjoy!

MBAScreenShot1

Comments Off

Post

Learn MVVM and other Silverlight topics

In MVVM,Silverlight on December 21, 2010 by mws580

In Vegas in November Florida alumni John Papa  was Scott Guthrie’s Vannah White for Silverlight.  John and others have released a new Silverlight Training Series of labs as announced at the Silverlight FireStarter. There are eleven labs and video walkthroughs. Source is in both VB and C#.
The kit can be downloaded from http://www.silverlight.net/news/events/firestarter-labs
Topics are broken into 100, 200, and 300 levels.
100 level includes Winforms and Silverlight, ASP.NET and Silverlight, XAML and Controls, Data Binding
200 level covers out-of-browser, Blend UX, Web Services and WCF RIA Services
300 level has more deep dive into OOB, MVVM and Windos Phone 7

Comments Off

Follow

Get every new post delivered to your Inbox.