store last selected sln file
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
@using Ardalis.GuardClauses
|
||||
@using global::Photino.Blazor
|
||||
@using SharpIDE.Photino.Models
|
||||
|
||||
@inject PhotinoBlazorApp PhotinoBlazorApp
|
||||
@inject AppState AppState
|
||||
|
||||
<MudStack Class="mx-4">
|
||||
<MudTextField T="string" Label="Solution File" Value="@_solutionFilePath" ReadOnly="true" />
|
||||
<MudButton OnClick="@PickSolution">Pick Solution</MudButton>
|
||||
<MudButton OnClick="@Proceed" Disabled="@(string.IsNullOrWhiteSpace(_solutionFilePath))">Open</MudButton>
|
||||
<MudStack Row="true">
|
||||
<MudTextField T="string" Label="Solution File" Value="@_solutionFilePath" ReadOnly="true" />
|
||||
<MudButton OnClick="@PickSolution">Pick Solution</MudButton>
|
||||
</MudStack>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@Proceed" Disabled="@(string.IsNullOrWhiteSpace(_solutionFilePath))">Open</MudButton>
|
||||
</MudStack>
|
||||
|
||||
@code {
|
||||
@@ -15,6 +19,11 @@
|
||||
|
||||
private string? _solutionFilePath;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
_solutionFilePath = AppState.SolutionFilePath;
|
||||
}
|
||||
|
||||
private async Task PickSolution()
|
||||
{
|
||||
var files = await PhotinoBlazorApp.MainWindow.ShowOpenFileAsync("Choose Solution File", filters: [("Solution File", [".sln"])]);
|
||||
@@ -25,6 +34,7 @@
|
||||
private void Proceed()
|
||||
{
|
||||
Guard.Against.NullOrWhiteSpace(_solutionFilePath);
|
||||
AppState.SolutionFilePath = _solutionFilePath;
|
||||
MudDialog.Close(_solutionFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user