Edit this page

Weather Card

Weather card extends ImageCard by adding options to display weather data. The following set of properties is exposed for this purpose. They all or of string type.

  • Temperature
  • Humidity
  • Dew
  • Pressure
  • Wind

Example 1: Defining a WeatherCard

 WeatherCardMessage weatherCardMessage = new WeatherCardMessage(this.currentAuthor);
        weatherCardMessage.ActionResultsOrientation = Orientation.Vertical;
        weatherCardMessage.CardOrientation = CardOrientation.Portrait;
        weatherCardMessage.Dew = "6° C";
        weatherCardMessage.Humidity = "81 %";
        weatherCardMessage.ImageSource = new BitmapImage(new Uri("/Images/London.png", UriKind.RelativeOrAbsolute));
        weatherCardMessage.Pressure = "1008.00 mb";
        weatherCardMessage.Temperature = "9 °C";
        weatherCardMessage.Wind = "Wind: 0 mph from W";

        weatherCardMessage.SubTitle = "Partly cloudy";

        weatherCardMessage.Text = "Local Time: " + DateTime.Now.ToString("hh:mm tt");
        weatherCardMessage.Title = "London, UK";

        this.chat.AddMessage(weatherCardMessage);

Defining such WeatherCardMessage will look as follows.

Figure 1: Defining WeatherCard

Defining ImageCard

See Also

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy