33// See the LICENSE file in the project root for more information.
44
55using System . Threading . Tasks ;
6- using Microsoft . Toolkit . Uwp . UI . Animations ;
76using Microsoft . Toolkit . Uwp . UI . Controls ;
87using Microsoft . Toolkit . Uwp . UI . Extensions ;
98using Windows . UI . Xaml ;
@@ -13,7 +12,6 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
1312{
1413 public sealed partial class LoadingPage : IXamlRenderListener
1514 {
16- private AdaptiveGridView adaptiveGridViewControl ;
1715 private Loading loadingControl ;
1816 private ContentControl loadingContentControl ;
1917 private ResourceDictionary resources ;
@@ -26,14 +24,13 @@ public LoadingPage()
2624
2725 public async void OnXamlRendered ( FrameworkElement control )
2826 {
29- adaptiveGridViewControl = control . FindChildByName ( "AdaptiveGridViewControl" ) as AdaptiveGridView ;
3027 loadingControl = control . FindDescendantByName ( "LoadingControl" ) as Loading ;
3128 loadingContentControl = control . FindChildByName ( "LoadingContentControl" ) as ContentControl ;
3229 resources = control . Resources ;
3330
34- if ( adaptiveGridViewControl != null )
31+ if ( control . FindChildByName ( "AdaptiveGridViewControl" ) is AdaptiveGridView gridView )
3532 {
36- adaptiveGridViewControl . ItemsSource = await new Data . PhotosDataSource ( ) . GetItemsAsync ( ) ;
33+ gridView . ItemsSource = await new Data . PhotosDataSource ( ) . GetItemsAsync ( ) ;
3734 }
3835 }
3936
@@ -57,22 +54,20 @@ private void Load()
5754 }
5855 } ) ;
5956
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 ) =>
6158 {
6259 if ( loadingContentControl != null )
6360 {
6461 loadingContentControl . ContentTemplate = resources [ "LogoTemplate" ] as DataTemplate ;
65- await loadingContentControl . Blur ( 2 , 100 ) . StartAsync ( ) ;
6662 await ShowLoadingDialogAsync ( ) ;
67- await loadingContentControl . Blur ( 0 , 0 ) . StartAsync ( ) ;
6863 }
6964 } ) ;
7065 }
7166
7267 private async Task ShowLoadingDialogAsync ( )
7368 {
7469 loadingControl . IsLoading = true ;
75- await Task . Delay ( 3000 ) ;
70+ await Task . Delay ( 5000 ) ;
7671 loadingControl . IsLoading = false ;
7772 }
7873 }
0 commit comments