@@ -114,6 +114,12 @@ public partial class Tab : IHandlerException
114114 [ Parameter ]
115115 public bool ShowFullScreen { get ; set ; }
116116
117+ /// <summary>
118+ /// Gets or sets whether show the full screen button on context menu. Default is true.
119+ /// </summary>
120+ [ Parameter ]
121+ public bool ShowContextMenuFullScreen { get ; set ; } = true ;
122+
117123 /// <summary>
118124 /// 关闭标签页回调方法
119125 /// </summary>
@@ -401,6 +407,12 @@ public partial class Tab : IHandlerException
401407 [ Parameter ]
402408 public string ? ContextMenuCloseAllIcon { get ; set ; }
403409
410+ /// <summary>
411+ /// Gets or sets the icon of tab item context menu full screen button. Default is null.
412+ /// </summary>
413+ [ Parameter ]
414+ public string ? ContextMenuFullScreenIcon { get ; set ; }
415+
404416 /// <summary>
405417 /// Gets or sets before popup context menu callback. Default is null.
406418 /// </summary>
@@ -433,6 +445,10 @@ public partial class Tab : IHandlerException
433445 [ Inject , NotNull ]
434446 private DialogService ? DialogService { get ; set ; }
435447
448+ [ Inject ]
449+ [ NotNull ]
450+ private FullScreenService ? FullScreenService { get ; set ; }
451+
436452 private ContextMenuZone ? _contextMenuZone ;
437453
438454 private ConcurrentDictionary < TabItem , bool > LazyTabCache { get ; } = new ( ) ;
@@ -490,6 +506,7 @@ protected override void OnParametersSet()
490506 ContextMenuCloseIcon ??= IconTheme . GetIconByKey ( ComponentIcons . TabContextMenuCloseIcon ) ;
491507 ContextMenuCloseOtherIcon ??= IconTheme . GetIconByKey ( ComponentIcons . TabContextMenuCloseOtherIcon ) ;
492508 ContextMenuCloseAllIcon ??= IconTheme . GetIconByKey ( ComponentIcons . TabContextMenuCloseAllIcon ) ;
509+ ContextMenuFullScreenIcon ??= IconTheme . GetIconByKey ( ComponentIcons . TabContextMenuFullScreenIcon ) ;
493510
494511 if ( AdditionalAssemblies is null )
495512 {
@@ -1016,7 +1033,7 @@ public async Task DragItemCallback(int originIndex, int currentIndex)
10161033 }
10171034 }
10181035
1019- private string ? GetIdByTabItem ( TabItem item ) => ComponentIdGenerator . Generate ( item ) ;
1036+ private string GetIdByTabItem ( TabItem item ) => ComponentIdGenerator . Generate ( item ) ;
10201037
10211038 private async Task OnRefreshAsync ( )
10221039 {
@@ -1075,6 +1092,14 @@ private Task OnCloseAll(ContextMenuItem item, object? context)
10751092 return Task . CompletedTask ;
10761093 }
10771094
1095+ private async Task OnFullScreen ( ContextMenuItem item , object ? context )
1096+ {
1097+ if ( context is TabItem tabItem )
1098+ {
1099+ await FullScreenService . ToggleById ( GetIdByTabItem ( tabItem ) ) ;
1100+ }
1101+ }
1102+
10781103 private async Task OnContextMenu ( MouseEventArgs e , TabItem item )
10791104 {
10801105 if ( _contextMenuZone != null )
0 commit comments