Run PDF creation async and show log/progress

This commit is contained in:
2026-01-03 22:09:11 +09:00
parent 280ad26f58
commit c298c143f5
3 changed files with 86 additions and 22 deletions
+36 -5
View File
@@ -5,10 +5,41 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="ReceiptPDFBuilder.Views.MainView"
xmlns:vm="clr-namespace:ReceiptPDFBuilder.ViewModels"
xmlns:progRing="clr-namespace:AvaloniaProgressRing;assembly=AvaloniaProgressRing"
x:DataType="vm:MainViewModel">
<StackPanel Orientation="Vertical"
Spacing="2">
<Button Content="Choose Folder"
Command="{Binding ChooseFolder}" />
</StackPanel>
<Grid ColumnDefinitions="Auto, *"
RowDefinitions="Auto, *">
<Label Content="Easy Receipt Folder -> PDF Builder"
Grid.Row="0"
Grid.ColumnSpan="2"
FontWeight="Bold"
HorizontalAlignment="Center"/>
<StackPanel Orientation="Vertical"
Spacing="2"
Grid.Column="0"
Grid.Row="1"
Margin="2">
<Button Content="Choose Receipt Folder"
Command="{Binding ChooseFolder}"
IsEnabled="{Binding !IsCreatingPDF}" />
<Label Content="Creating PDF..."
IsVisible="{Binding IsCreatingPDF}"/>
<progRing:ProgressRing Width="80"
Height="80"
IsActive="{Binding IsCreatingPDF}"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Foreground="LightBlue"
Margin="10,20,0,0"/>
</StackPanel>
<ScrollViewer Grid.Column="1"
Margin="2"
Grid.Row="1"
x:Name="LogScrollView">
<SelectableTextBlock Text="{Binding CreatePDFLog}"
Margin="2"
TextWrapping="Wrap"
x:Name="LogBlock"/>
</ScrollViewer>
</Grid>
</UserControl>