Skip to content

Commit

Permalink
render item in tree public for base
Browse files Browse the repository at this point in the history
  • Loading branch information
fgilde committed Dec 8, 2024
1 parent c26e1fd commit f462e03
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
@using MudBlazor.Extensions.Components.ObjectEdit
@using Nextended.Core.Extensions
@using Nextended.Core.Types
@using YamlDotNet.Core.Tokens
@inherits MudExBaseComponent<MudExTreeViewBase<TItem>>
@namespace MudBlazor.Extensions.Components

Expand Down Expand Up @@ -34,6 +33,8 @@

public RenderFragment RenderItemContent(TreeViewItemContext<TItem> context) => RenderItemContent(context, false);

public virtual RenderFragment RenderItem(TreeViewItemContext<TItem> context) => null;

protected virtual RenderFragment RenderItemContent(TreeViewItemContext<TItem> context, bool checkTemplate)
{
if (checkTemplate && ItemContentTemplate != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
return IsSeparator(item) ? RenderSeparator() : RenderItem(context);
}

public virtual RenderFragment RenderItem(TreeViewItemContext<T> context)
public override RenderFragment RenderItem(TreeViewItemContext<T> context)
{
return
@<RenderChild>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}


public virtual RenderFragment RenderItem(TreeViewItemContext<T> context)
public override RenderFragment RenderItem(TreeViewItemContext<T> context)
{
return @<MudCard Class="@ItemClassStr(context)" Style="@ItemStyleStr(context)" @onclick="@(() => { NodeClick(context.Value); })">
<MudCardHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
return IsSeparator(context.Value) ? RenderSeparator() : RenderItem(context);
}

public virtual RenderFragment RenderItem(TreeViewItemContext<T> context)
public override RenderFragment RenderItem(TreeViewItemContext<T> context)
{
return @<MudExVirtualItem Virtualize="@Virtualize">
<MudTreeViewItem @bind-Expanded="@context.Expanded"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
return IsSeparator(item) ? RenderSeparator() : RenderItem(context);
}

public virtual RenderFragment RenderItem(TreeViewItemContext<T> context)
public override RenderFragment RenderItem(TreeViewItemContext<T> context)
{
return
@<MudListItem T="T" Value="@context.Value" Style="@ItemStyleStr(context)" Class="@ItemClassStr(context)" OnClick="@(() => NodeClick(context.Value))">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
return IsSeparator(item) ? RenderSeparator() : RenderItem(context);
}

public virtual RenderFragment RenderItem(TreeViewItemContext<T> context)
public override RenderFragment RenderItem(TreeViewItemContext<T> context)
{
return
@<div class="@InnerItemClassStr()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@RenderBackNode("margin-left: 10px")
}
</MudToolBar>
<MudDivider/>
<MudExDivider/>
</RenderChild>;
}

Expand Down Expand Up @@ -67,7 +67,7 @@
return IsSeparator(item) ? RenderSeparator() : RenderItem(context);
}

public virtual RenderFragment RenderItem(TreeViewItemContext<T> context)
public override RenderFragment RenderItem(TreeViewItemContext<T> context)
{
return
@<MudListItem T="T" Style="@ItemStyleStr(context)" Value="@context.Value" Class="@ItemClassStr(context)" OnClick="@(() => NodeClick(context.Value))">
Expand Down

0 comments on commit f462e03

Please sign in to comment.