@@ -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>
@@ -433,6 +439,10 @@ public partial class Tab : IHandlerException
433439 [ Inject , NotNull ]
434440 private DialogService ? DialogService { get ; set ; }
435441
442+ [ Inject ]
443+ [ NotNull ]
444+ private FullScreenService ? FullScreenService { get ; set ; }
445+
436446 private ContextMenuZone ? _contextMenuZone ;
437447
438448 private ConcurrentDictionary < TabItem , bool > LazyTabCache { get ; } = new ( ) ;
@@ -1016,7 +1026,7 @@ public async Task DragItemCallback(int originIndex, int currentIndex)
10161026 }
10171027 }
10181028
1019- private string ? GetIdByTabItem ( TabItem item ) => ComponentIdGenerator . Generate ( item ) ;
1029+ private string GetIdByTabItem ( TabItem item ) => ComponentIdGenerator . Generate ( item ) ;
10201030
10211031 private async Task OnRefreshAsync ( )
10221032 {
@@ -1075,6 +1085,14 @@ private Task OnCloseAll(ContextMenuItem item, object? context)
10751085 return Task . CompletedTask ;
10761086 }
10771087
1088+ private async Task OnFullScreen ( ContextMenuItem item , object ? context )
1089+ {
1090+ if ( context is TabItem tabItem )
1091+ {
1092+ await FullScreenService . ToggleById ( GetIdByTabItem ( tabItem ) ) ;
1093+ }
1094+ }
1095+
10781096 private async Task OnContextMenu ( MouseEventArgs e , TabItem item )
10791097 {
10801098 if ( _contextMenuZone != null )
0 commit comments