mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-06-06 18:08:16 +08:00
Compare commits
4 Commits
7f557bb2c5
...
d958abc1e5
| Author | SHA1 | Date | |
|---|---|---|---|
| d958abc1e5 | |||
| 27810e4ca1 | |||
| 0ab36a1ab2 | |||
| 77acd07732 |
@@ -233,6 +233,9 @@ indent_size = 2
|
|||||||
[*.json]
|
[*.json]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.{yml,yaml}]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
# Shell scripts
|
# Shell scripts
|
||||||
[*.sh]
|
[*.sh]
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
|
|||||||
@@ -35,6 +35,14 @@ on:
|
|||||||
description: 'macOS arm64 AOT'
|
description: 'macOS arm64 AOT'
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
|
osx-x64:
|
||||||
|
description: 'macOS Intel x64'
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
osx-x64-aot:
|
||||||
|
description: 'macOS Intel x64 AOT'
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
android-arm64:
|
android-arm64:
|
||||||
description: 'Android arm64'
|
description: 'Android arm64'
|
||||||
default: false
|
default: false
|
||||||
@@ -65,6 +73,12 @@ on:
|
|||||||
osx-arm64-aot:
|
osx-arm64-aot:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: true
|
default: true
|
||||||
|
osx-x64:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
osx-x64-aot:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
android-arm64:
|
android-arm64:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: true
|
default: true
|
||||||
@@ -180,6 +194,33 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
- name: Publish osx-arm64
|
- name: Publish osx-arm64
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r osx-arm64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r osx-arm64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||||
|
|
||||||
|
- name: Create .app bundle and DMG (create-dmg)
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
APP_DIR="bundle/Semi.Avalonia.Demo.app"
|
||||||
|
MACOS_DIR="${APP_DIR}/Contents/MacOS"
|
||||||
|
mkdir -p "${MACOS_DIR}"
|
||||||
|
cp -R publish/. "${MACOS_DIR}/"
|
||||||
|
chmod +x "${MACOS_DIR}/Semi.Avalonia.Demo.Desktop"
|
||||||
|
cp publish/Info-macOS.plist "${APP_DIR}/Contents/Info.plist"
|
||||||
|
codesign --force --deep --sign - "${APP_DIR}"
|
||||||
|
mkdir -p dmg_stage
|
||||||
|
ditto "${APP_DIR}" "dmg_stage/Semi.Avalonia.Demo.app"
|
||||||
|
brew install create-dmg
|
||||||
|
rm -f Semi.Avalonia.Demo.Desktop.osx-arm64.dmg
|
||||||
|
create-dmg \
|
||||||
|
--volname "Semi Avalonia Demo" \
|
||||||
|
--window-pos 200 120 \
|
||||||
|
--window-size 640 400 \
|
||||||
|
--icon-size 100 \
|
||||||
|
--icon "Semi.Avalonia.Demo.app" 175 185 \
|
||||||
|
--hide-extension "Semi.Avalonia.Demo.app" \
|
||||||
|
--app-drop-link 455 185 \
|
||||||
|
--skip-jenkins \
|
||||||
|
"Semi.Avalonia.Demo.Desktop.osx-arm64.dmg" \
|
||||||
|
"dmg_stage"
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
@@ -188,6 +229,62 @@ jobs:
|
|||||||
publish
|
publish
|
||||||
!publish/*.pdb
|
!publish/*.pdb
|
||||||
|
|
||||||
|
- name: Upload macOS DMG
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: Semi.Avalonia.Demo.Desktop.osx-arm64.dmg
|
||||||
|
path: Semi.Avalonia.Demo.Desktop.osx-arm64.dmg
|
||||||
|
|
||||||
|
osx-x64:
|
||||||
|
if: ${{inputs.osx-x64}}
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Publish osx-x64
|
||||||
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r osx-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||||
|
|
||||||
|
- name: Create .app bundle and DMG (create-dmg)
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
APP_DIR="bundle/Semi.Avalonia.Demo.app"
|
||||||
|
MACOS_DIR="${APP_DIR}/Contents/MacOS"
|
||||||
|
mkdir -p "${MACOS_DIR}"
|
||||||
|
cp -R publish/. "${MACOS_DIR}/"
|
||||||
|
chmod +x "${MACOS_DIR}/Semi.Avalonia.Demo.Desktop"
|
||||||
|
cp publish/Info-macOS.plist "${APP_DIR}/Contents/Info.plist"
|
||||||
|
codesign --force --deep --sign - "${APP_DIR}"
|
||||||
|
mkdir -p dmg_stage
|
||||||
|
ditto "${APP_DIR}" "dmg_stage/Semi.Avalonia.Demo.app"
|
||||||
|
brew install create-dmg
|
||||||
|
rm -f Semi.Avalonia.Demo.Desktop.osx-x64.dmg
|
||||||
|
create-dmg \
|
||||||
|
--volname "Semi Avalonia Demo" \
|
||||||
|
--window-pos 200 120 \
|
||||||
|
--window-size 640 400 \
|
||||||
|
--icon-size 100 \
|
||||||
|
--icon "Semi.Avalonia.Demo.app" 175 185 \
|
||||||
|
--hide-extension "Semi.Avalonia.Demo.app" \
|
||||||
|
--app-drop-link 455 185 \
|
||||||
|
--skip-jenkins \
|
||||||
|
"Semi.Avalonia.Demo.Desktop.osx-x64.dmg" \
|
||||||
|
"dmg_stage"
|
||||||
|
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: Semi.Avalonia.Demo.Desktop.osx-x64
|
||||||
|
path: |
|
||||||
|
publish
|
||||||
|
!publish/*.pdb
|
||||||
|
|
||||||
|
- name: Upload macOS DMG (Intel)
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: Semi.Avalonia.Demo.Desktop.osx-x64.dmg
|
||||||
|
path: Semi.Avalonia.Demo.Desktop.osx-x64.dmg
|
||||||
|
|
||||||
osx-arm64-aot:
|
osx-arm64-aot:
|
||||||
if: ${{inputs.osx-arm64-aot}}
|
if: ${{inputs.osx-arm64-aot}}
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
@@ -206,6 +303,24 @@ jobs:
|
|||||||
publish
|
publish
|
||||||
!publish/*.pdb
|
!publish/*.pdb
|
||||||
|
|
||||||
|
osx-x64-aot:
|
||||||
|
if: ${{inputs.osx-x64-aot}}
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
- name: Enable Native AOT in .csproj
|
||||||
|
run: sed -i '' 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||||
|
- name: Publish osx-x64 AOT
|
||||||
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r osx-x64 -c Release -o publish
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: Semi.Avalonia.Demo.Desktop.osx-x64.NativeAOT
|
||||||
|
path: |
|
||||||
|
publish
|
||||||
|
!publish/*.pdb
|
||||||
|
|
||||||
android-arm64:
|
android-arm64:
|
||||||
if: ${{inputs.android-arm64 }}
|
if: ${{inputs.android-arm64 }}
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ jobs:
|
|||||||
zip -rj Semi.Avalonia.Demo.Desktop.osx-arm64.zip Semi.Avalonia.Demo.Desktop.osx-arm64
|
zip -rj Semi.Avalonia.Demo.Desktop.osx-arm64.zip Semi.Avalonia.Demo.Desktop.osx-arm64
|
||||||
cd Semi.Avalonia.Demo.Desktop.osx-arm64.NativeAOT
|
cd Semi.Avalonia.Demo.Desktop.osx-arm64.NativeAOT
|
||||||
zip -r ../Semi.Avalonia.Demo.Desktop.osx-arm64.NativeAOT.zip .
|
zip -r ../Semi.Avalonia.Demo.Desktop.osx-arm64.NativeAOT.zip .
|
||||||
|
cd "${GITHUB_WORKSPACE}"
|
||||||
|
zip -rj Semi.Avalonia.Demo.Desktop.osx-x64.zip Semi.Avalonia.Demo.Desktop.osx-x64
|
||||||
|
cd Semi.Avalonia.Demo.Desktop.osx-x64.NativeAOT
|
||||||
|
zip -r ../Semi.Avalonia.Demo.Desktop.osx-x64.NativeAOT.zip .
|
||||||
|
|
||||||
- name: Display structure of zipped files
|
- name: Display structure of zipped files
|
||||||
run: ls -R
|
run: ls -R
|
||||||
@@ -72,3 +76,5 @@ jobs:
|
|||||||
nugets/*.nupkg
|
nugets/*.nupkg
|
||||||
android-arm64/*.apk
|
android-arm64/*.apk
|
||||||
*.zip
|
*.zip
|
||||||
|
Semi.Avalonia.Demo.Desktop.osx-arm64.dmg/Semi.Avalonia.Demo.Desktop.osx-arm64.dmg
|
||||||
|
Semi.Avalonia.Demo.Desktop.osx-x64.dmg/Semi.Avalonia.Demo.Desktop.osx-x64.dmg
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
<CentralPackageVersionOverrideEnabled>true</CentralPackageVersionOverrideEnabled>
|
<CentralPackageVersionOverrideEnabled>true</CentralPackageVersionOverrideEnabled>
|
||||||
<AvaloniaVersion>12.0.1</AvaloniaVersion>
|
<AvaloniaVersion>12.0.3</AvaloniaVersion>
|
||||||
<DataGridVersion>12.0.0</DataGridVersion>
|
<DataGridVersion>12.0.0</DataGridVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -18,11 +18,10 @@
|
|||||||
<Folder Name="/Solution Items/">
|
<Folder Name="/Solution Items/">
|
||||||
<File Path="Directory.Packages.props"/>
|
<File Path="Directory.Packages.props"/>
|
||||||
<File Path="global.json"/>
|
<File Path="global.json"/>
|
||||||
<File Path="Nuget.Config"/>
|
<File Path="NuGet.Config"/>
|
||||||
</Folder>
|
</Folder>
|
||||||
<Folder Name="/Solution Items/Demo/">
|
<Folder Name="/Solution Items/Demo/">
|
||||||
<File Path="demo/Directory.Build.targets"/>
|
<File Path="demo/Directory.Build.targets"/>
|
||||||
<File Path="demo/global.json"/>
|
|
||||||
</Folder>
|
</Folder>
|
||||||
<Folder Name="/Solution Items/Src/">
|
<Folder Name="/Solution Items/Src/">
|
||||||
<File Path="src/Directory.Build.props"/>
|
<File Path="src/Directory.Build.props"/>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AvaloniaVersion>12.0.2</AvaloniaVersion>
|
<AvaloniaVersion>12.0.3</AvaloniaVersion>
|
||||||
<DataGridVersion>12.0.0</DataGridVersion>
|
<DataGridVersion>12.0.0</DataGridVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>Semi.Avalonia.Demo.Desktop</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>org.avaloniaui.SemiAvaloniaDemo</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>Semi Avalonia Demo</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>$(Version)</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>$(Version)</string>
|
||||||
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
<string>10.15</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -1,33 +1,56 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Version>1.0.0</Version>
|
||||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
<Nullable>enable</Nullable>
|
||||||
<ApplicationIcon>..\Semi.Avalonia.Demo\Assets\irihi.ico</ApplicationIcon>
|
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||||
<!-- Uncomment below to enable Native AOT compilation-->
|
<ApplicationIcon>..\Semi.Avalonia.Demo\Assets\irihi.ico</ApplicationIcon>
|
||||||
<!--<PublishAot>true</PublishAot>-->
|
<!-- Uncomment below to enable Native AOT compilation-->
|
||||||
</PropertyGroup>
|
<!--<PublishAot>true</PublishAot>-->
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||||
<IsTrimmable>true</IsTrimmable>
|
<IsTrimmable>true</IsTrimmable>
|
||||||
<PublishTrimmed>true</PublishTrimmed>
|
<PublishTrimmed>true</PublishTrimmed>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<TrimmerRootDescriptor Include="Roots.xml"/>
|
<TrimmerRootDescriptor Include="Roots.xml"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Avalonia.Desktop"/>
|
<PackageReference Include="Avalonia.Desktop"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj"/>
|
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj"/>
|
||||||
<ProjectReference Include="..\Semi.Avalonia.Demo.Fonts\Semi.Avalonia.Demo.Fonts.csproj"/>
|
<ProjectReference Include="..\Semi.Avalonia.Demo.Fonts\Semi.Avalonia.Demo.Fonts.csproj"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<UsingTask TaskName="ExpandMacOSPlistVersion" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
|
||||||
|
<ParameterGroup>
|
||||||
|
<InputFile ParameterType="System.String" Required="true"/>
|
||||||
|
<OutputFile ParameterType="System.String" Required="true"/>
|
||||||
|
<AppVersion ParameterType="System.String" Required="true"/>
|
||||||
|
</ParameterGroup>
|
||||||
|
<Task>
|
||||||
|
<Code Type="Fragment" Language="cs"><![CDATA[
|
||||||
|
var token = "$" + "(Version)";
|
||||||
|
System.IO.File.WriteAllText(
|
||||||
|
OutputFile,
|
||||||
|
System.IO.File.ReadAllText(InputFile).Replace(token, AppVersion));
|
||||||
|
]]></Code>
|
||||||
|
</Task>
|
||||||
|
</UsingTask>
|
||||||
|
<Target Name="ExpandMacOSInfoPlist" AfterTargets="Publish">
|
||||||
|
<ExpandMacOSPlistVersion
|
||||||
|
InputFile="$(MSBuildProjectDirectory)/Info-macOS.plist"
|
||||||
|
OutputFile="$(PublishDir)Info-macOS.plist"
|
||||||
|
AppVersion="$(Version)"/>
|
||||||
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<ScrollViewer DockPanel.Dock="Right" Width="260">
|
<ScrollViewer DockPanel.Dock="Right" Width="260">
|
||||||
<StackPanel Margin="12" Spacing="8">
|
<StackPanel Margin="12" Spacing="8">
|
||||||
<TextBlock Text="Configuration" FontWeight="SemiBold" FontSize="16" />
|
<TextBlock Text="Configuration" FontWeight="SemiBold" FontSize="16" />
|
||||||
<TextBlock Text="Navigation" FontWeight="SemiBold" FontSize="13" />
|
<TextBlock Text="Navigation" FontWeight="SemiBold" FontSize="14" />
|
||||||
|
|
||||||
<Button Content="Push Page"
|
<Button Content="Push Page"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
@@ -26,6 +26,20 @@
|
|||||||
|
|
||||||
<Separator />
|
<Separator />
|
||||||
|
|
||||||
|
<TextBlock Text="Modal Actions" FontWeight="SemiBold" FontSize="14" />
|
||||||
|
<Button Name="PushModalButton"
|
||||||
|
Content="Push Modal"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Click="OnPushModal" />
|
||||||
|
<Button Name="PopModalButton"
|
||||||
|
Content="Pop Modal"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Click="OnPopModal" />
|
||||||
|
<Button Name="PopAllModalsButton"
|
||||||
|
Content="Pop All Modals"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Click="OnPopAllModals" />
|
||||||
|
|
||||||
<TextBlock Text="Options" FontWeight="SemiBold" FontSize="14" />
|
<TextBlock Text="Options" FontWeight="SemiBold" FontSize="14" />
|
||||||
|
|
||||||
<CheckBox Name="HasNavBarCheck"
|
<CheckBox Name="HasNavBarCheck"
|
||||||
@@ -35,20 +49,38 @@
|
|||||||
<CheckBox Name="HasBackButtonCheck"
|
<CheckBox Name="HasBackButtonCheck"
|
||||||
Content="Has Back Button"
|
Content="Has Back Button"
|
||||||
IsChecked="True"
|
IsChecked="True"
|
||||||
IsCheckedChanged="OnHasBackButonChanged" />
|
IsCheckedChanged="OnHasBackButtonChanged" />
|
||||||
|
<CheckBox Name="HasShadowCheck"
|
||||||
|
Content="Has Shadow"
|
||||||
|
IsChecked="True"
|
||||||
|
IsCheckedChanged="OnHasShadowChanged" />
|
||||||
|
<CheckBox Name="large" Content="Large" />
|
||||||
|
|
||||||
|
<Separator />
|
||||||
|
|
||||||
|
<TextBlock Text="Modal Transition" FontWeight="SemiBold" FontSize="14" />
|
||||||
|
<ComboBox Name="TransitionCombo"
|
||||||
|
SelectedIndex="0"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
SelectionChanged="OnTransitionChanged">
|
||||||
|
<ComboBoxItem Content="Slide from Bottom" />
|
||||||
|
<ComboBoxItem Content="CrossFade" />
|
||||||
|
<ComboBoxItem Content="None" />
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
<Separator />
|
<Separator />
|
||||||
|
|
||||||
<TextBlock Text="Status" FontWeight="SemiBold" FontSize="14" />
|
<TextBlock Text="Status" FontWeight="SemiBold" FontSize="14" />
|
||||||
<TextBlock Name="StatusText"
|
<TextBlock Name="StatusText"
|
||||||
Text="Depth: 1"
|
Text="Depth: 1"
|
||||||
Opacity="0.7"
|
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<TextBlock Name="HeaderText"
|
<TextBlock Name="HeaderText"
|
||||||
Text="Current: Home"
|
Text="Current: Home"
|
||||||
Opacity="0.7"
|
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<ToggleSwitch Content="Large" Name="large" />
|
<TextBlock Name="ModalText"
|
||||||
|
Text="Modals: 0"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using System;
|
||||||
|
using Avalonia.Animation;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
|
|
||||||
@@ -6,6 +8,7 @@ namespace Semi.Avalonia.Demo.Pages;
|
|||||||
public partial class NavigationPageDemo : UserControl
|
public partial class NavigationPageDemo : UserControl
|
||||||
{
|
{
|
||||||
private int _pageCount;
|
private int _pageCount;
|
||||||
|
private int _modalCount;
|
||||||
|
|
||||||
public NavigationPageDemo()
|
public NavigationPageDemo()
|
||||||
{
|
{
|
||||||
@@ -15,7 +18,7 @@ public partial class NavigationPageDemo : UserControl
|
|||||||
|
|
||||||
private async void OnLoaded(object? sender, RoutedEventArgs e)
|
private async void OnLoaded(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
await DemoNav.PushAsync(NavigationDemoHelper.MakePage("Home", "Welcome!\nUse the buttons to push and pop pages.", 0), null);
|
await DemoNav.PushAsync(NavigationDemoHelper.MakePage("Home", "Welcome!\nUse the buttons to push and pop pages/modals.", 0), null);
|
||||||
UpdateStatus();
|
UpdateStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,6 +45,27 @@ public partial class NavigationPageDemo : UserControl
|
|||||||
UpdateStatus();
|
UpdateStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void OnPushModal(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
_modalCount++;
|
||||||
|
var modal = NavigationDemoHelper.MakePage($"Modal {_modalCount}", "This page was presented modally.\nTap 'Pop Modal' to dismiss.", _modalCount);
|
||||||
|
await DemoNav.PushModalAsync(modal);
|
||||||
|
UpdateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void OnPopModal(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await DemoNav.PopModalAsync();
|
||||||
|
UpdateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void OnPopAllModals(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await DemoNav.PopAllModalsAsync();
|
||||||
|
_modalCount = 0;
|
||||||
|
UpdateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
private void OnHasNavBarChanged(object? sender, RoutedEventArgs e)
|
private void OnHasNavBarChanged(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (DemoNav == null)
|
if (DemoNav == null)
|
||||||
@@ -50,7 +74,7 @@ public partial class NavigationPageDemo : UserControl
|
|||||||
NavigationPage.SetHasNavigationBar(DemoNav.CurrentPage, HasNavBarCheck.IsChecked == true);
|
NavigationPage.SetHasNavigationBar(DemoNav.CurrentPage, HasNavBarCheck.IsChecked == true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnHasBackButonChanged(object? sender, RoutedEventArgs e)
|
private void OnHasBackButtonChanged(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (DemoNav == null)
|
if (DemoNav == null)
|
||||||
return;
|
return;
|
||||||
@@ -58,9 +82,30 @@ public partial class NavigationPageDemo : UserControl
|
|||||||
NavigationPage.SetHasBackButton(DemoNav.CurrentPage, HasBackButtonCheck.IsChecked == true);
|
NavigationPage.SetHasBackButton(DemoNav.CurrentPage, HasBackButtonCheck.IsChecked == true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnHasShadowChanged(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (DemoNav == null)
|
||||||
|
return;
|
||||||
|
if (DemoNav.CurrentPage != null)
|
||||||
|
DemoNav.HasShadow = HasShadowCheck.IsChecked == true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnTransitionChanged(object? sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (DemoNav == null)
|
||||||
|
return;
|
||||||
|
DemoNav.ModalTransition = TransitionCombo.SelectedIndex switch
|
||||||
|
{
|
||||||
|
1 => new CrossFade(TimeSpan.FromMilliseconds(250)),
|
||||||
|
2 => null,
|
||||||
|
_ => new PageSlide(TimeSpan.FromMilliseconds(300), PageSlide.SlideAxis.Vertical)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
private void UpdateStatus()
|
private void UpdateStatus()
|
||||||
{
|
{
|
||||||
StatusText.Text = $"Depth: {DemoNav.StackDepth}";
|
StatusText.Text = $"Depth: {DemoNav.StackDepth}";
|
||||||
HeaderText.Text = $"Current: {DemoNav.CurrentPage?.Header ?? "(none)"}";
|
HeaderText.Text = $"Current: {DemoNav.CurrentPage?.Header ?? "(none)"}";
|
||||||
|
ModalText.Text = $"Modals: {DemoNav.ModalStack.Count}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
<Style Selector="Border.NavItemHost">
|
<Style Selector="Border.NavItemHost">
|
||||||
<Setter Property="Margin" Value="6,0" />
|
<Setter Property="Margin" Value="6,0" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource SemiBorderRadiusSmall}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style Selector="Border.NavItemHost.Selected">
|
<Style Selector="Border.NavItemHost.Selected">
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
||||||
<Version>12.0.1</Version>
|
<Version>12.0.3</Version>
|
||||||
<PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 12.0.1</PackageReleaseNotes>
|
<PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 12.0.3</PackageReleaseNotes>
|
||||||
<Title>Semi.Avalonia.ColorPicker</Title>
|
<Title>Semi.Avalonia.ColorPicker</Title>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,26 @@
|
|||||||
<ControlTheme x:Key="{x:Type NavigationPage}" TargetType="NavigationPage">
|
<ControlTheme x:Key="{x:Type NavigationPage}" TargetType="NavigationPage">
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
<Setter Property="BarHeight" Value="{DynamicResource NavigationPageBarMinHeight}" />
|
<Setter Property="BarHeight" Value="{DynamicResource NavigationPageBarMinHeight}" />
|
||||||
|
<Setter Property="PageTransition">
|
||||||
|
<PageSlide Duration="0:0:0.3" Orientation="Horizontal" FillMode="Forward">
|
||||||
|
<PageSlide.SlideInEasing>
|
||||||
|
<SplineEasing X1="0.16" Y1="1" X2="0.3" Y2="1" />
|
||||||
|
</PageSlide.SlideInEasing>
|
||||||
|
<PageSlide.SlideOutEasing>
|
||||||
|
<SplineEasing X1="0.2" Y1="0.85" X2="0.3" Y2="1" />
|
||||||
|
</PageSlide.SlideOutEasing>
|
||||||
|
</PageSlide>
|
||||||
|
</Setter>
|
||||||
|
<Setter Property="ModalTransition">
|
||||||
|
<PageSlide Duration="0:0:0.25" Orientation="Vertical" FillMode="Forward">
|
||||||
|
<PageSlide.SlideInEasing>
|
||||||
|
<SplineEasing X1="0.16" Y1="1" X2="0.3" Y2="1" />
|
||||||
|
</PageSlide.SlideInEasing>
|
||||||
|
<PageSlide.SlideOutEasing>
|
||||||
|
<SplineEasing X1="0.2" Y1="0.85" X2="0.3" Y2="1" />
|
||||||
|
</PageSlide.SlideOutEasing>
|
||||||
|
</PageSlide>
|
||||||
|
</Setter>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="NavigationPage">
|
<ControlTemplate TargetType="NavigationPage">
|
||||||
<Panel ClipToBounds="True">
|
<Panel ClipToBounds="True">
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
||||||
<Version>12.0.1</Version>
|
<Version>12.0.3</Version>
|
||||||
<PackageReleaseNotes>Update to Semi.Avalonia 12.0.1</PackageReleaseNotes>
|
<PackageReleaseNotes>Update to Semi.Avalonia 12.0.3</PackageReleaseNotes>
|
||||||
<Title>Semi.Avalonia</Title>
|
<Title>Semi.Avalonia</Title>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user