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;
|
_isCreatingPDF = value;
|
||||||
NotifyPropertyChanged();
|
NotifyPropertyChanged();
|
||||||
NotifyPropertyChanged(nameof(IsCreatePDFButtonEnabled));
|
NotifyPropertyChanged(nameof(IsCreatePDFButtonEnabled));
|
||||||
NotifyPropertyChanged(nameof(CanAddItem));
|
NotifyPropertyChanged(nameof(CanAddItem));
|
||||||
|
NotifyPropertyChanged(nameof(IsSaveButtonAccentOn));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsSaveButtonAccentOn
|
||||||
|
{
|
||||||
|
get => !_isCreatingPDF && HasUnsavedWork;
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsCreatePDFButtonEnabled
|
public bool IsCreatePDFButtonEnabled
|
||||||
{
|
{
|
||||||
get => !_isCreatingPDF && _pdfReport.Files.Count > 0;
|
get => !_isCreatingPDF && _pdfReport.Files.Count > 0;
|
||||||
@@ -133,6 +139,7 @@ class CreatePDFReportViewModel : BaseViewModel, ICanCheckShutdown, ILogger
|
|||||||
{
|
{
|
||||||
_hasUnsavedWork = value;
|
_hasUnsavedWork = value;
|
||||||
NotifyPropertyChanged();
|
NotifyPropertyChanged();
|
||||||
|
NotifyPropertyChanged(nameof(IsSaveButtonAccentOn));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -222,7 +222,7 @@
|
|||||||
Spacing="4">
|
Spacing="4">
|
||||||
<Button Command="{Binding AddItem}"
|
<Button Command="{Binding AddItem}"
|
||||||
IsEnabled="{Binding CanAddItem}">
|
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>
|
||||||
<Button Command="{Binding RemoveAllItems}"
|
<Button Command="{Binding RemoveAllItems}"
|
||||||
IsEnabled="{Binding IsCreatePDFButtonEnabled}"
|
IsEnabled="{Binding IsCreatePDFButtonEnabled}"
|
||||||
@@ -234,6 +234,7 @@
|
|||||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Re-sort PDF Items</TextBlock>
|
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Re-sort PDF Items</TextBlock>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding SaveInterimReportInfo}"
|
<Button Command="{Binding SaveInterimReportInfo}"
|
||||||
|
Classes.accent="{Binding IsSaveButtonAccentOn}"
|
||||||
IsEnabled="{Binding !IsCreatingPDF}">
|
IsEnabled="{Binding !IsCreatingPDF}">
|
||||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Save Report Info</TextBlock>
|
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Save Report Info</TextBlock>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in New Issue
Block a user