@@ -519,14 +519,19 @@ public async void CheckPathInput<T>(ItemViewModel<T> instance, string CurrentInp
519
519
private void LocationsList_ItemClick ( object sender , ItemClickEventArgs e )
520
520
{
521
521
ListViewItem clickedItem = Interaction < ProHome > . FindParent < ListViewItem > ( e . ClickedItem as DependencyObject ) ;
522
- ItemViewModel < GenericFileBrowser > instance = null ;
522
+ if ( accessibleContentFrame . SourcePageType == typeof ( GenericFileBrowser ) )
523
+ {
524
+ ( accessibleContentFrame . Content as GenericFileBrowser ) . instanceViewModel . CancelLoadAndClearFiles ( ) ;
525
+ }
526
+ else if ( accessibleContentFrame . SourcePageType == typeof ( PhotoAlbum ) )
527
+ {
528
+ ( accessibleContentFrame . Content as PhotoAlbum ) . instanceViewModel . CancelLoadAndClearFiles ( ) ;
529
+ }
523
530
524
531
if ( clickedItem . Tag . ToString ( ) == "Favorites" )
525
532
{
526
533
ItemDisplayFrame . Navigate ( typeof ( YourHome ) ) ;
527
534
PathText . Text = "Favorites" ;
528
- ItemViewModel < YourHome > homeInstance = ( this . accessibleContentFrame . Content as YourHome ) . instanceViewModel ;
529
- homeInstance . CancelLoadAndClearFiles ( ) ;
530
535
HomeItems . isEnabled = false ;
531
536
ShareItems . isEnabled = false ;
532
537
if ( DrivesList . SelectedItem != null )
@@ -540,7 +545,6 @@ private void LocationsList_ItemClick(object sender, ItemClickEventArgs e)
540
545
{
541
546
ItemDisplayFrame . Navigate ( typeof ( GenericFileBrowser ) , DesktopPath ) ;
542
547
PathText . Text = "Desktop" ;
543
- instance = ( this . accessibleContentFrame . Content as GenericFileBrowser ) . instanceViewModel ;
544
548
HomeItems . isEnabled = false ;
545
549
ShareItems . isEnabled = false ;
546
550
if ( DrivesList . SelectedItem != null )
@@ -554,7 +558,6 @@ private void LocationsList_ItemClick(object sender, ItemClickEventArgs e)
554
558
{
555
559
ItemDisplayFrame . Navigate ( typeof ( GenericFileBrowser ) , DownloadsPath ) ;
556
560
PathText . Text = "Downloads" ;
557
- instance = ( this . accessibleContentFrame . Content as GenericFileBrowser ) . instanceViewModel ;
558
561
HomeItems . isEnabled = false ;
559
562
ShareItems . isEnabled = false ;
560
563
if ( DrivesList . SelectedItem != null )
@@ -568,7 +571,6 @@ private void LocationsList_ItemClick(object sender, ItemClickEventArgs e)
568
571
{
569
572
ItemDisplayFrame . Navigate ( typeof ( GenericFileBrowser ) , DocumentsPath ) ;
570
573
PathText . Text = "Documents" ;
571
- instance = ( this . accessibleContentFrame . Content as GenericFileBrowser ) . instanceViewModel ;
572
574
HomeItems . isEnabled = false ;
573
575
ShareItems . isEnabled = false ;
574
576
if ( DrivesList . SelectedItem != null )
@@ -582,7 +584,6 @@ private void LocationsList_ItemClick(object sender, ItemClickEventArgs e)
582
584
{
583
585
ItemDisplayFrame . Navigate ( typeof ( PhotoAlbum ) , PicturesPath ) ;
584
586
PathText . Text = "Pictures" ;
585
- ItemViewModel < PhotoAlbum > PAInstance = ( this . accessibleContentFrame . Content as PhotoAlbum ) . instanceViewModel ;
586
587
HomeItems . isEnabled = false ;
587
588
ShareItems . isEnabled = false ;
588
589
if ( DrivesList . SelectedItem != null )
@@ -596,7 +597,6 @@ private void LocationsList_ItemClick(object sender, ItemClickEventArgs e)
596
597
{
597
598
ItemDisplayFrame . Navigate ( typeof ( GenericFileBrowser ) , MusicPath ) ;
598
599
PathText . Text = "Music" ;
599
- instance = ( this . accessibleContentFrame . Content as GenericFileBrowser ) . instanceViewModel ;
600
600
HomeItems . isEnabled = false ;
601
601
ShareItems . isEnabled = false ;
602
602
if ( DrivesList . SelectedItem != null )
@@ -610,7 +610,6 @@ private void LocationsList_ItemClick(object sender, ItemClickEventArgs e)
610
610
{
611
611
ItemDisplayFrame . Navigate ( typeof ( GenericFileBrowser ) , VideosPath ) ;
612
612
PathText . Text = "Videos" ;
613
- instance = ( this . accessibleContentFrame . Content as GenericFileBrowser ) . instanceViewModel ;
614
613
HomeItems . isEnabled = false ;
615
614
ShareItems . isEnabled = false ;
616
615
if ( DrivesList . SelectedItem != null )
@@ -624,7 +623,6 @@ private void LocationsList_ItemClick(object sender, ItemClickEventArgs e)
624
623
{
625
624
ItemDisplayFrame . Navigate ( typeof ( GenericFileBrowser ) , clickedItem . Tag ) ;
626
625
PathText . Text = clickedItem . Tag . ToString ( ) ;
627
- instance = ( this . accessibleContentFrame . Content as GenericFileBrowser ) . instanceViewModel ;
628
626
HomeItems . isEnabled = false ;
629
627
ShareItems . isEnabled = false ;
630
628
if ( DrivesList . SelectedItem != null )
@@ -642,6 +640,7 @@ private void DrivesList_ItemClick(object sender, ItemClickEventArgs e)
642
640
if ( this . accessibleContentFrame . SourcePageType == typeof ( GenericFileBrowser ) )
643
641
{
644
642
var instance = ( this . accessibleContentFrame . Content as GenericFileBrowser ) . instanceViewModel ;
643
+ instance . CancelLoadAndClearFiles ( ) ;
645
644
HomeItems . isEnabled = false ;
646
645
ShareItems . isEnabled = false ;
647
646
if ( LocationsList . SelectedItem != null )
@@ -673,7 +672,6 @@ private void DrivesList_ItemClick(object sender, ItemClickEventArgs e)
673
672
}
674
673
else if ( this . accessibleContentFrame . SourcePageType == typeof ( YourHome ) )
675
674
{
676
- var instance = ( this . accessibleContentFrame . Content as YourHome ) . instanceViewModel ;
677
675
HomeItems . isEnabled = false ;
678
676
ShareItems . isEnabled = false ;
679
677
if ( LocationsList . SelectedItem != null )
@@ -706,6 +704,7 @@ private void DrivesList_ItemClick(object sender, ItemClickEventArgs e)
706
704
else if ( this . accessibleContentFrame . SourcePageType == typeof ( PhotoAlbum ) )
707
705
{
708
706
var instance = ( this . accessibleContentFrame . Content as PhotoAlbum ) . instanceViewModel ;
707
+ instance . CancelLoadAndClearFiles ( ) ;
709
708
HomeItems . isEnabled = false ;
710
709
ShareItems . isEnabled = false ;
711
710
if ( LocationsList . SelectedItem != null )
@@ -843,12 +842,10 @@ private async void AddItem_Click(object sender, RoutedEventArgs e)
843
842
{
844
843
if ( accessibleContentFrame . SourcePageType == typeof ( GenericFileBrowser ) )
845
844
{
846
- //addItemPageInstance = new AddItem(accessibleContentFrame.Content as GenericFileBrowser, null);
847
845
AddDialogFrame . Navigate ( typeof ( AddItem ) , accessibleContentFrame . Content as GenericFileBrowser , new SuppressNavigationTransitionInfo ( ) ) ;
848
846
}
849
847
else if ( accessibleContentFrame . SourcePageType == typeof ( PhotoAlbum ) )
850
848
{
851
- //addItemPageInstance = new AddItem(null, accessibleContentFrame.Content as PhotoAlbum);
852
849
AddDialogFrame . Navigate ( typeof ( AddItem ) , accessibleContentFrame . Content as PhotoAlbum , new SuppressNavigationTransitionInfo ( ) ) ;
853
850
}
854
851
await AddItemBox . ShowAsync ( ) ;
@@ -1001,6 +998,7 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch
1001
998
public static void Back_Click ( object sender , RoutedEventArgs e )
1002
999
{
1003
1000
Frame instanceContentFrame = ItemViewModel < ProHome > . GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame ;
1001
+
1004
1002
if ( ( ItemViewModel < ProHome > . GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) != null )
1005
1003
{
1006
1004
var instance = ( instanceContentFrame . Content as GenericFileBrowser ) . instanceViewModel ;
0 commit comments