@@ -295,14 +295,14 @@ private void OnLoaded(object sender, RoutedEventArgs _)
295
295
// QueryTextBox.Text change detection (modified to only work when character count is 1 or higher)
296
296
QueryTextBox . TextChanged += ( s , e ) => UpdateClockPanelVisibility ( ) ;
297
297
298
- // Detecting ContextMenu .Visibility changes
298
+ // Detecting ResultContextMenu .Visibility changes
299
299
DependencyPropertyDescriptor
300
- . FromProperty ( VisibilityProperty , typeof ( ContextMenu ) )
301
- . AddValueChanged ( ContextMenu , ( s , e ) => UpdateClockPanelVisibility ( ) ) ;
300
+ . FromProperty ( VisibilityProperty , typeof ( ResultListBox ) )
301
+ . AddValueChanged ( ResultContextMenu , ( s , e ) => UpdateClockPanelVisibility ( ) ) ;
302
302
303
303
// Detect History.Visibility changes
304
304
DependencyPropertyDescriptor
305
- . FromProperty ( VisibilityProperty , typeof ( StackPanel ) )
305
+ . FromProperty ( VisibilityProperty , typeof ( ResultListBox ) )
306
306
. AddValueChanged ( History , ( s , e ) => UpdateClockPanelVisibility ( ) ) ;
307
307
308
308
// Initialize query state
@@ -1016,7 +1016,7 @@ private void WindowAnimation()
1016
1016
1017
1017
private void UpdateClockPanelVisibility ( )
1018
1018
{
1019
- if ( QueryTextBox == null || ContextMenu == null || History == null || ClockPanel == null )
1019
+ if ( QueryTextBox == null || ResultContextMenu == null || History == null || ClockPanel == null )
1020
1020
{
1021
1021
return ;
1022
1022
}
@@ -1031,20 +1031,20 @@ private void UpdateClockPanelVisibility()
1031
1031
} ;
1032
1032
var animationDuration = TimeSpan . FromMilliseconds ( animationLength * 2 / 3 ) ;
1033
1033
1034
- // ✅ Conditions for showing ClockPanel (No query input & ContextMenu, History are closed)
1034
+ // ✅ Conditions for showing ClockPanel (No query input / ResultContextMenu & History are closed)
1035
1035
var shouldShowClock = QueryTextBox . Text . Length == 0 &&
1036
- ContextMenu . Visibility != Visibility . Visible &&
1036
+ ResultContextMenu . Visibility != Visibility . Visible &&
1037
1037
History . Visibility != Visibility . Visible ;
1038
1038
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 )
1041
1041
{
1042
1042
_viewModel . ClockPanelVisibility = Visibility . Hidden ;
1043
1043
_viewModel . ClockPanelOpacity = 0.0 ; // Set to 0 in case Opacity animation affects it
1044
1044
return ;
1045
1045
}
1046
1046
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)
1048
1048
else if ( QueryTextBox . Text . Length > 0 )
1049
1049
{
1050
1050
_viewModel . ClockPanelVisibility = Visibility . Hidden ;
0 commit comments