DxCarouselItem.ChildContent Property
Specifies item content.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v25.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public RenderFragment ChildContent { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment | Content markup. |
Remarks
The ChildContent
component parameter can store custom component content that does not belong to other component’s RenderFragment
properties as shown below:
<DxCarousel>
<Items>
@foreach (var item in GetCarouselData()) {
<DxCarouselItem>
<ChildContent>
<div class="caruselItemContainer">
<p class="caruselItemCaption">@item.AlternateText</p>
<img src=@item.Source
alt=@item.AlternateText />
</div>
</ChildContent>
</DxCarouselItem>
}
</Items>
</DxCarousel>
Note
Since ChildContent
contains nested markup of its parent class, the template content must conform to HTML semantics.
You can omit the <ChildContent>
tag and specify the markup directly in the <DxCarouselItem>
tag:
<DxCarousel>
<Items>
@foreach (var item in GetCarouselData()) {
<DxCarouselItem>
<div class="caruselItemContainer">
<p class="caruselItemCaption">@item.AlternateText</p>
<img src=@item.Source
alt=@item.AlternateText />
</div>
</DxCarouselItem>
}
</Items>
</DxCarousel>
See Also