diff options
Diffstat (limited to 'BatchBeatmapDownloader/Views/MainWindow.axaml')
-rw-r--r-- | BatchBeatmapDownloader/Views/MainWindow.axaml | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/BatchBeatmapDownloader/Views/MainWindow.axaml b/BatchBeatmapDownloader/Views/MainWindow.axaml new file mode 100644 index 0000000..d6ed94f --- /dev/null +++ b/BatchBeatmapDownloader/Views/MainWindow.axaml @@ -0,0 +1,93 @@ +<Window xmlns="https://github.com/avaloniaui" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:vm="using:BatchBeatmapDownloader.ViewModels" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:batchBeatmapDownloader="clr-namespace:BatchBeatmapDownloader" + xmlns:generic="clr-namespace:System.Collections.Generic;assembly=System.Collections" + xmlns:libBeatmapDownload="clr-namespace:LibBeatmapDownload;assembly=LibBeatmapDownload" + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" + x:Class="BatchBeatmapDownloader.Views.MainWindow" + x:DataType="vm:MainWindowViewModel" + Icon="/Assets/avalonia-logo.ico" + Title="BatchBeatmapDownloader"> + + <Design.DataContext> + <!-- This only sets the DataContext for the previewer in an IDE, + to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) --> + <vm:MainWindowViewModel/> + </Design.DataContext> + <StackPanel Orientation="Vertical"> + <!-- horizontal listbox with progress bars --> + <ListBox ItemsSource="{Binding DomainStatsChunked}"> + <ListBox.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Rows="{Binding DomainStatsChunked.Count}"/> + </ItemsPanelTemplate> + </ListBox.ItemsPanel> + <ListBox.ItemTemplate> + <DataTemplate> + <ListBox ItemsSource="{Binding Items}"> + <ListBox.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="{Binding Items.Count}"/> + </ItemsPanelTemplate> + </ListBox.ItemsPanel> + <ListBox.ItemTemplate> + <DataTemplate DataType="libBeatmapDownload:DomainStats"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + <ProgressBar Value="{Binding Progress, Mode=OneWay}" /> + <TextBlock Grid.Row="1" Text="{Binding ProgressString, Mode=OneWay}" HorizontalAlignment="Center" VerticalAlignment="Center" /> + </Grid> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + <!-- + <ListBox ItemsSource="{Binding DomainStats}"> + <ListBox.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="{Binding DomainStats.Count}"/> + </ItemsPanelTemplate> + </ListBox.ItemsPanel> + <ListBox.ItemTemplate> + <DataTemplate DataType="batchBeatmapDownloader:DomainStats"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + <ProgressBar Value="{Binding Progress, Mode=OneWay}" /> + <TextBlock Grid.Row="1" Text="{Binding ProgressString, Mode=OneWay}" HorizontalAlignment="Center" VerticalAlignment="Center" /> + </Grid> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + --> + + <ListBox ItemsSource="{Binding DownloadTasks.Tasks}"> + <ListBox.ItemsPanel> + <ItemsPanelTemplate> + <VirtualizingStackPanel></VirtualizingStackPanel> + </ItemsPanelTemplate> + </ListBox.ItemsPanel> + <ListBox.ItemTemplate> + <DataTemplate DataType="libBeatmapDownload:DownloadTask"> + <!-- Progress bar with text overlayed --> + <Grid> + <ProgressBar Value="{Binding Progress, Mode=OneWay}" /> + <TextBlock Text="{Binding ProgressString, Mode=OneWay}" HorizontalAlignment="Center" VerticalAlignment="Center" /> + </Grid> + + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </StackPanel> + +</Window> |