diff --git a/src/SharpIDE.Photino/Components/IdeSettingsDialog.razor b/src/SharpIDE.Photino/Components/IdeSettingsDialog.razor new file mode 100644 index 0000000..f2ac366 --- /dev/null +++ b/src/SharpIDE.Photino/Components/IdeSettingsDialog.razor @@ -0,0 +1,12 @@ +@using SharpIDE.Photino.Models + +@inject AppState AppState + + + + + +@code { + [CascadingParameter] + public IMudDialogInstance MudDialog { get; set; } = null!; +} diff --git a/src/SharpIDE.Photino/Layout/MainLayout.razor b/src/SharpIDE.Photino/Layout/MainLayout.razor index e38b155..601c516 100644 --- a/src/SharpIDE.Photino/Layout/MainLayout.razor +++ b/src/SharpIDE.Photino/Layout/MainLayout.razor @@ -23,6 +23,9 @@ + + + @@ -89,4 +92,10 @@ { await BuildService.MsBuildSolutionAsync(_solutionFilePath!, buildType); } + + private async Task OpenSettingsDialog() + { + var dialogRef = await DialogService.ShowAsync("SharpIDE Settings", new DialogOptions { MaxWidth = MaxWidth.Medium, CloseButton = true }); + } + } diff --git a/src/SharpIDE.Photino/Models/AppState.cs b/src/SharpIDE.Photino/Models/AppState.cs index dc44979..2760b53 100644 --- a/src/SharpIDE.Photino/Models/AppState.cs +++ b/src/SharpIDE.Photino/Models/AppState.cs @@ -3,4 +3,10 @@ namespace SharpIDE.Photino.Models; public class AppState { public required string SolutionFilePath { get; set; } + public required IdeSettings IdeSettings { get; set; } = new IdeSettings(); +} + +public class IdeSettings +{ + public bool AutoOpenLastSolution { get; set; } } diff --git a/src/SharpIDE.Photino/Program.cs b/src/SharpIDE.Photino/Program.cs index b58b79a..15a4eeb 100644 --- a/src/SharpIDE.Photino/Program.cs +++ b/src/SharpIDE.Photino/Program.cs @@ -92,6 +92,7 @@ public class Program if (deserializedAppState is not null) { appState.SolutionFilePath = deserializedAppState.SolutionFilePath; + appState.IdeSettings = deserializedAppState.IdeSettings; } } }