Skip to content

Added clear all button #7025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Files/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -2866,4 +2866,7 @@ We use App Center to keep track of app usage, find bugs, and fix crashes. All in
<data name="SettingsSetAsDefaultFileManagerDescription" xml:space="preserve">
<value>This setting modifies system files and can have unexpected side effects on your device. The developers take no responsibility in the event an issue occurs as a result. Continuing with this option is an acknowledgment of the risks involved with this action. Please note, uninstalling Files will not undo these changes and may prevent you from opening file explorer unless you turn off this setting before removing Files from your device.</value>
</data>
</root>
<data name="ClearAll" xml:space="preserve">
<value>Clear all</value>
</data>
</root>
12 changes: 11 additions & 1 deletion Files/UserControls/OngoingTasksFlyout.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@
FontSize="14"
FontWeight="SemiBold"
Text="{helpers:ResourceString Name=OngoingTasks}" />

<Button
x:Name="DismissAllBannersButton"
Height="32"
Background="Transparent"
BorderBrush="Transparent"
Click="DismissAllBannersButton_Click"
Content="{helpers:ResourceString Name=ClearAll}"
ToolTipService.ToolTip="{helpers:ResourceString Name=ClearAll}"
HorizontalAlignment="Right"/>
</Grid>

<ListView
Expand Down Expand Up @@ -260,4 +270,4 @@
</ListView.ItemTemplate>
</ListView>
</Grid>
</UserControl>
</UserControl>
14 changes: 13 additions & 1 deletion Files/UserControls/OngoingTasksFlyout.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,17 @@ private async void Button_Click_1(object sender, RoutedEventArgs e)
await Task.Run(itemToDismiss.PrimaryButtonClick);
OngoingTasksViewModel.CloseBanner(itemToDismiss);
}

private void DismissAllBannersButton_Click(object sender, RoutedEventArgs e)
{
for (int i = OngoingTasksViewModel.StatusBannersSource.Count - 1; i >= 0; i--)
{
var itemToDismiss = OngoingTasksViewModel.StatusBannersSource[i];
if (!itemToDismiss.IsProgressing)
{
OngoingTasksViewModel.CloseBanner(itemToDismiss);
}
}
}
}
}
}