Beijing's subway line has added a few, but Windows Phone software update is not to force, many lines are not. That's the only thing you can do. The effect of doing well is shown below:
Software Description:
Development tool: Visual Studio 2010 where the pop-up has a codig4fun third-party control.
Support drag-and-drop map location, query site location, query all lines and all sites, scale map size and other functions.
Subway line and site information stored in the XML file, if added new lines, in the XML to add new lines and all site information, software can automatically draw a new line in the interface.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/
Main code Description:
1.XML file:<lines> node declares all metro lines and colors,<nodes> include site name, site coordinates, and line information.
<SubWay>
<Lines>
<line name= "line Line 1" color= "255, 255, 0, 0"/> <line name=
"line Line 2" Color= "255, 0, 183" /> <line name=
"line Line 4" color= "255, 0, 255, 255"/>
<.....>
</Lines>
<nodes name= "line Line 4" >
<node name= "an river bridge North" x= " -15" y= "450" linename= "line Line 4" >
< /node>
<node name= "North Palace" x= "y=" "450" linename= "line Line 4" >
</Node>
<node name= "Xiyuan" x= " y= "450" linename= "line Line 4" >
<.....>
</nodes name= "line Line 4" >
</Lines>
2. Reading of data:
Read the color:
<summary>
///Converts a string description of color in XML to a color type
///</summary>
///<param name= "s" >< /param>
///<returns></returns> public
Color GetColor (string s)
{
byte B1 = byte. Parse (S.split (', ') [0]);
byte B2 = byte. Parse (S.split (', ') [1]);
byte B3 = byte. Parse (S.split (', ') [2]);
byte b4 = byte. Parse (S.split (', ') [3]);
Color MyColor = Color.FromArgb (B1, B2, B3, B4);
return mycolor;
}
Site Information read: (with LINQ, where subnode is the site class, including site name name, site coordinates point, site-owned node Linename)
Gets the site collection
var nodes = from S in root. Elements ("Nodes"). Elements ("Node")
select New subnode
{
name = S.attribute ("Name"). Value,
point=new Point (double). Parse (S.attribute ("X"). Value), double. Parse (S.attribute ("Y"). Value)),
linename=s.attribute ("Linename"). Value
};
Listsubnode = nodes. Tolist<subnode> ();
3. View all lines and the sites they contain: This binds the Metro collection to the control and displays the information as the site name
<combobox x:name= "Cobline" itemssource= "{Binding}" margin= 12,12,295,29 "selectionchanged=" Cobline_ SelectionChanged ">
<ComboBox.ItemTemplate>
<DataTemplate>
<textblock text=" { Binding Name} "></TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ Combobox>
At last:
Software still has a lot of deficiencies, because the time is hasty many places of implementation is not very good, such as pop-up form search site I want to use Autocompletebox to implement smart prompts, but by the Codig4fun control effect is not good (this I put in the "settings"); Scaling the map and then querying for a site location will not be accurate; Set the location of a site name separately based on layout.
Code Download: Http://files.cnblogs.com/infly123/PhoneSubWay.rar