New to Telerik UI for WPF? Download free 30-day trial

Flight Card

FlightCard is intended to display flight information in a structured user-friendly manner. Below are the properties exposed for this purpose. Specific for the FlightCard card is that it exposes the Flights collection which is an IList of FlightInfo objects.

FlightInfo

  • DepartureCity
  • DepartureAirport
  • DepartureDateTime
  • ArrivalCity
  • ArrivalAirport
  • ArrivalDateTime

FlightCard

  • PassengerName
  • Total
  • IList

A sample FlightCard can be defined as follows.

Example 1: Defining a FlightCard

        FlightCardMessage flightCardMessage = new FlightCardMessage(this.currentAuthor); 
 
        flightCardMessage.ImageSource = new BitmapImage(new Uri("/Images/plane.png", UriKind.RelativeOrAbsolute)); 
 
        FlightInfo departureFlight = new FlightInfo(); 
 
        departureFlight.DepartureAirport = "SOF"; 
        departureFlight.DepartureCity = "Sofia, Bulgaria"; 
        departureFlight.DepartureDateTime = new DateTime(2018, 5, 1, 7, 40, 0); 
 
        departureFlight.ArrivalAirport = "REK"; 
        departureFlight.ArrivalCity = "Reykjavik, Iceland"; 
        departureFlight.ArrivalDateTime = new DateTime(2018, 5, 2, 2, 50, 0); 
 
        flightCardMessage.Flights.Add(departureFlight); 
 
        FlightInfo arrivalFlight = new FlightInfo(); 
 
        arrivalFlight.DepartureAirport = "REK"; 
        arrivalFlight.DepartureCity = "Reykjavik, Iceland"; 
        arrivalFlight.DepartureDateTime = new DateTime(2018, 5, 9, 9, 50, 0); 
 
        arrivalFlight.ArrivalAirport = "SOF"; 
        arrivalFlight.ArrivalCity = "Sofia, Bulgaria"; 
        arrivalFlight.ArrivalDateTime = new DateTime(2018, 5, 9, 19, 37, 0); 
 
        flightCardMessage.Flights.Add(arrivalFlight); 
 
        flightCardMessage.PassengerName = otherAuthor.Name; 
 
        flightCardMessage.Total = "$250.23"; 
 
        this.chat.AddMessage(flightCardMessage); 
This sample data will result in the following FlightCard.

Figure 1: Defining ImageCard

Defining ImageCard

See Also

In this article