Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

MudBlazor 7 issue with MudTreeView (

$
0
0

I recently upgraded to MudBazor v7 and have been working through the compilation issues. This one's foxed me and I'm not sure how to fix.

<MudTreeView Items="TreeItems" MultiSelection="true"><ItemTemplate><MudTreeViewItem Expanded="true" Items="@context.TreeItems" Value="@context" Text="@context.Title" /></ItemTemplate></MudTreeView>

I get an error on the first line. Looking at the example the only obvious thing is that I don't have an @ before "TreeItems". Adding that doesn't change the error message.

The error I'm getting is:

CS0411 The type arguments for method 'TypeInference.CreateMudTreeView_1_CaptureParameters(IReadOnlyCollection<TreeItemData>, out IReadOnlyCollection<TreeItemData>, object, out object)' cannot be inferred from the usage. Try specifying the type arguments explicitly.

But I'm not sure how to fix this.

The property referenced by Items is:

protected HashSet<TerseTreeItemData>? TreeItems = null;

Where TerseTreeItemData is a simple class:

public class TerseTreeItemData{    public string Title { get; set; } = default!;    public HashSet<TerseTreeItemData>? TreeItems { get; set; } = new();}

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>