Show working folder
This commit is contained in:
@@ -75,7 +75,13 @@ class MainViewModel : BaseViewModel, IFontResolver
|
|||||||
public bool IsCreatingPDF
|
public bool IsCreatingPDF
|
||||||
{
|
{
|
||||||
get => _isCreatingPDF;
|
get => _isCreatingPDF;
|
||||||
set { _isCreatingPDF = value; NotifyPropertyChanged(); NotifyPropertyChanged(nameof(IsCreatePDFButtonEnabled)); }
|
set
|
||||||
|
{
|
||||||
|
_isCreatingPDF = value;
|
||||||
|
NotifyPropertyChanged();
|
||||||
|
NotifyPropertyChanged(nameof(IsCreatePDFButtonEnabled));
|
||||||
|
NotifyPropertyChanged(nameof(HasWorkingFolderAndNotMakingPDF));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsCreatePDFButtonEnabled
|
public bool IsCreatePDFButtonEnabled
|
||||||
@@ -83,6 +89,28 @@ class MainViewModel : BaseViewModel, IFontResolver
|
|||||||
get => !_isCreatingPDF && _reportFiles.Count > 0;
|
get => !_isCreatingPDF && _reportFiles.Count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool HasWorkingFolder
|
||||||
|
{
|
||||||
|
get => !string.IsNullOrWhiteSpace(_workingFolder) && Directory.Exists(_workingFolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool HasWorkingFolderAndNotMakingPDF
|
||||||
|
{
|
||||||
|
get => !string.IsNullOrWhiteSpace(_workingFolder) && Directory.Exists(_workingFolder) && !_isCreatingPDF;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string WorkingFolder
|
||||||
|
{
|
||||||
|
get => _workingFolder;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_workingFolder = value;
|
||||||
|
NotifyPropertyChanged();
|
||||||
|
NotifyPropertyChanged(nameof(HasWorkingFolder));
|
||||||
|
NotifyPropertyChanged(nameof(HasWorkingFolderAndNotMakingPDF));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string CreatePDFLog
|
public string CreatePDFLog
|
||||||
{
|
{
|
||||||
get => _createPDFLog;
|
get => _createPDFLog;
|
||||||
@@ -137,7 +165,7 @@ class MainViewModel : BaseViewModel, IFontResolver
|
|||||||
{
|
{
|
||||||
if (Directory.Exists(path))
|
if (Directory.Exists(path))
|
||||||
{
|
{
|
||||||
_workingFolder = path;
|
WorkingFolder = path;
|
||||||
NotifyPropertyChanged(nameof(IsTitleBoxVisible));
|
NotifyPropertyChanged(nameof(IsTitleBoxVisible));
|
||||||
var reportFilePath = Path.Combine(path, GetReportSavedDataFileName());
|
var reportFilePath = Path.Combine(path, GetReportSavedDataFileName());
|
||||||
var successfullyLoadedPriorReport = false;
|
var successfullyLoadedPriorReport = false;
|
||||||
@@ -151,7 +179,7 @@ class MainViewModel : BaseViewModel, IFontResolver
|
|||||||
{
|
{
|
||||||
ReportFiles = new ObservableCollection<ReportFile>(report.Files);
|
ReportFiles = new ObservableCollection<ReportFile>(report.Files);
|
||||||
ReportTitle = report.Title;
|
ReportTitle = report.Title;
|
||||||
_workingFolder = report.BaseFolder;
|
WorkingFolder = report.BaseFolder;
|
||||||
_lastGeneratedTime = report.LastGenerated ?? null;
|
_lastGeneratedTime = report.LastGenerated ?? null;
|
||||||
LogInfo("Reloaded report last saved at {0}", report.LastSaved);
|
LogInfo("Reloaded report last saved at {0}", report.LastSaved);
|
||||||
successfullyLoadedPriorReport = true;
|
successfullyLoadedPriorReport = true;
|
||||||
|
|||||||
+14
-4
@@ -25,9 +25,19 @@
|
|||||||
FontSize="20"
|
FontSize="20"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
HorizontalAlignment="Center"/>
|
HorizontalAlignment="Center"/>
|
||||||
<Button Content="Choose Receipt Folder"
|
<Grid ColumnDefinitions="Auto, *"
|
||||||
Command="{Binding ChooseFolder}"
|
Margin="4,0,0,0">
|
||||||
IsEnabled="{Binding !IsCreatingPDF}" />
|
<Button Content="Choose Receipt Folder"
|
||||||
|
Command="{Binding ChooseFolder}"
|
||||||
|
IsEnabled="{Binding !IsCreatingPDF}"
|
||||||
|
Grid.Column="0" />
|
||||||
|
<TextBlock Text="{Binding WorkingFolder}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
TextWrapping="NoWrap"
|
||||||
|
Margin="4,0,4,0"
|
||||||
|
TextTrimming="PrefixCharacterEllipsis"
|
||||||
|
Grid.Column="1"/>
|
||||||
|
</Grid>
|
||||||
<Label Content="Report Title"
|
<Label Content="Report Title"
|
||||||
IsVisible="{Binding IsTitleBoxVisible}" />
|
IsVisible="{Binding IsTitleBoxVisible}" />
|
||||||
<TextBox Text="{Binding ReportTitle}"
|
<TextBox Text="{Binding ReportTitle}"
|
||||||
@@ -198,7 +208,7 @@
|
|||||||
<TextBlock><Run Text="+" FontFamily="{StaticResource FontAwesomeSolid}"/> Add Item</TextBlock>
|
<TextBlock><Run Text="+" FontFamily="{StaticResource FontAwesomeSolid}"/> Add Item</TextBlock>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding SaveInterimReportInfo}"
|
<Button Command="{Binding SaveInterimReportInfo}"
|
||||||
IsEnabled="{Binding IsCreatePDFButtonEnabled}">
|
IsEnabled="{Binding HasWorkingFolderAndNotMakingPDF}">
|
||||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Save Report Info</TextBlock>
|
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Save Report Info</TextBlock>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding ResortPDFItemsByDate}"
|
<Button Command="{Binding ResortPDFItemsByDate}"
|
||||||
|
|||||||
Reference in New Issue
Block a user