|
1 | | -// Licensed to the .NET Foundation under one or more agreements. |
| 1 | +// Licensed to the .NET Foundation under one or more agreements. |
2 | 2 | // The .NET Foundation licenses this file to you under the Apache 2.0 License |
3 | 3 | // See the LICENSE file in the project root for more information. |
4 | 4 | // Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone |
@@ -197,7 +197,6 @@ public partial class Tab |
197 | 197 | /// 获得/设置 Gets or sets a collection of additional assemblies that should be searched for components that can match URIs. |
198 | 198 | /// </summary> |
199 | 199 | [Parameter] |
200 | | - [NotNull] |
201 | 200 | public IEnumerable<Assembly>? AdditionalAssemblies { get; set; } |
202 | 201 |
|
203 | 202 | /// <summary> |
@@ -529,15 +528,6 @@ protected override void OnParametersSet() |
529 | 528 | ContextMenuCloseAllIcon ??= IconTheme.GetIconByKey(ComponentIcons.TabContextMenuCloseAllIcon); |
530 | 529 | ContextMenuFullScreenIcon ??= IconTheme.GetIconByKey(ComponentIcons.TabContextMenuFullScreenIcon); |
531 | 530 |
|
532 | | - if (AdditionalAssemblies is null) |
533 | | - { |
534 | | - var entryAssembly = Assembly.GetEntryAssembly(); |
535 | | - if (entryAssembly is not null) |
536 | | - { |
537 | | - AdditionalAssemblies = [entryAssembly]; |
538 | | - } |
539 | | - } |
540 | | - |
541 | 531 | if (Placement != Placement.Top && TabStyle == TabStyle.Chrome) |
542 | 532 | { |
543 | 533 | TabStyle = TabStyle.Default; |
@@ -816,6 +806,7 @@ public void AddTab(string url, string text, string? icon = null, bool active = t |
816 | 806 |
|
817 | 807 | private void AddTabItem(string url) |
818 | 808 | { |
| 809 | + AdditionalAssemblies ??= [Assembly.GetEntryAssembly()!]; |
819 | 810 | var parameters = new Dictionary<string, object?> |
820 | 811 | { |
821 | 812 | { nameof(TabItem.Url), url } |
|
0 commit comments