// <copyright file="EditorsLocalizationResourceExtension.cs" company="Syncfusion">
// Copyright (c) Syncfusion. All rights reserved.
// </copyright>

namespace CustomControl
{
    using Microsoft.UI.Xaml.Markup;

    /// <summary>
    /// A markup extension that returns the localized string based on culture for the <see cref="ResourceName"/>.
    /// </summary>
    [MarkupExtensionReturnType(ReturnType = typeof(string))]
    public class EditorsLocalizationResourceExtension : MarkupExtension
    {
        /// <summary>
        /// Gets or sets the resource name to get the localized string.
        /// </summary>
        public string ResourceName { get; set; }

        /// <inheritdoc/>
        protected override object ProvideValue()
        {
            return EditorsLocalizationResourceAccessor.Instance.GetLocalizedStringResource(this.ResourceName);
        }
    }
}
