// Copyright (c) MudBlazor 2021 // MudBlazor licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Connected.Annotations; using Connected.Utilities; using Microsoft.AspNetCore.Components; namespace Connected.Components; public partial class RTLProvider : UIComponent { protected string Classname => new CssBuilder("mud-rtl-provider") .AddClass("mud-application-layout-rtl", RightToLeft) .AddClass(Class) .Build(); private bool _rtl; /// /// If true, changes the layout to RightToLeft. /// [Parameter] [Category(CategoryTypes.RTLProvider.Behavior)] public bool RightToLeft { get => _rtl; set { _rtl = value; UserAttributes["dir"] = RightToLeft ? "rtl" : "ltr"; } } /// /// Child content of the component. /// [Parameter] [Category(CategoryTypes.RTLProvider.Behavior)] public RenderFragment ChildContent { get; set; } }