Refactor and enhance DownloadManager application

Refactored and enhanced the DownloadManager application with significant updates across multiple files. Key changes include:

- **App.xaml.cs**: Re-added necessary imports, updated service registrations, and made `OnStartup` asynchronous.
- **DownloadManager.csproj**: Updated target framework, application icon, and added assembly version.
- **DownloadManager.sln**: Updated project format and added configurations for multiple platforms.
- **DownloadManagerService.cs**: Added `HistoryStorageService` dependency, introduced `Initial` method, and improved task management.
- **DownloadWorker.cs**: Enhanced error handling and changed `StartDownloadAsync` to `StartDownload`.
- **ViewModels**: Refactored to use dependency injection, updated task initialization, and added new commands for settings management.
- **UI Updates**: Improved `DownloadingPage.xaml` and `WaitingPage.xaml` with `ListView` and added headers. Restructured `SettingsPage.xaml` for better organization and added new settings options.
- **MainWindow**: Enhanced navigation and applied user-defined themes and backdrops.
- **New Files**: Added `HistoryStorageService.cs`, `ThemeToIndexConverter.cs`, `CompletedItemData.cs`, `Settings.Designer.cs`, `Settings.settings`, `Constants.cs`, `CompletedPageViewModel.cs`, `CompletedPage.xaml`, and `CompletedPage.xaml.cs` to support new features and improvements.

These changes aim to improve the application's robustness, maintainability, and user experience.
This commit is contained in:
Misaki
2024-07-03 04:37:02 +09:00
parent 3a59979efd
commit 4acbd6ba49
37 changed files with 1406 additions and 132 deletions

View File

@@ -15,26 +15,39 @@
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False"
mc:Ignorable="d">
<Grid>
<ui:VirtualizingItemsControl
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<ui:TextBlock
Margin="0,0,0,5"
HorizontalAlignment="Right"
FontTypography="Caption"
FontWeight="SemiBold"
Text="{Binding ViewModel.DownloadingTask.Count, StringFormat={}{0} Downloading Task}" />
</Grid>
<ui:ListView
Grid.Row="1"
d:ItemsSource="{d:SampleData ItemCount=2}"
ItemsSource="{Binding ViewModel.DownloadingTask}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
VirtualizingPanel.CacheLengthUnit="Item"
VirtualizingPanel.IsVirtualizing="True"
VirtualizingPanel.VirtualizationMode="Recycling">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type models:DownloadItemData}">
<Border
Height="60"
Height="75"
Padding="10"
Background="{ui:ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="5"
ToolTip="{Binding Url}">
<Grid>
@@ -86,7 +99,7 @@
<Grid Grid.Row="2" Margin="2,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="60" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
@@ -94,7 +107,7 @@
<TextBlock
FontSize="10"
Opacity="0.75"
Text="{Binding Speed, StringFormat={}{0}MB/s}" />
Text="{Binding Speed, StringFormat={}{0}MB/s, FallbackValue=0.0}" />
</Grid>
<Grid Grid.Column="1">
@@ -136,6 +149,6 @@
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ui:VirtualizingItemsControl>
</ui:ListView>
</Grid>
</Page>