Files
ReminderOrganizer/ViewModels/LocalizedStrings.cs

20 lines
586 B
C#
Raw Normal View History

#nullable enable
using System.Windows;
using ReminderOrganizer.Services;
namespace ReminderOrganizer.ViewModels
{
public class LocalizedStrings
{
private readonly ILocalizationService _localizationService;
public LocalizedStrings()
{
_localizationService = ServiceLocator.Services.GetService(typeof(ILocalizationService)) as ILocalizationService
?? throw new System.InvalidOperationException("LocalizationService not found");
}
public string this[string key] => _localizationService.GetString(key);
}
}