mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-29 20:53:23 +08:00
misc: update to preview 5 nightly build
This commit is contained in:
@@ -27,6 +27,6 @@ class Program
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
=> AppBuilder.Configure<App>()
|
||||
.UsePlatformDetect()
|
||||
.With(new Win32PlatformOptions(){ UseCompositor = false})
|
||||
.With(new Win32PlatformOptions())
|
||||
.LogToTrace();
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.0.999-cibuild0029384-beta" />
|
||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0029384-beta" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Semi.Avalonia.Demo.Web">
|
||||
<Application.Styles>
|
||||
<FluentTheme Mode="Light" />
|
||||
<FluentTheme />
|
||||
<StyleInclude Source="avares://Semi.Avalonia/Themes/LightTheme.axaml" />
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
@@ -8,18 +8,10 @@ using Semi.Avalonia.Demo.Web;
|
||||
|
||||
internal partial class Program
|
||||
{
|
||||
private static void Main(string[] args) => BuildAvaloniaApp()
|
||||
.With(new FontManagerOptions
|
||||
{
|
||||
FontFallbacks = new[]
|
||||
{
|
||||
new FontFallback
|
||||
{
|
||||
FontFamily = new FontFamily("avares://Semi.Avalonia.Demo.Web/Assets/SourceHanSansCN-Regular.otf#Source Han Sans CN")
|
||||
}
|
||||
}
|
||||
})
|
||||
.SetupBrowserApp("out");
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
BuildAvaloniaApp();
|
||||
}
|
||||
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
=> AppBuilder.Configure<App>();
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0-preview4" />
|
||||
<PackageReference Include="Avalonia.Web" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.999-cibuild0029384-beta" />
|
||||
<PackageReference Include="Avalonia.Web" Version="11.0.999-cibuild0026358-beta" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dialogs="clr-namespace:Avalonia.Dialogs;assembly=Avalonia.Dialogs"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
|
||||
@@ -21,7 +21,8 @@ public partial class ManagedFileChooserDemo : UserControl
|
||||
|
||||
private async void OpenFileDialog(object sender, RoutedEventArgs args)
|
||||
{
|
||||
IStorageProvider sp = GetStorageProvider();
|
||||
IStorageProvider? sp = GetStorageProvider();
|
||||
if (sp is null) return;
|
||||
var result = await sp.OpenFilePickerAsync(new FilePickerOpenOptions()
|
||||
{
|
||||
Title = "Open File",
|
||||
@@ -31,7 +32,8 @@ public partial class ManagedFileChooserDemo : UserControl
|
||||
}
|
||||
private async void SelectFolderDialog(object sender, RoutedEventArgs args)
|
||||
{
|
||||
IStorageProvider sp = GetStorageProvider();
|
||||
IStorageProvider? sp = GetStorageProvider();
|
||||
if (sp is null) return;
|
||||
var result = await sp.OpenFolderPickerAsync(new FolderPickerOpenOptions()
|
||||
{
|
||||
Title = "Select Folder",
|
||||
@@ -40,22 +42,21 @@ public partial class ManagedFileChooserDemo : UserControl
|
||||
}
|
||||
private async void SaveFileDialog(object sender, RoutedEventArgs args)
|
||||
{
|
||||
IStorageProvider sp = GetStorageProvider();
|
||||
IStorageProvider? sp = GetStorageProvider();
|
||||
if (sp is null) return;
|
||||
var result = await sp.SaveFilePickerAsync(new FilePickerSaveOptions()
|
||||
{
|
||||
Title = "Open File",
|
||||
});
|
||||
}
|
||||
|
||||
private IStorageProvider GetStorageProvider()
|
||||
private IStorageProvider? GetStorageProvider()
|
||||
{
|
||||
return new ManagedStorageProvider<Window>(GetWindow(), null);
|
||||
}
|
||||
|
||||
private static string FullPathOrName(IStorageItem? item)
|
||||
{
|
||||
if (item is null) return "(null)";
|
||||
return item.TryGetUri(out var uri) ? uri.ToString() : item.Name;
|
||||
if (this.VisualRoot is Window w)
|
||||
{
|
||||
return w.StorageProvider;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Window GetWindow() => this.VisualRoot as Window ?? throw new NullReferenceException("Invalid Owner");
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="11.0.0-preview4" />
|
||||
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0029384-beta" />
|
||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview4" />
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0029384-beta" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" />
|
||||
<PackageReference Include="XamlNameReferenceGenerator" Version="1.5.1" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user