Skip to content

DavidDevMx31/WebApiConsumerDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebApiConsumerDemo

Example code for consuming an API from a WPF app.

Introduction

This project is a simple example of how to call an API using C#.

The "Main Window" fetches web comics from xkcd and shows them on the screen. The first image is the most recent comic from the API. "Previous" and "Next" buttons allow to navigate the gallery.

MainWindow screenshot

"Sun Info" button shows the next window.

The "Sun Info" window fetches sunrise and sunset times. This information is provided by the Sunrise Sunset API.

SunInfo screenshot

Technologies

  • Windows Presentation Foundation (WPF)
  • C#

Requirements

The destination platform is .Net framework 4.6.1

To-do

  • Add controls in the SunInfo windows to specify the latitude and longitude for the request (both are currently fixed).

Inspiration

This solution was inspired by this Tim Corey's tutorial. However, I extended the tutorial's example by adding a cache to prevent unnecesary calls to the web comics API.

About

Example code for consuming an API from a WPF app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages