Fix more buttons being enabled/disabled issues
This commit is contained in:
@@ -92,7 +92,15 @@ class MainViewModel : BaseViewModel, IFontResolver
|
||||
public ObservableCollection<ReportFile> ReportFiles
|
||||
{
|
||||
get => _reportFiles;
|
||||
set { _reportFiles = value; NotifyPropertyChanged(); }
|
||||
set
|
||||
{
|
||||
_reportFiles = value;
|
||||
NotifyPropertyChanged();
|
||||
_reportFiles.CollectionChanged += ( sender, e ) =>
|
||||
{
|
||||
NotifyPropertyChanged(nameof(IsCreatePDFButtonEnabled));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private void LogInfo(string message, params object[]? arguments)
|
||||
@@ -160,6 +168,7 @@ class MainViewModel : BaseViewModel, IFontResolver
|
||||
ResortPDFItemsByDate();
|
||||
}
|
||||
}
|
||||
NotifyPropertyChanged(nameof(IsCreatePDFButtonEnabled));
|
||||
}
|
||||
|
||||
public void ShowAbout()
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="4">
|
||||
<Button Command="{Binding AddItem}"
|
||||
IsEnabled="{Binding IsCreatePDFButtonEnabled}">
|
||||
IsEnabled="{Binding !IsCreatingPDF}">
|
||||
<TextBlock><Run Text="+" FontFamily="{StaticResource FontAwesomeSolid}"/> Add Item</TextBlock>
|
||||
</Button>
|
||||
<Button Command="{Binding SaveInterimReportInfo}"
|
||||
|
||||
Reference in New Issue
Block a user