Turn on accent for save button when unsaved work
This commit is contained in:
@@ -111,10 +111,16 @@ class CreatePDFReportViewModel : BaseViewModel, ICanCheckShutdown, ILogger
|
||||
_isCreatingPDF = value;
|
||||
NotifyPropertyChanged();
|
||||
NotifyPropertyChanged(nameof(IsCreatePDFButtonEnabled));
|
||||
NotifyPropertyChanged(nameof(CanAddItem));
|
||||
NotifyPropertyChanged(nameof(CanAddItem));
|
||||
NotifyPropertyChanged(nameof(IsSaveButtonAccentOn));
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSaveButtonAccentOn
|
||||
{
|
||||
get => !_isCreatingPDF && HasUnsavedWork;
|
||||
}
|
||||
|
||||
public bool IsCreatePDFButtonEnabled
|
||||
{
|
||||
get => !_isCreatingPDF && _pdfReport.Files.Count > 0;
|
||||
@@ -133,6 +139,7 @@ class CreatePDFReportViewModel : BaseViewModel, ICanCheckShutdown, ILogger
|
||||
{
|
||||
_hasUnsavedWork = value;
|
||||
NotifyPropertyChanged();
|
||||
NotifyPropertyChanged(nameof(IsSaveButtonAccentOn));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
Spacing="4">
|
||||
<Button Command="{Binding AddItem}"
|
||||
IsEnabled="{Binding CanAddItem}">
|
||||
<TextBlock><Run Text="+" FontFamily="{StaticResource FontAwesomeSolid}"/> Add Item(s)</TextBlock>
|
||||
<TextBlock><Run Text="+" FontFamily="{StaticResource FontAwesomeSolid}"/> Add Item(s)...</TextBlock>
|
||||
</Button>
|
||||
<Button Command="{Binding RemoveAllItems}"
|
||||
IsEnabled="{Binding IsCreatePDFButtonEnabled}"
|
||||
@@ -234,6 +234,7 @@
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Re-sort PDF Items</TextBlock>
|
||||
</Button>
|
||||
<Button Command="{Binding SaveInterimReportInfo}"
|
||||
Classes.accent="{Binding IsSaveButtonAccentOn}"
|
||||
IsEnabled="{Binding !IsCreatingPDF}">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Save Report Info</TextBlock>
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user