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/Card/CardMedia.razor.cs

40 lines
933 B

using Connected.Annotations;
using Connected.Utilities;
using Microsoft.AspNetCore.Components;
namespace Connected.Components;
public partial class CardMedia : UIComponent
{
protected string StyleString =>
StyleBuilder.Default($"background-image:url(\"{Image}\");height: {Height}px;")
.AddStyle(this.Style)
.Build();
protected string Classname =>
new CssBuilder("mud-card-media")
.AddClass(Class)
.Build();
/// <summary>
/// Title of the image used for accessibility.
/// </summary>
[Parameter]
[Category(CategoryTypes.Card.Behavior)]
public string Title { get; set; }
/// <summary>
/// Specifies the path to the image.
/// </summary>
[Parameter]
[Category(CategoryTypes.Card.Behavior)]
public string Image { get; set; }
/// <summary>
/// Specifies the height of the image in px.
/// </summary>
[Parameter]
[Category(CategoryTypes.Card.Behavior)]
public int Height { get; set; } = 300;
}