@@ -295,14 +295,14 @@ private void OnLoaded(object sender, RoutedEventArgs _)
295295 // QueryTextBox.Text change detection (modified to only work when character count is 1 or higher)
296296 QueryTextBox . TextChanged += ( s , e ) => UpdateClockPanelVisibility ( ) ;
297297
298- // Detecting ContextMenu .Visibility changes
298+ // Detecting ResultContextMenu .Visibility changes
299299 DependencyPropertyDescriptor
300- . FromProperty ( VisibilityProperty , typeof ( ContextMenu ) )
301- . AddValueChanged ( ContextMenu , ( s , e ) => UpdateClockPanelVisibility ( ) ) ;
300+ . FromProperty ( VisibilityProperty , typeof ( ResultListBox ) )
301+ . AddValueChanged ( ResultContextMenu , ( s , e ) => UpdateClockPanelVisibility ( ) ) ;
302302
303303 // Detect History.Visibility changes
304304 DependencyPropertyDescriptor
305- . FromProperty ( VisibilityProperty , typeof ( StackPanel ) )
305+ . FromProperty ( VisibilityProperty , typeof ( ResultListBox ) )
306306 . AddValueChanged ( History , ( s , e ) => UpdateClockPanelVisibility ( ) ) ;
307307
308308 // Initialize query state
@@ -1016,7 +1016,7 @@ private void WindowAnimation()
10161016
10171017 private void UpdateClockPanelVisibility ( )
10181018 {
1019- if ( QueryTextBox == null || ContextMenu == null || History == null || ClockPanel == null )
1019+ if ( QueryTextBox == null || ResultContextMenu == null || History == null || ClockPanel == null )
10201020 {
10211021 return ;
10221022 }
@@ -1031,20 +1031,20 @@ private void UpdateClockPanelVisibility()
10311031 } ;
10321032 var animationDuration = TimeSpan . FromMilliseconds ( animationLength * 2 / 3 ) ;
10331033
1034- // ✅ Conditions for showing ClockPanel (No query input & ContextMenu, History are closed)
1034+ // ✅ Conditions for showing ClockPanel (No query input / ResultContextMenu & History are closed)
10351035 var shouldShowClock = QueryTextBox . Text . Length == 0 &&
1036- ContextMenu . Visibility != Visibility . Visible &&
1036+ ResultContextMenu . Visibility != Visibility . Visible &&
10371037 History . Visibility != Visibility . Visible ;
10381038
1039- // ✅ 1. When ContextMenu opens, immediately set Visibility.Hidden (force hide without animation)
1040- if ( ContextMenu . Visibility == Visibility . Visible )
1039+ // ✅ 1. When ResultContextMenu opens, immediately set Visibility.Hidden (force hide without animation)
1040+ if ( ResultContextMenu . Visibility == Visibility . Visible )
10411041 {
10421042 _viewModel . ClockPanelVisibility = Visibility . Hidden ;
10431043 _viewModel . ClockPanelOpacity = 0.0 ; // Set to 0 in case Opacity animation affects it
10441044 return ;
10451045 }
10461046
1047- // ✅ 2. When ContextMenu is closed, keep it Hidden if there's text in the query (remember previous state)
1047+ // ✅ 2. When ResultContextMenu is closed, keep it Hidden if there's text in the query (remember previous state)
10481048 else if ( QueryTextBox . Text . Length > 0 )
10491049 {
10501050 _viewModel . ClockPanelVisibility = Visibility . Hidden ;
0 commit comments