File tree 1 file changed +10
-14
lines changed
1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -72,20 +72,16 @@ public void Refresh()
72
72
73
73
private async void SetRandomBlurredBackground ( )
74
74
{
75
- if ( GameInfoList . Count > 5 )
75
+ if ( GameInfoList . Count <= 5 ) return ;
76
+
77
+ BitmapSource ? image = await Task . Run ( GetRandomBlurredImage ) ;
78
+ if ( image != null )
76
79
{
77
- await Task . Run ( ( ) =>
78
- {
79
- BitmapSource ? image = GetRandomBlurredImage ( ) ;
80
- if ( image != null )
81
- {
82
- Dispatcher . BeginInvoke ( ( ) =>
83
- {
84
- Background = new ImageBrush ( image ) ;
85
- PlayFadeInAnimation ( this ) ;
86
- } ) ;
87
- }
88
- } ) ;
80
+ await Dispatcher . BeginInvoke ( ( ) =>
81
+ {
82
+ Background = new ImageBrush ( image ) ;
83
+ PlayFadeInAnimation ( this ) ;
84
+ } ) ;
89
85
}
90
86
}
91
87
@@ -126,7 +122,7 @@ private static void PlayFadeInAnimation(UIElement element)
126
122
{
127
123
From = 0 ,
128
124
To = 1 ,
129
- Duration = TimeSpan . FromMilliseconds ( 1000 ) ,
125
+ Duration = TimeSpan . FromSeconds ( 1 ) ,
130
126
EasingFunction = new QuadraticEase { EasingMode = EasingMode . EaseOut }
131
127
} ;
132
128
You can’t perform that action at this time.
0 commit comments