@@ -67,19 +67,24 @@ public MainWindow()
6767 DragDropHelper . AttachDragOverTerminator ( this ) ;
6868
6969 // Window状態初期化
70+ Trace . WriteLine ( "Initialize WindowShapeSnap" ) ;
7071 InitializeWindowShapeSnap ( ) ;
7172
7273 // win proc
7374 _windowProcedure = new WindowProcedure ( this ) ;
7475
76+ Trace . WriteLine ( "Initialize WindowStateManager" ) ;
7577 _windowStateManager = new WindowStateManager ( this ) ;
7678 _windowController = new MainWindowController ( this , _windowStateManager ) ;
7779
80+ Trace . WriteLine ( "Initialize ContextMenuWatcher" ) ;
7881 ContextMenuWatcher . Initialize ( ) ;
7982
83+ Trace . WriteLine ( "Initialize MouseHorizontalWheelService" ) ;
8084 MouseHorizontalWheelService . SubscribeHorizontalWheelEvent ( this ) ;
8185
8286 // 固定画像初期化
87+ Trace . WriteLine ( "Initialize StaticImages" ) ;
8388 ThumbnailResource . InitializeStaticImages ( ) ;
8489 _ = FileIconCollection . Current . InitializeAsync ( ) ;
8590
@@ -90,6 +95,7 @@ public MainWindow()
9095 //ContentDropManager.Current.SetDragDropEvent(MainView);
9196
9297 // ViewComponent
98+ Trace . WriteLine ( "Initialize MainViewComponent" ) ;
9399 MainViewComponent . Initialize ( ) ;
94100 _viewComponent = MainViewComponent . Current ;
95101
@@ -123,6 +129,7 @@ public MainWindow()
123129 RoutedCommandTable . Current . AddMouseInput ( new MouseInput ( mouseContext ) ) ;
124130
125131 // サイドパネル初期化
132+ Trace . WriteLine ( "Initialize CustomLayoutPanelManager" ) ;
126133 CustomLayoutPanelManager . Initialize ( ) ;
127134
128135 // 各コントロールとモデルを関連付け
@@ -172,12 +179,11 @@ public MainWindow()
172179 }
173180 } ) ;
174181
175-
176-
177182 _windowController . SubscribePropertyChanged ( nameof ( MainWindowController . AutoHideMode ) ,
178183 ( s , e ) => AutoHideModeChanged ( ) ) ;
179184
180185 // initialize routed commands
186+ Trace . WriteLine ( "Initialize RoutedCommandTable" ) ;
181187 RoutedCommandTable . Current . UpdateInputGestures ( ) ;
182188
183189 // watch menu bar visibility
@@ -194,6 +200,7 @@ public MainWindow()
194200 this . PreviewStylusDown += MainWindow_PreviewStylusDown ;
195201
196202 // mouse activate
203+ Trace . WriteLine ( "Mouse activate" ) ;
197204 _mouseActivate = new MouseActivate ( this ) ;
198205
199206 // key event for window
@@ -209,9 +216,11 @@ public MainWindow()
209216 CompositionTarget . Rendering += OnRendering ;
210217
211218 // message layer space
219+ Trace . WriteLine ( "Initialize MessageLayerSpace" ) ;
212220 InitializeMessageLayerSpace ( ) ;
213221
214222 // page caption
223+ Trace . WriteLine ( "Initialize PageCaption" ) ;
215224 InitializePageCaption ( ) ;
216225
217226 // side panel quick hide
@@ -224,6 +233,7 @@ public MainWindow()
224233 Debug_Initialize ( ) ;
225234
226235 Debug . WriteLine ( $ "App.MainWindow.Initialize.Done: { App . Current . Stopwatch . ElapsedMilliseconds } ms") ;
236+ Trace . WriteLine ( "App.MainWindow.Initialize Done" ) ;
227237 }
228238
229239
@@ -452,6 +462,7 @@ protected override void OnSourceInitialized(EventArgs e)
452462
453463 if ( App . Current . Resources [ "Window.Background" ] is SolidColorBrush brush )
454464 {
465+ Trace . WriteLine ( "Win32 Background Brushes" ) ;
455466 // Win32 の背景ブラシを設定して起動時のちらつきを軽減するテスト
456467 var hwnd = new WindowInteropHelper ( this ) . Handle ;
457468 uint color = ( uint ) ( brush . Color . B << 16 | brush . Color . G << 8 | brush . Color . R ) ;
@@ -461,13 +472,16 @@ protected override void OnSourceInitialized(EventArgs e)
461472 }
462473
463474 // Chrome の情報を最新にする
475+ Trace . WriteLine ( "Refresh window state" ) ;
464476 _windowController . Refresh ( ) ;
465477
466478 // ウィンドウ座標の復元
467479 // NOTE: PInvoke.SetWindowPlacement() を呼ぶとLoadedイベントが発生する。WindowPlacementの処理順番に注意
480+ Trace . WriteLine ( "Initialize window place" ) ;
468481 InitializeWindowPlace ( ) ;
469482
470483 Debug . WriteLine ( $ "App.MainWindow.SourceInitialized.Done: { App . Current . Stopwatch . ElapsedMilliseconds } ms") ;
484+ Trace . WriteLine ( "App.MainWindow.SourceInitialized Done" ) ;
471485 }
472486
473487 private void MainWindow_SourceInitialized ( object sender , EventArgs e )
@@ -483,16 +497,20 @@ private void MainWindow_Loaded(object sender, RoutedEventArgs e)
483497
484498 _dpiProvider . SetDipScale ( VisualTreeHelper . GetDpi ( this ) ) ;
485499
500+ Trace . WriteLine ( "Initialize PendingItemManager" ) ;
486501 PendingItemManager . Initialize ( this ) ;
487502
503+ Trace . WriteLine ( "Update MainViewManager" ) ;
488504 MainViewManager . Current . Update ( false ) ;
489505
490506 // レイアウト更新
491507 DirtyWindowLayout ( ) ;
492508
493509 // WinProc登録
510+ Trace . WriteLine ( "Initialize SystemDeviceWatcher" ) ;
494511 SystemDeviceWatcher . Current . Initialize ( this ) ;
495512
513+ Trace . WriteLine ( "ViewModel.Loaded" ) ;
496514 _vm . Loaded ( ) ;
497515
498516 if ( InputGestureDisplayString . ErrorMessages . Count > 0 )
@@ -508,14 +526,16 @@ private void MainWindow_Loaded(object sender, RoutedEventArgs e)
508526 this . Activate ( ) ;
509527 }
510528
511- Trace . WriteLine ( $ "App.MainWindow.Loaded.Done: { App . Current . Stopwatch . ElapsedMilliseconds } ms") ;
529+ Debug . WriteLine ( $ "App.MainWindow.Loaded.Done: { App . Current . Stopwatch . ElapsedMilliseconds } ms") ;
530+ Trace . WriteLine ( "App.MainWindow.Loaded Done" ) ;
512531 }
513532
514533 // ウィンドウコンテンツ表示開始
515534 private async void MainWindow_ContentRendered ( object sender , EventArgs e )
516535 {
517536 Debug . WriteLine ( $ "App.MainWindow.ContentRendered: { App . Current . Stopwatch . ElapsedMilliseconds } ms") ;
518537
538+ Trace . WriteLine ( "ViewModel.ContentRenderedAsync" ) ;
519539 await _vm . ContentRenderedAsync ( ) ;
520540
521541 // focus
@@ -525,6 +545,7 @@ private async void MainWindow_ContentRendered(object sender, EventArgs e)
525545 }
526546
527547 Debug . WriteLine ( $ "App.MainWindow.ContentRendered.Done: { App . Current . Stopwatch . ElapsedMilliseconds } ms") ;
548+ Trace . WriteLine ( "App.MainWindow.ContentRendered Done" ) ;
528549
529550 // 初回起動ダイアログ
530551 if ( ! Config . Current . System . IsLoadedSettings )
@@ -1036,6 +1057,7 @@ public RenameManager GetRenameManager()
10361057 [ Conditional ( "DEBUG" ) ]
10371058 private static void Debug_Initialize ( )
10381059 {
1060+ Trace . WriteLine ( "Initialize Debug" ) ;
10391061 DebugGesture . Initialize ( App . Current . MainWindow ) ;
10401062 }
10411063
0 commit comments