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();
}
SelectionMode="SelectionMode.MultiSelection"instead ofMultiSelection="true"SelectionMode="SelectionMode.MultiSelection" @bind-SelectedValues="SelectedValues"andprivate IReadOnlyCollection<TerseTreeItemData>? SelectedValues { get; set; }after migration of MudBlazor7. github.com/MudBlazor/MudBlazor/pull/8661 Then the question would be theTreeItems type cannot be converted from HashSet to IReadOnlyCollection. Based on my research, it is not solved yet on complex T type.