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()
|
public async void BuildPDF()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(ReportTitle))
|
if (string.IsNullOrWhiteSpace(ReportTitle))
|
||||||
@@ -284,7 +289,7 @@ class MainViewModel : BaseViewModel, IFontResolver
|
|||||||
var json = await reader.ReadToEndAsync();
|
var json = await reader.ReadToEndAsync();
|
||||||
var savePath = Path.Combine(_workingFolder, GetReportSavedDataFileName());
|
var savePath = Path.Combine(_workingFolder, GetReportSavedDataFileName());
|
||||||
await File.WriteAllTextAsync(savePath, json);
|
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()
|
private async Task CreateAndSaveReportObjectAfterReportCreation()
|
||||||
|
|||||||
+22
-13
@@ -125,21 +125,30 @@
|
|||||||
Spacing="4"
|
Spacing="4"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Margin="4">
|
Margin="4">
|
||||||
<Button Command="{Binding AddItem}"
|
<StackPanel Orientation="Horizontal"
|
||||||
IsEnabled="{Binding IsTitleBoxVisible}">
|
Spacing="4">
|
||||||
<TextBlock><Run Text="+" FontFamily="{StaticResource FontAwesomeSolid}"/> Add Item</TextBlock>
|
<Button Command="{Binding AddItem}"
|
||||||
</Button>
|
IsEnabled="{Binding IsTitleBoxVisible}">
|
||||||
<Button Command="{Binding SaveInterimReportInfo}"
|
<TextBlock><Run Text="+" FontFamily="{StaticResource FontAwesomeSolid}"/> Add Item</TextBlock>
|
||||||
IsEnabled="{Binding IsTitleBoxVisible}">
|
</Button>
|
||||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Save Report Info</TextBlock>
|
<Button Command="{Binding SaveInterimReportInfo}"
|
||||||
</Button>
|
IsEnabled="{Binding IsTitleBoxVisible}">
|
||||||
<Button Content="Create Report PDF"
|
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Save Report Info</TextBlock>
|
||||||
Command="{Binding BuildPDF}"
|
</Button>
|
||||||
Classes="accent"
|
<Button Command="{Binding ResortPDFItemsByDate}"
|
||||||
IsEnabled="{Binding IsCreatePDFButtonEnabled}" />
|
IsEnabled="{Binding IsTitleBoxVisible}">
|
||||||
|
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Resort PDF Items</TextBlock>
|
||||||
|
</Button>
|
||||||
|
<Button Command="{Binding BuildPDF}"
|
||||||
|
Classes="accent"
|
||||||
|
IsEnabled="{Binding IsCreatePDFButtonEnabled}">
|
||||||
|
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Create Report PDF</TextBlock>
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal"
|
<StackPanel Orientation="Horizontal"
|
||||||
IsVisible="{Binding IsCreatingPDF}"
|
IsVisible="{Binding IsCreatingPDF}"
|
||||||
Spacing="6">
|
Spacing="6"
|
||||||
|
HorizontalAlignment="Center">
|
||||||
<Label Content="Creating PDF..."
|
<Label Content="Creating PDF..."
|
||||||
IsVisible="{Binding IsCreatingPDF}"
|
IsVisible="{Binding IsCreatingPDF}"
|
||||||
VerticalAlignment="Center"/>
|
VerticalAlignment="Center"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user