Skip to content
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
19 changes: 18 additions & 1 deletion AIDevGallery/Controls/DownloadProgressList.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,27 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock
FontWeight="SemiBold"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource CaptionTextBlockStyle}"
Text="Downloads" />
<Button
HorizontalAlignment="Right"
AutomationProperties.Name="More options"
Content="{ui:FontIcon Glyph=&#xE712;,
FontSize=16}"
Style="{StaticResource SubtleButtonStyle}"
ToolTipService.ToolTip="More options">
<Button.Flyout>
<MenuFlyout>
<MenuFlyoutItem Click="ClearHistory_Click" Text="Clear history" />
</MenuFlyout>
</Button.Flyout>
</Button>
<ItemsRepeater
Grid.Row="1"
IsTabStop="False"
Expand Down
11 changes: 11 additions & 0 deletions AIDevGallery/Controls/DownloadProgressList.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,16 @@ private void RetryDownloadClicked(object sender, RoutedEventArgs e)
App.ModelCache.AddModelToDownloadQueue(downloadableModel.ModelDetails);
}
}

private void ClearHistory_Click(object sender, RoutedEventArgs e)
{
foreach (DownloadableModel model in downloadProgresses.ToList())
{
if (model.Status is DownloadStatus.Completed or DownloadStatus.Canceled)
{
downloadProgresses.Remove(model);
}
}
}
}
}
5 changes: 4 additions & 1 deletion AIDevGallery/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@
Width="32"
Height="32"
IsActive="False" />
<FontIcon FontSize="14" Glyph="&#xE896;" />
<FontIcon
AutomationProperties.AccessibilityView="Raw"
FontSize="14"
Glyph="&#xE896;" />
</Grid>
</Button.Content>
<Button.Flyout>
Expand Down