This is a cross platform NET Standard 2.0 helper library containing a bunch of helper code that I used to rewrite several times a day while creating sample apps for developers.
By publishing this is as a signed NuGet package I save myself a lot of time, but more importantly, I get to share it with you. Enjoy!
NuGet.org (stable) | Azure Artifacts Feed (preview) |
---|---|
Workflow | Status |
---|---|
main |
|
dev |
|
prerelease |
|
release |
Branch | Status |
---|---|
dev | |
main (default) | |
release |
Extensions for commonly used objects like string
, DateTime
, enum
. There are also some special extensions for File
, Exception
and Color
. Finally, there's a unqiue helper, HttpClientExtensions
which provides download progress insights and a helper method to POST image data.
Special collection types that help in special scenarios (e.g. ObservableQueue
and ObservableRangeCollection
).
This folder has some of the most frequently used classes (i.e. BindableBase
, ViewModelBase
, JsonHelper
).
Platform agnostic MVVM classes like DelegateCommand
and RelayCommand
.
To make testing UI controls easier by quickly providing well formatted data from offline sample data and online API endpoints. This is really useful for quickly testing Load On Demand scenarios.
- BingImageService
- ComicVineApiService
- SampleDataService
- XkcdApiService
ComicVineService requires an API Key (it's free). All other services do not require an API key, just new up the class and start using it.
This is my most frequently used service. You can easily spin up data for Lists, Charts, DataGrids and more with a single method.
var sampleDataService = new SampleDataService();
BarSeriesData.AddRange(sampleDataService.GenerateCategoricalData());
ScatterSeriesData.AddRange(sampleDataService.GenerateScatterPointData());
LineSeriesData.AddRange(sampleDataService.GenerateDateTimeMinuteData());
SplineAreaSeriesData.AddRange(sampleDataService.GenerateDateTimeDayData());
People.AddRange(sampleDataService.GeneratePeopleData());
Easily fetch the Bing Image of Day.
using (var bingImageService = new BingImageService())
{
var result = await bingImageService.GetBingImageOfTheDayAsync();
image.Source = new UriImageSource{Uri = result};
}
Getting today's comic by calling GetNewestComic
or get any comic by using GetComicAsync(comicNumber)
.
var xkcdService = new XkcdApiService();
// to fetch a comic, get the latest or pass a specific comic ID
XkcdComic xkcdComic;
if (lastXkcdComicNumber == 0)
{
xkcdComic = await xkcdService.GetNewestComicAsync();
}
else
{
xkcdComic = await xkcdService.GetComicAsync(lastXkcdComicNumber - 1);
}
lastXkcdComicNumber = xkcdComic.Num;
// This is an `ObservableQueue` (located in CommonHelpers.Collections)
XkcdComics.Enqueue(xkcdComic);
The ComicVine API is the only service in which you'll need an API key. You pass the key and a unique string name for your app to the constructor. Now you have access to thousands of items like Characters, Videos and more from the service.
var comicVineService = new ComicVineApiService(ApiKeys.ComicVineApiKey, ApiKeys.UniqueUserAgentString);
var apiResult = await comicVineService.GetCharactersAsync(CurrentCharactersCount);
CurrentCharactersCount = apiResult.Offset + apiResult.NumberOfPageResults;
TotalCharactersCount = apiResult.NumberOfTotalResults;
var characters = apiResult.Results;
- Updating to be included in the Arctic Code Vault