Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7985277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:30:32+00:00 2026-06-04T11:30:32+00:00

Recently I’ve created a weather application for windows phone 7 using C#. But it

  • 0

Recently I’ve created a weather application for windows phone 7 using C#. But it can show the temperature only in Celsius but I want to create a button in settings.xaml page that has an option to select either Celsius or Fahrenheit(At present i haven’t created any button for this, the app will automatically shows the temperature in Celsius). Can anybody help me with this??? Thanks in advance for your hard work.

Below is the code i have used for it-:

private void ForecastDownloaded(object sender, DownloadStringCompletedEventArgs e)
{
    if (e.Result == null || e.Error != null)
    {
            MessageBox.Show("Cannot load Weather Forecast!");
    }
    else
    {
        XDocument document = XDocument.Parse(e.Result);
        var data1 = from query in document.Descendants("current_condition")
                   select new Forecast
                   {
                       observation_time = (string) query.Element("observation_time"),
                       temp_C = (string)query.Element("temp_C"),
                       temp_F = (string)query.Element("temp_F"),
                       weatherIconUrl = (string)query.Element("weatherIconUrl"),
                       weatherDesc = (string)query.Element("weatherDesc"),
                       humidity = (string)query.Element("humidity"),
                       windspeedMiles = (string)query.Element("windspeedMiles"),
                       windspeedKmph = (string)query.Element("windspeedKmph")
                   };

        Forecast forecast = data1.ToList<Forecast>()[0];

        var data2 = from query in document.Descendants("weather")
                    select new Forecast
                    {
                        date = (string)query.Element("date"),
                        tempMaxC = (string)query.Element("tempMaxC"),
                        tempMaxF = (string)query.Element("tempMaxF"),
                        tempMinC = (string)query.Element("tempMinC"),
                        tempMinF = (string)query.Element("tempMinF"),
                        weatherIconUrl = (string)query.Element("weatherIconUrl"),
                    };

        List<Forecast> forecasts = data2.ToList<Forecast>();

        for (int i = 0; i < forecasts.Count(); i++)
        {
            forecasts[i].date = DateTime.Parse(forecasts[i].date).ToString("dddd");
        }

         AddPanoramaItem(forecast,forecasts); 
    }
}

private void AddPanoramaItem(Forecast forecast, List<Forecast> forecasts)
{
    PanoramaItemObject pio = new PanoramaItemObject();
    pio.temperature = "Temperature: " + forecast.temp_C + " °C";
    pio.observation_time = "Observ. Time: " + forecast.observation_time;
    pio.windspeed = "Wind Speed: " + forecast.windspeedKmph + " Kmph";
    pio.huminity = "Huminity: " + forecast.humidity + " %";
    pio.weatherIconUrl = forecast.weatherIconUrl;
    pio.forecasts = forecasts;

    PanoramaItem panoramaItem = new PanoramaItem();
    panoramaItem.Header = queries[query];
    int index = queries[query].IndexOf(",");
    if (index != -1) panoramaItem.Header = 
        queries[query].Substring(0, queries[query].IndexOf(","));
    else panoramaItem.Header = queries[query];

    panoramaItem.ContentTemplate = 
       (DataTemplate)Application.Current.Resources["ForecastTemplate"];
    panoramaItem.Content = pio;

    Panorama.Items.Add(panoramaItem);

    query++;
    if (query < queries.Count()) 
        LoadForecast();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:30:34+00:00Added an answer on June 4, 2026 at 11:30 am

    Use this formula

    for Celcius to Farenhite

    Tc = 5 (Tf-32) /9;
    

    From Farenhite to Celcius

    Tf = (9/5)*Tc+32
    

    where Tc = temperature in degrees Celsius, Tf = temperature in degrees Fahrenheit

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently I've wanted to do a number of things using CSS only to find
recently I started using storyboard and I've the following situation: I want to set
Recently I just got assigned a project to develop a web application/site that uses
Recently, sometimes (rarely) when we export data from our application, the export log contains
recently got an issue when loading vs 2008, it displays this... can anyone tell
Recently I'm doing some work on RTMP streaming, that is using Flowplayer to integrate
Recently I have been dealing with windows LogonUser API. The LogonUser api returns different
Recently,I am handling a solution for WebPart internationalization,but I am not familiar with the
Recently, I'm trying to solve all the exercises in CLRS. but there are some
Recently my application received quite a lot comments that it's not working on Android

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.