More helpers for list
This commit is contained in:
@@ -230,6 +230,11 @@ class MainViewModel : BaseViewModel, IFontResolver
|
||||
}
|
||||
}
|
||||
|
||||
public void ResortPDFItemsByDate()
|
||||
{
|
||||
ReportFiles = new ObservableCollection<ReportFile>(ReportFiles.OrderBy(x => x.ReceiptDateTime));
|
||||
}
|
||||
|
||||
public async void BuildPDF()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ReportTitle))
|
||||
@@ -284,7 +289,7 @@ class MainViewModel : BaseViewModel, IFontResolver
|
||||
var json = await reader.ReadToEndAsync();
|
||||
var savePath = Path.Combine(_workingFolder, GetReportSavedDataFileName());
|
||||
await File.WriteAllTextAsync(savePath, json);
|
||||
LogInfo("Saved report information to {0} (baseDir is {1})", savePath, _workingFolder);
|
||||
LogInfo("Saved report information to {0}", savePath);
|
||||
}
|
||||
|
||||
private async Task CreateAndSaveReportObjectAfterReportCreation()
|
||||
|
||||
+13
-4
@@ -125,6 +125,8 @@
|
||||
Spacing="4"
|
||||
Grid.Row="2"
|
||||
Margin="4">
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="4">
|
||||
<Button Command="{Binding AddItem}"
|
||||
IsEnabled="{Binding IsTitleBoxVisible}">
|
||||
<TextBlock><Run Text="+" FontFamily="{StaticResource FontAwesomeSolid}"/> Add Item</TextBlock>
|
||||
@@ -133,13 +135,20 @@
|
||||
IsEnabled="{Binding IsTitleBoxVisible}">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Save Report Info</TextBlock>
|
||||
</Button>
|
||||
<Button Content="Create Report PDF"
|
||||
Command="{Binding BuildPDF}"
|
||||
<Button Command="{Binding ResortPDFItemsByDate}"
|
||||
IsEnabled="{Binding IsTitleBoxVisible}">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Resort PDF Items</TextBlock>
|
||||
</Button>
|
||||
<Button Command="{Binding BuildPDF}"
|
||||
Classes="accent"
|
||||
IsEnabled="{Binding IsCreatePDFButtonEnabled}" />
|
||||
IsEnabled="{Binding IsCreatePDFButtonEnabled}">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Create Report PDF</TextBlock>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
IsVisible="{Binding IsCreatingPDF}"
|
||||
Spacing="6">
|
||||
Spacing="6"
|
||||
HorizontalAlignment="Center">
|
||||
<Label Content="Creating PDF..."
|
||||
IsVisible="{Binding IsCreatingPDF}"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
Reference in New Issue
Block a user