|
using System.ComponentModel;
namespace SchoolSample.Common
{
/// <summary>
/// Wraps access to the strongly-typed resource classes so that you can bind control properties to resource strings in XAML.
/// </summary>
public sealed class ApplicationResources : INotifyPropertyChanged
{
private static readonly ApplicationStrings applicationStrings = new ApplicationStrings();
private static readonly ErrorResources errorResources = new ErrorResources();
/// <summary>
/// Gets the <see cref="ApplicationStrings"/>.
/// </summary>
public ApplicationStrings Strings
{
get { return applicationStrings; }
}
/// <summary>
/// Gets the <see cref="ErrorResources"/>.
/// </summary>
public ErrorResources Errors
{
get { return errorResources; }
}
public void OnCultureChanged()
{
OnPropertyChanged("Strings");
OnPropertyChanged("Errors");
}
#region "INotifyPropertyChanged Interface implementation"
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
#endregion "INotifyPropertyChanged Interface implementation"
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Weidong has been an information system professional since 1990. He has a Master's degree in Computer Science, and is currently a MCSD .NET