Turn on accent for save button when unsaved work

This commit is contained in:
2026-04-23 11:00:51 +09:00
parent d5b174fa22
commit 71ca0c6459
2 changed files with 10 additions and 2 deletions
@@ -112,9 +112,15 @@ class CreatePDFReportViewModel : BaseViewModel, ICanCheckShutdown, ILogger
NotifyPropertyChanged();
NotifyPropertyChanged(nameof(IsCreatePDFButtonEnabled));
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="&#x002b;" FontFamily="{StaticResource FontAwesomeSolid}"/> Add Item(s)</TextBlock>
<TextBlock><Run Text="&#x002b;" FontFamily="{StaticResource FontAwesomeSolid}"/> Add Item(s)...</TextBlock>
</Button>
<Button Command="{Binding RemoveAllItems}"
IsEnabled="{Binding IsCreatePDFButtonEnabled}"
@@ -234,6 +234,7 @@
<TextBlock><Run Text="&#xf162;" FontFamily="{StaticResource FontAwesomeSolid}"/> Re-sort PDF Items</TextBlock>
</Button>
<Button Command="{Binding SaveInterimReportInfo}"
Classes.accent="{Binding IsSaveButtonAccentOn}"
IsEnabled="{Binding !IsCreatingPDF}">
<TextBlock><Run Text="&#xf0c7;" FontFamily="{StaticResource FontAwesomeSolid}"/> Save Report Info</TextBlock>
</Button>