Windows Phone domestic weather forecast application ..

Source: Internet
Author: User

At the beginning, some people in today's aiming Forum have developed a similar application. It seems that beginners like this application ..

First look at the picture, there is a picture with the truth

 

 

I originally wanted to use hubtile, but it was troublesome to change the style, so I simply wrote a custom control. Relatively simple. You can preview the temperature information for three days in the panel.

 

Before that, we can add a city and read the weather information of the city.

In addition, you can regularly update the weather forecast information to display the weather information of the preferred city on the home page.

 

All the data is bound as a template. The boxes for displaying the weather need to be bound with data. Previously, the data was dynamically bound and later bound to the template. However, an error is reported during the operation and the information is checked, you need to register this property.

Method of registering an attribute.

1 /// <summary>
2 // Weather Information
3 /// </Summary>
4 Public model. weathertable. City cityinfo
5 {
6 get
7 {
8 return (model. weathertable. City) base. getvalue (cityinfoproperty );
9}
10 set
11 {
12 base. setvalue (cityinfoproperty, value );
13}
14}
15 # Region
16 /// <summary>
17 // register attributes
18 /// </Summary>
19 public static dependencyproperty cityinfoproperty;
20 static weathertile (){
21 cityinfoproperty = dependencyproperty. Register (
22 "cityinfo ",
23 typeof (model. weathertable. City ),
24 typeof (weathertile ),
25 new propertymetadata (null)
26 );
27}
28 # endregion

 

 

In this way, you can bind data directly to the XAML file.

1                     <my:WeatherTile 
2 Margin="3"
3 CityInfo="{Binding}"
4 />

 

New Features

 

 

I used a reminder for scheduled task updates.

Download source code:

Http://files.cnblogs.com/lsmayday/%E5%A4%A9%E6%B0%94%E9%A2%84%E6%8A%A5.rar

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.