@@ -67,8 +67,6 @@ public GridLength TitleBarWidth
6767
6868 public static event EventHandler < TabBarItem ? > ? SelectedTabItemChanged ;
6969
70- public event EventHandler < SizeChangedEventArgs > ? TabControlAreaSizeChanged ;
71-
7270 // Constructor
7371
7472 public TabBar ( )
@@ -96,9 +94,6 @@ public TabBar()
9694 } ;
9795 }
9896
99- private void BaseTabBar_Loaded ( object sender , RoutedEventArgs e )
100- => MainWindow . Instance . AppWindow . Changed += ( _ , _ ) => MainWindow . Instance . RaiseSetTitleBarDragRegion ( SetTitleBarDragRegion ) ;
101-
10297 private void TabView_TabItemsChanged ( TabView sender , Windows . Foundation . Collections . IVectorChangedEventArgs args )
10398 {
10499 if ( args . CollectionChange == Windows . Foundation . Collections . CollectionChange . ItemRemoved )
@@ -383,17 +378,9 @@ private void TabViewItem_Loaded(object sender, RoutedEventArgs e)
383378 }
384379
385380 private void DragAreaRectangle_Loaded ( object sender , RoutedEventArgs e )
386- {
387- var width = HorizontalTabView . ActualWidth - TabBarAddNewTabButton . Width - TitleBarWidth . Value ;
388- var height = HorizontalTabView . ActualHeight ;
389- HorizontalTabView . Measure ( new ( width >= 0 ? width : 0 , height >= 0 ? height : 0 ) ) ;
390-
391- MainWindow . Instance . RaiseSetTitleBarDragRegion ( SetTitleBarDragRegion ) ;
392- SizeChanged += ( s , e ) => TabControlAreaSizeChanged ? . Invoke ( s , e ) ;
393- DragArea . SizeChanged += ( s , e ) => TabControlAreaSizeChanged ? . Invoke ( s , e ) ;
394- }
381+ => HorizontalTabView . Measure ( new ( HorizontalTabView . ActualWidth - TabBarAddNewTabButton . Width - TitleBarWidth . Value , HorizontalTabView . ActualHeight ) ) ;
395382
396- private int SetTitleBarDragRegion ( InputNonClientPointerSource source , SizeInt32 size , double scaleFactor , Func < UIElement , RectInt32 ? , RectInt32 > getScaledRect )
383+ public int SetTitleBarDragRegion ( InputNonClientPointerSource source , SizeInt32 size , double scaleFactor , Func < UIElement , RectInt32 ? , RectInt32 > getScaledRect )
397384 {
398385 var height = ( int ) ActualHeight ;
399386 var width = ( int ) ( ActualWidth - DragArea . ActualWidth ) ;
0 commit comments