Fix more buttons being enabled/disabled issues
This commit is contained in:
@@ -92,7 +92,15 @@ class MainViewModel : BaseViewModel, IFontResolver
|
|||||||
public ObservableCollection<ReportFile> ReportFiles
|
public ObservableCollection<ReportFile> ReportFiles
|
||||||
{
|
{
|
||||||
get => _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)
|
private void LogInfo(string message, params object[]? arguments)
|
||||||
@@ -160,6 +168,7 @@ class MainViewModel : BaseViewModel, IFontResolver
|
|||||||
ResortPDFItemsByDate();
|
ResortPDFItemsByDate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
NotifyPropertyChanged(nameof(IsCreatePDFButtonEnabled));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowAbout()
|
public void ShowAbout()
|
||||||
|
|||||||
@@ -151,7 +151,7 @@
|
|||||||
<StackPanel Orientation="Horizontal"
|
<StackPanel Orientation="Horizontal"
|
||||||
Spacing="4">
|
Spacing="4">
|
||||||
<Button Command="{Binding AddItem}"
|
<Button Command="{Binding AddItem}"
|
||||||
IsEnabled="{Binding IsCreatePDFButtonEnabled}">
|
IsEnabled="{Binding !IsCreatingPDF}">
|
||||||
<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}"
|
||||||
|
|||||||
Reference in New Issue
Block a user