Template10.Services.ResourcesService 1.0.1

Handy Resources Service for WinRT. Part of Template 10, a Library of Helpers for UWP.

Install-Package Template10.Services.ResourcesService -Version 1.0.1
dotnet add package Template10.Services.ResourcesService --version 1.0.1
<PackageReference Include="Template10.Services.ResourcesService" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Template10.Services.ResourcesService --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Template10.Services.ResourcesService, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Template10.Services.ResourcesService as a Cake Addin
#addin nuget:?package=Template10.Services.ResourcesService&version=1.0.1

// Install Template10.Services.ResourcesService as a Cake Tool
#tool nuget:?package=Template10.Services.ResourcesService&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

ResourcesService

The ResourcesService provides simplified access to application resources.

public interface IResourceService
{

    /// <summary> 
    /// Set language/culture of application by passing language string 
    /// </summary> 
    /// <param name="language"> language (example: "en-US")</param> 
    void SetLocale(string language);

    /// <summary> 
    /// Set language/culture of application by passing CultureInfo object 
    /// </summary> 
    /// <param name="culture">CultureInfo object</param> 
    void SetLocale(CultureInfo culture);

    /// <summary> 
    /// Get a localized string by key 
    /// </summary> 
    /// <param name="key">The key</param> 
    /// <returns></returns> 
    string GetLocalizedString(string key, string fallback = null);

    bool TryGetLocalizedString(string key, out string value);
        
    /// <summary> 
    /// Get a localized string by Uri 
    /// </summary> 
    /// <param name="key">The key</param> 
    /// <returns></returns> 
    string GetLocalizedString(Uri uri, string fallback = null);

    /// <summary> 
    /// Supported languages 
    /// </summary> 
    IReadOnlyList<string> SupportedLanguages { get; }

    /// <summary> 
    /// The current language of app 
    /// </summary> 
    string CurrentLanguage { get; set; }
}

ResourcesService

The ResourcesService provides simplified access to application resources.

public interface IResourceService
{

    /// <summary> 
    /// Set language/culture of application by passing language string 
    /// </summary> 
    /// <param name="language"> language (example: "en-US")</param> 
    void SetLocale(string language);

    /// <summary> 
    /// Set language/culture of application by passing CultureInfo object 
    /// </summary> 
    /// <param name="culture">CultureInfo object</param> 
    void SetLocale(CultureInfo culture);

    /// <summary> 
    /// Get a localized string by key 
    /// </summary> 
    /// <param name="key">The key</param> 
    /// <returns></returns> 
    string GetLocalizedString(string key, string fallback = null);

    bool TryGetLocalizedString(string key, out string value);
        
    /// <summary> 
    /// Get a localized string by Uri 
    /// </summary> 
    /// <param name="key">The key</param> 
    /// <returns></returns> 
    string GetLocalizedString(Uri uri, string fallback = null);

    /// <summary> 
    /// Supported languages 
    /// </summary> 
    IReadOnlyList<string> SupportedLanguages { get; }

    /// <summary> 
    /// The current language of app 
    /// </summary> 
    string CurrentLanguage { get; set; }
}

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 1,873 10/5/2019