You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Components/Components/RTLProvider/RTLProvider.razor.cs

42 lines
1.0 KiB

2 years ago
// 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;
/// <summary>
/// If true, changes the layout to RightToLeft.
/// </summary>
[Parameter]
[Category(CategoryTypes.RTLProvider.Behavior)]
public bool RightToLeft
{
get => _rtl;
set
{
_rtl = value;
UserAttributes["dir"] = RightToLeft ? "rtl" : "ltr";
}
}
/// <summary>
/// Child content of the component.
/// </summary>
[Parameter]
[Category(CategoryTypes.RTLProvider.Behavior)]
public RenderFragment ChildContent { get; set; }
}