3
3
// See the LICENSE file in the project root for more information.
4
4
5
5
using System . Threading . Tasks ;
6
- using Microsoft . Toolkit . Uwp . UI . Animations ;
7
6
using Microsoft . Toolkit . Uwp . UI . Controls ;
8
7
using Microsoft . Toolkit . Uwp . UI . Extensions ;
9
8
using Windows . UI . Xaml ;
@@ -13,7 +12,6 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
13
12
{
14
13
public sealed partial class LoadingPage : IXamlRenderListener
15
14
{
16
- private AdaptiveGridView adaptiveGridViewControl ;
17
15
private Loading loadingControl ;
18
16
private ContentControl loadingContentControl ;
19
17
private ResourceDictionary resources ;
@@ -26,14 +24,13 @@ public LoadingPage()
26
24
27
25
public async void OnXamlRendered ( FrameworkElement control )
28
26
{
29
- adaptiveGridViewControl = control . FindChildByName ( "AdaptiveGridViewControl" ) as AdaptiveGridView ;
30
27
loadingControl = control . FindDescendantByName ( "LoadingControl" ) as Loading ;
31
28
loadingContentControl = control . FindChildByName ( "LoadingContentControl" ) as ContentControl ;
32
29
resources = control . Resources ;
33
30
34
- if ( adaptiveGridViewControl != null )
31
+ if ( control . FindChildByName ( "AdaptiveGridViewControl" ) is AdaptiveGridView gridView )
35
32
{
36
- adaptiveGridViewControl . ItemsSource = await new Data . PhotosDataSource ( ) . GetItemsAsync ( ) ;
33
+ gridView . ItemsSource = await new Data . PhotosDataSource ( ) . GetItemsAsync ( ) ;
37
34
}
38
35
}
39
36
@@ -57,22 +54,20 @@ private void Load()
57
54
}
58
55
} ) ;
59
56
60
- SampleController . Current . RegisterNewCommand ( "Loading control with logo and blurring when requested " , async ( sender , args ) =>
57
+ SampleController . Current . RegisterNewCommand ( "Loading control with logo" , async ( sender , args ) =>
61
58
{
62
59
if ( loadingContentControl != null )
63
60
{
64
61
loadingContentControl . ContentTemplate = resources [ "LogoTemplate" ] as DataTemplate ;
65
- await loadingContentControl . Blur ( 2 , 100 ) . StartAsync ( ) ;
66
62
await ShowLoadingDialogAsync ( ) ;
67
- await loadingContentControl . Blur ( 0 , 0 ) . StartAsync ( ) ;
68
63
}
69
64
} ) ;
70
65
}
71
66
72
67
private async Task ShowLoadingDialogAsync ( )
73
68
{
74
69
loadingControl . IsLoading = true ;
75
- await Task . Delay ( 3000 ) ;
70
+ await Task . Delay ( 5000 ) ;
76
71
loadingControl . IsLoading = false ;
77
72
}
78
73
}
0 commit comments