Skip to content

Commit bf18b42

Browse files
committed
Enable Clear All Command
1 parent 58094e2 commit bf18b42

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Files UWP/Interacts/Interaction.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,5 +1080,18 @@ public void SelectAllItems()
10801080
(type as PhotoAlbum).gv.SelectAll();
10811081
}
10821082
}
1083+
1084+
public void ClearAllItems()
1085+
{
1086+
if (typeof(PageType) == typeof(GenericFileBrowser))
1087+
{
1088+
var CurrentInstance = ItemViewModel<GenericFileBrowser>.GetCurrentSelectedTabInstance<ProHome>();
1089+
(CurrentInstance.accessibleContentFrame.Content as GenericFileBrowser).data.SelectedItems.Clear();
1090+
}
1091+
else if (typeof(PageType) == typeof(PhotoAlbum))
1092+
{
1093+
(type as PhotoAlbum).gv.SelectedItems.Clear();
1094+
}
1095+
}
10831096
}
10841097
}

Files UWP/ProHome.xaml.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,14 @@ private void SelectAllButton_Click(object sender, RoutedEventArgs e)
902902

903903
private void ClearAllButton_Click(object sender, RoutedEventArgs e)
904904
{
905-
905+
if (this.accessibleContentFrame.SourcePageType == typeof(GenericFileBrowser))
906+
{
907+
(this.accessibleContentFrame.Content as GenericFileBrowser).instanceInteraction.ClearAllItems();
908+
}
909+
else if (this.accessibleContentFrame.SourcePageType == typeof(PhotoAlbum))
910+
{
911+
(this.accessibleContentFrame.Content as PhotoAlbum).instanceInteraction.ClearAllItems();
912+
}
906913
}
907914

908915
private void NameDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)

0 commit comments

Comments
 (0)