Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/metaljase/wpfappfetchingapidataexample
Example of a .NET WPF app displaying data (using XAML & MVVM) fetched from an ASP.NET Web API.
https://github.com/metaljase/wpfappfetchingapidataexample
api architecture asp-net asp-net-core asp-net-core-web-api aspnetcore csharp dependency-injection dotnet dotnet-core dotnetcore mvvm webapi webapi-core wpf wpf-application wpf-datagrid wpf-ui
Last synced: 3 days ago
JSON representation
Example of a .NET WPF app displaying data (using XAML & MVVM) fetched from an ASP.NET Web API.
- Host: GitHub
- URL: https://github.com/metaljase/wpfappfetchingapidataexample
- Owner: metaljase
- Created: 2023-05-21T18:13:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-08T15:58:39.000Z (8 months ago)
- Last Synced: 2024-03-08T16:54:44.463Z (8 months ago)
- Topics: api, architecture, asp-net, asp-net-core, asp-net-core-web-api, aspnetcore, csharp, dependency-injection, dotnet, dotnet-core, dotnetcore, mvvm, webapi, webapi-core, wpf, wpf-application, wpf-datagrid, wpf-ui
- Language: C#
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# What is WpfAppFetchingApiDataExample?
WpfAppFetchingApiDataExample is an example of how a .NET WPF app can fetch data from an ASP.NET Web API and display it.The .NET solution contains four projects, which include:
- ASP.NET Web API, based on the weather forecast project included with Visual Studio as a template.
- .NET WPF app to display the dummy weather forecast data from the API, using DI, MVVM and XAML.
- Class library for the WPF app.
- Class library for data access.NOTE: Exception handling, resilient HTTP calls, proper logging etc, have been omitted on purpose to simplify this example.
# Setup instructions
1) Clone the WpfAppFetchingApiDataExample repository.2) Open the .NET solution in Visual Studio 2022 (or a compatible alternative).
3) Set both `WpfApiDataExample.DataManager.Api` and `WpfApiDataExample.UI.Wpf` as startup projects.
4) Build the solution and run.
5) The API should open in a web browser window. Make a note of the URL, and stop the app.
6) Open `appsettings.json` in `WpfApiDataExample.UI.Wpf` and update `ApiBaseUrl` with the URL from the previous step.
7) Build the solution and run.
8) The API should open in a web browser and also the WPF app should open displaying the weather forecast.