diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 1b33977..2e2092d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -19,7 +19,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: 9.0.x #- name: Install workloads # run: dotnet workload install android ios maccatalyst tvos macos maui wasm-tools - name: Restore dependencies @@ -30,3 +30,12 @@ jobs: working-directory: src/AvaloniaInside.Shell #- name: Test # run: dotnet test --no-build --verbosity normal + + # push nugget package to github if push to main branch + - name: Push NuGet package + if: github.ref == 'refs/heads/main' + uses: softprops/action-gh-release@v1 + with: + files: src/AvaloniaInside.Shell/bin/Release/AvaloniaInside.Shell.*.nupkg + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/AvaloniaInside.Shell/AvaloniaInside.Shell.csproj b/src/AvaloniaInside.Shell/AvaloniaInside.Shell.csproj index ffb01a1..2750b60 100644 --- a/src/AvaloniaInside.Shell/AvaloniaInside.Shell.csproj +++ b/src/AvaloniaInside.Shell/AvaloniaInside.Shell.csproj @@ -1,9 +1,9 @@ - net6.0;net8.0 + net8.0;net9.0 enable latest - 1.3.0 + 1.3.1 Shell view for Avalonia Shell reduces the complexity of mobile/desktop application development by providing the fundamental features that most applications require AvaloniaInside diff --git a/src/AvaloniaInside.Shell/NavigateResult.cs b/src/AvaloniaInside.Shell/NavigateResult.cs index 886ae9c..316d98a 100644 --- a/src/AvaloniaInside.Shell/NavigateResult.cs +++ b/src/AvaloniaInside.Shell/NavigateResult.cs @@ -12,4 +12,8 @@ internal NavigateResult(bool hasArgument, object? argument) public object? Argument { get; } public T? As() => HasArgument && Argument is T argument ? argument : default; + + public static NavigateResult FromResult(T argument) => new(true, argument); + + public static readonly NavigateResult Completed = new NavigateResult(false, null); } diff --git a/src/AvaloniaInside.Shell/Page.cs b/src/AvaloniaInside.Shell/Page.cs index 682f3d9..117961f 100644 --- a/src/AvaloniaInside.Shell/Page.cs +++ b/src/AvaloniaInside.Shell/Page.cs @@ -307,6 +307,10 @@ protected override void OnLoaded(RoutedEventArgs e) this[!ApplyLeftSafePaddingProperty] = this[!ShellView.EnableSafeAreaForLeftProperty]; this[!ApplyRightSafePaddingProperty] = this[!ShellView.ApplyRightSafePaddingProperty]; + // allow previewer to display page-based views + if (Design.IsDesignMode && Chain is null) + return; + IsModal = Chain.Type == NavigateType.Modal; } diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 139f166..56f6c64 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,5 +1,5 @@ - 11.2.3 + 11.2.5