WIP: Add iOS version #10
@@ -111,9 +111,10 @@ class CreatePDFReportViewModel : BaseViewModel, ICanCheckShutdown, ILogger
|
||||
set
|
||||
{
|
||||
_pdfReport.Title = value;
|
||||
NotifyPropertyChanged();
|
||||
NotifyPropertyChanged(nameof(IsTitleBoxVisible));
|
||||
NotifyPropertyChanged(nameof(CanAddItem));
|
||||
NotifyPropertyChanged();
|
||||
NotifyPropertyChanged(nameof(IsTitleBoxVisible));
|
||||
NotifyPropertyChanged(nameof(CanAddItem));
|
||||
HasUnsavedWork = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,19 +342,6 @@ class CreatePDFReportViewModel : BaseViewModel, ICanCheckShutdown, ILogger
|
||||
NotifyPropertyChanged(nameof(IsCreatePDFButtonEnabled));
|
||||
}
|
||||
|
||||
public async Task ShowSettings()
|
||||
{
|
||||
var updatedSettings = await DialogHost.Show(new SettingsViewModel(_settings, TopLevelGrabber));
|
||||
if (updatedSettings != null)
|
||||
{
|
||||
_settings = (Settings)updatedSettings;
|
||||
await _settings.SaveSettingsAsync();
|
||||
LogInfo("Saved updated settings!");
|
||||
NotifyPropertyChanged(nameof(DataGridDateFormat));
|
||||
NotifyPropertyChanged(nameof(DataGridDateFormatWatermark));
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/AvaloniaUI/Avalonia/issues/10075
|
||||
public void EditFileProperties(object f) => EditFilePropertiesImpl((ReportFile)f);
|
||||
public async void EditFilePropertiesImpl(ReportFile file)
|
||||
@@ -634,6 +622,15 @@ class CreatePDFReportViewModel : BaseViewModel, ICanCheckShutdown, ILogger
|
||||
IsCreatingPDF = false;
|
||||
}
|
||||
|
||||
public async void ReturnToMainMenu()
|
||||
{
|
||||
bool isSafeToReturn = await CheckIsSafeToShutdown();
|
||||
if (isSafeToReturn)
|
||||
{
|
||||
PopViewModel();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> CheckIsSafeToShutdown()
|
||||
{
|
||||
if (!HasUnsavedWork || string.IsNullOrWhiteSpace(WorkingFolder))
|
||||
|
||||
@@ -15,6 +15,13 @@
|
||||
</UserControl.Resources>
|
||||
<Grid ColumnDefinitions="*"
|
||||
RowDefinitions="Auto, 2*, Auto, Auto, *">
|
||||
<Button Command="{Binding ReturnToMainMenu}"
|
||||
Grid.Row="0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Margin="4,4,0,4">
|
||||
<TextBlock><Run Text="" FontFamily="{StaticResource FontAwesomeSolid}"/> Return to Main Menu</TextBlock>
|
||||
</Button>
|
||||
<StackPanel Orientation="Vertical"
|
||||
Spacing="2"
|
||||
Margin="0,4,0,0">
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
FontWeight="Bold"
|
||||
TextWrapping="Wrap"
|
||||
FontSize="14"
|
||||
Text="Do you want to save your data before the program is closed?"/>
|
||||
Text="Do you want to save your data before closing?"/>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Button Command="{Binding SaveAndShutdown}"
|
||||
@@ -31,7 +31,7 @@
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,4,0,4"/>
|
||||
<Button Command="{Binding CancelShutdown}"
|
||||
Content="Cancel Program Shutdown"
|
||||
Content="Cancel"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,4,0,4"/>
|
||||
</StackPanel>
|
||||
|
||||
Reference in New Issue
Block a user