From e9cd6e94016022f2efa2a1f5d8065db471554ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wies=C5=82aw=20S=CC=8Colte=CC=81s?= Date: Sun, 28 Jan 2024 11:04:24 +0100 Subject: [PATCH] Downgrade to 0.10.22 --- Svg.Skia.sln | 3 +- build/Avalonia.Desktop.props | 2 +- build/Avalonia.Diagnostics.props | 2 +- build/Avalonia.ReactiveUI.props | 2 +- build/Avalonia.Skia.props | 2 +- build/Avalonia.Themes.Fluent.props | 3 +- build/Avalonia.Web.props | 6 - build/Avalonia.props | 2 +- build/Base.props | 4 +- samples/AvaloniaControlsSample/App.axaml | 3 +- .../AvaloniaSKPictureImageSample/App.axaml | 3 +- .../MainWindow.axaml | 40 +-- samples/AvaloniaSvgSample/App.axaml | 3 +- samples/AvaloniaSvgSample/MainWindow.axaml.cs | 4 +- samples/AvaloniaSvgSkiaSample/App.axaml | 3 +- samples/AvaloniaSvgSkiaSample/App.axaml.cs | 2 +- .../AvaloniaSvgSkiaSample/MainWindow.axaml.cs | 4 +- samples/AvaloniaSvgSkiaSample/Program.cs | 13 +- .../AvaloniaSvgSkiaStylingSample/App.axaml | 3 +- .../MainWindow.axaml.cs | 4 +- samples/TestApp/App.axaml | 3 +- samples/TestApp/Services/StorageService.cs | 236 +++++++++--------- samples/TestApp/TestApp.csproj | 4 + samples/TestApp/ViewLocator.cs | 2 +- .../TestApp/ViewModels/MainWindowViewModel.cs | 16 +- samples/TestApp/Views/MainView.axaml | 2 +- samples/TestApp/Views/MainView.axaml.cs | 6 +- src/Avalonia.Controls.Skia/SKBitmapControl.cs | 4 +- .../SKBitmapDrawOperation.cs | 10 +- src/Avalonia.Controls.Skia/SKBitmapImage.cs | 10 +- src/Avalonia.Controls.Skia/SKCanvasControl.cs | 2 +- .../SKCanvasDrawOperation.cs | 10 +- src/Avalonia.Controls.Skia/SKPathControl.cs | 4 +- .../SKPathDrawOperation.cs | 10 +- src/Avalonia.Controls.Skia/SKPathImage.cs | 10 +- .../SKPictureControl.cs | 4 +- .../SKPictureDrawOperation.cs | 10 +- src/Avalonia.Controls.Skia/SKPictureImage.cs | 10 +- src/Avalonia.Svg.Skia/Svg.cs | 14 +- .../SvgCustomDrawOperation.cs | 10 +- src/Avalonia.Svg.Skia/SvgImage.cs | 14 +- src/Avalonia.Svg.Skia/SvgSource.cs | 4 +- src/Avalonia.Svg/AvaloniaAssetLoader.cs | 5 +- src/Avalonia.Svg/AvaloniaModelExtensions.cs | 88 ++----- src/Avalonia.Svg/AvaloniaPicture.cs | 15 +- src/Avalonia.Svg/Commands/ImageDrawCommand.cs | 2 +- src/Avalonia.Svg/Commands/TextDrawCommand.cs | 4 +- src/Avalonia.Svg/Svg.cs | 12 +- src/Avalonia.Svg/SvgImage.cs | 8 +- src/Avalonia.Svg/SvgSource.cs | 2 +- .../SvgImageTests.cs | 2 +- 51 files changed, 297 insertions(+), 344 deletions(-) delete mode 100644 build/Avalonia.Web.props diff --git a/Svg.Skia.sln b/Svg.Skia.sln index 40b73ff86..c5a0d66df 100644 --- a/Svg.Skia.sln +++ b/Svg.Skia.sln @@ -45,8 +45,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "props", "props", "{5BFEF4F8 build\Avalonia.props = build\Avalonia.props build\Avalonia.ReactiveUI.props = build\Avalonia.ReactiveUI.props build\Avalonia.Skia.props = build\Avalonia.Skia.props - build\Avalonia.Themes.Fluent.props = build\Avalonia.Themes.Fluent.props - build\Avalonia.Web.props = build\Avalonia.Web.props build\Base.props = build\Base.props build\HarfBuzzSharp.NativeAssets.Linux.props = build\HarfBuzzSharp.NativeAssets.Linux.props build\Newtonsoft.Json.props = build\Newtonsoft.Json.props @@ -60,6 +58,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "props", "props", "{5BFEF4F8 build\Svg.props = build\Svg.props build\System.CommandLine.props = build\System.CommandLine.props build\XUnit.props = build\XUnit.props + build\Avalonia.Themes.Fluent.props = build\Avalonia.Themes.Fluent.props EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{7863AE7D-FF68-45BF-BA68-6FA0E5604CB7}" diff --git a/build/Avalonia.Desktop.props b/build/Avalonia.Desktop.props index db46665bd..1eabddf08 100644 --- a/build/Avalonia.Desktop.props +++ b/build/Avalonia.Desktop.props @@ -1,6 +1,6 @@  - + diff --git a/build/Avalonia.Diagnostics.props b/build/Avalonia.Diagnostics.props index 29d898f9d..986a1ff82 100644 --- a/build/Avalonia.Diagnostics.props +++ b/build/Avalonia.Diagnostics.props @@ -1,6 +1,6 @@  - + diff --git a/build/Avalonia.ReactiveUI.props b/build/Avalonia.ReactiveUI.props index e9c8ba4f2..4dfcbf089 100644 --- a/build/Avalonia.ReactiveUI.props +++ b/build/Avalonia.ReactiveUI.props @@ -1,6 +1,6 @@  - + diff --git a/build/Avalonia.Skia.props b/build/Avalonia.Skia.props index df4a4cb0e..b306f8567 100644 --- a/build/Avalonia.Skia.props +++ b/build/Avalonia.Skia.props @@ -1,6 +1,6 @@  - + diff --git a/build/Avalonia.Themes.Fluent.props b/build/Avalonia.Themes.Fluent.props index a23e70cb7..79415894d 100644 --- a/build/Avalonia.Themes.Fluent.props +++ b/build/Avalonia.Themes.Fluent.props @@ -1,7 +1,6 @@  - - + diff --git a/build/Avalonia.Web.props b/build/Avalonia.Web.props deleted file mode 100644 index fed3b22ef..000000000 --- a/build/Avalonia.Web.props +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/build/Avalonia.props b/build/Avalonia.props index 75c0fcba7..a7a24fdee 100644 --- a/build/Avalonia.props +++ b/build/Avalonia.props @@ -1,6 +1,6 @@  - + diff --git a/build/Base.props b/build/Base.props index 2ec9ffe62..5120bbea8 100644 --- a/build/Base.props +++ b/build/Base.props @@ -1,9 +1,9 @@ - 1.0.0.13 + 0.5.22.1 - 11.0.0.13 + 0.10.22.1 $(VersionSuffix) Wiesław Šoltés Wiesław Šoltés diff --git a/samples/AvaloniaControlsSample/App.axaml b/samples/AvaloniaControlsSample/App.axaml index 17b942186..e156f88c8 100644 --- a/samples/AvaloniaControlsSample/App.axaml +++ b/samples/AvaloniaControlsSample/App.axaml @@ -1,8 +1,7 @@  + Name="AvaloniaControlsSample"> diff --git a/samples/AvaloniaSKPictureImageSample/App.axaml b/samples/AvaloniaSKPictureImageSample/App.axaml index c54fbea7a..0299a11f0 100644 --- a/samples/AvaloniaSKPictureImageSample/App.axaml +++ b/samples/AvaloniaSKPictureImageSample/App.axaml @@ -1,8 +1,7 @@  + Name="AvaloniaSKPictureImageSample"> diff --git a/samples/AvaloniaSKPictureImageSample/MainWindow.axaml b/samples/AvaloniaSKPictureImageSample/MainWindow.axaml index 0cec335dc..9365b8226 100644 --- a/samples/AvaloniaSKPictureImageSample/MainWindow.axaml +++ b/samples/AvaloniaSKPictureImageSample/MainWindow.axaml @@ -18,8 +18,8 @@ Uniform UniformToFill - + + @@ -54,39 +54,39 @@ Uniform UniformToFill - - - - - - - - + + + + + + + + + + + - - - + + + None Fill Uniform UniformToFill - + + - + + diff --git a/samples/AvaloniaSvgSample/App.axaml b/samples/AvaloniaSvgSample/App.axaml index f8b561ed9..e31182e8d 100644 --- a/samples/AvaloniaSvgSample/App.axaml +++ b/samples/AvaloniaSvgSample/App.axaml @@ -1,8 +1,7 @@  + Name="AvaloniaSvgSample"> diff --git a/samples/AvaloniaSvgSample/MainWindow.axaml.cs b/samples/AvaloniaSvgSample/MainWindow.axaml.cs index 7e28f7bbe..60c56c10f 100644 --- a/samples/AvaloniaSvgSample/MainWindow.axaml.cs +++ b/samples/AvaloniaSvgSample/MainWindow.axaml.cs @@ -86,7 +86,7 @@ private void DragOver(object sender, DragEventArgs e) { e.DragEffects = e.DragEffects & (DragDropEffects.Copy | DragDropEffects.Link); - if (!e.Data.Contains(DataFormats.Files)) + if (!e.Data.Contains(DataFormats.FileNames)) { e.DragEffects = DragDropEffects.None; } @@ -94,7 +94,7 @@ private void DragOver(object sender, DragEventArgs e) private void Drop(object sender, DragEventArgs e) { - if (e.Data.Contains(DataFormats.Files)) + if (e.Data.Contains(DataFormats.FileNames)) { var fileName = e.Data.GetFileNames()?.FirstOrDefault(); if (!string.IsNullOrWhiteSpace(fileName)) diff --git a/samples/AvaloniaSvgSkiaSample/App.axaml b/samples/AvaloniaSvgSkiaSample/App.axaml index 1802bd088..ec02093cc 100644 --- a/samples/AvaloniaSvgSkiaSample/App.axaml +++ b/samples/AvaloniaSvgSkiaSample/App.axaml @@ -1,8 +1,7 @@  + Name="AvaloniaSvgSkiaSample"> diff --git a/samples/AvaloniaSvgSkiaSample/App.axaml.cs b/samples/AvaloniaSvgSkiaSample/App.axaml.cs index 6336a240a..c50c7e0b4 100644 --- a/samples/AvaloniaSvgSkiaSample/App.axaml.cs +++ b/samples/AvaloniaSvgSkiaSample/App.axaml.cs @@ -20,4 +20,4 @@ public override void OnFrameworkInitializationCompleted() base.OnFrameworkInitializationCompleted(); } -} \ No newline at end of file +} diff --git a/samples/AvaloniaSvgSkiaSample/MainWindow.axaml.cs b/samples/AvaloniaSvgSkiaSample/MainWindow.axaml.cs index 01657aebd..3225fe8a4 100644 --- a/samples/AvaloniaSvgSkiaSample/MainWindow.axaml.cs +++ b/samples/AvaloniaSvgSkiaSample/MainWindow.axaml.cs @@ -88,7 +88,7 @@ private void DragOver(object sender, DragEventArgs e) { e.DragEffects = e.DragEffects & (DragDropEffects.Copy | DragDropEffects.Link); - if (!e.Data.Contains(DataFormats.Files)) + if (!e.Data.Contains(DataFormats.FileNames)) { e.DragEffects = DragDropEffects.None; } @@ -96,7 +96,7 @@ private void DragOver(object sender, DragEventArgs e) private void Drop(object sender, DragEventArgs e) { - if (e.Data.Contains(DataFormats.Files)) + if (e.Data.Contains(DataFormats.FileNames)) { var fileName = e.Data.GetFileNames()?.FirstOrDefault(); if (!string.IsNullOrWhiteSpace(fileName)) diff --git a/samples/AvaloniaSvgSkiaSample/Program.cs b/samples/AvaloniaSvgSkiaSample/Program.cs index 26bfc5434..c9287a5b1 100644 --- a/samples/AvaloniaSvgSkiaSample/Program.cs +++ b/samples/AvaloniaSvgSkiaSample/Program.cs @@ -7,8 +7,17 @@ namespace AvaloniaSvgSkiaSample; internal class Program { [STAThread] - public static void Main(string[] args) => BuildAvaloniaApp() - .StartWithClassicDesktopLifetime(args); + public static void Main(string[] args) + { + try + { + BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); + } + catch (Exception e) + { + Console.WriteLine(e); + } + } public static AppBuilder BuildAvaloniaApp() { diff --git a/samples/AvaloniaSvgSkiaStylingSample/App.axaml b/samples/AvaloniaSvgSkiaStylingSample/App.axaml index 4761ac7b2..4b21472d9 100644 --- a/samples/AvaloniaSvgSkiaStylingSample/App.axaml +++ b/samples/AvaloniaSvgSkiaStylingSample/App.axaml @@ -1,8 +1,7 @@  + Name="AvaloniaSvgSkiaStylingSample"> diff --git a/samples/AvaloniaSvgSkiaStylingSample/MainWindow.axaml.cs b/samples/AvaloniaSvgSkiaStylingSample/MainWindow.axaml.cs index a6580d4b3..83cf98c66 100644 --- a/samples/AvaloniaSvgSkiaStylingSample/MainWindow.axaml.cs +++ b/samples/AvaloniaSvgSkiaStylingSample/MainWindow.axaml.cs @@ -21,11 +21,11 @@ public MainWindow() private void ApplySvgStyleButtonClick(object sender, EventArgs e) { - SvgControl.SetCurrentValue(Avalonia.Svg.Skia.Svg.CssProperty, ".Black { fill: #AAAAFF; }"); + SvgControl.SetValue(Avalonia.Svg.Skia.Svg.CssProperty, ".Black { fill: #AAAAFF; }"); } private void ApplySvgImageStyleButtonClick(object sender, EventArgs e) { - SvgImageButton.SetCurrentValue(Avalonia.Svg.Skia.Svg.CssProperty, ".Black { fill: #AAAAFF; }"); + SvgImageButton.SetValue(Avalonia.Svg.Skia.Svg.CssProperty, ".Black { fill: #AAAAFF; }"); } } diff --git a/samples/TestApp/App.axaml b/samples/TestApp/App.axaml index 58dafa0b5..1c6f27e90 100644 --- a/samples/TestApp/App.axaml +++ b/samples/TestApp/App.axaml @@ -2,8 +2,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:TestApp" x:Class="TestApp.App" - Name="TestApp" - RequestedThemeVariant="Light"> + Name="TestApp"> diff --git a/samples/TestApp/Services/StorageService.cs b/samples/TestApp/Services/StorageService.cs index bb5797b4e..1dc368081 100644 --- a/samples/TestApp/Services/StorageService.cs +++ b/samples/TestApp/Services/StorageService.cs @@ -1,118 +1,118 @@ -using Avalonia; -using Avalonia.Controls; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Platform.Storage; -using Avalonia.VisualTree; - -namespace TestApp.Services; - -internal static class StorageService -{ - public static FilePickerFileType All { get; } = new("All") - { - Patterns = new[] { "*.*" }, - MimeTypes = new[] { "*/*" } - }; - - public static FilePickerFileType Json { get; } = new("Json") - { - Patterns = new[] { "*.json" }, - AppleUniformTypeIdentifiers = new[] { "public.json" }, - MimeTypes = new[] { "application/json" } - }; - - public static FilePickerFileType CSharp { get; } = new("C#") - { - Patterns = new[] { "*.cs" }, - AppleUniformTypeIdentifiers = new[] { "public.csharp-source" }, - MimeTypes = new[] { "text/plain" } - }; - - public static FilePickerFileType ImagePng { get; } = new("PNG image") - { - Patterns = new[] { "*.png" }, - AppleUniformTypeIdentifiers = new[] { "public.png" }, - MimeTypes = new[] { "image/png" } - }; - - public static FilePickerFileType ImageJpg { get; } = new("JPEG image") - { - Patterns = new[] { "*.jpg", "*.jpeg" }, - AppleUniformTypeIdentifiers = new[] { "public.jpeg" }, - MimeTypes = new[] { "image/jpeg" } - }; - - public static FilePickerFileType ImageAll { get; } = new("All Images") - { - Patterns = new[] { "*.png", "*.jpg", "*.jpeg", "*.bmp" }, - AppleUniformTypeIdentifiers = new[] { "public.image" }, - MimeTypes = new[] { "image/*" } - }; - - public static FilePickerFileType ImageSvg { get; } = new("Svg") - { - Patterns = new[] { "*.svg" }, - AppleUniformTypeIdentifiers = new[] { "public.svg-image" }, - MimeTypes = new[] { "image/svg+xml" } - }; - - public static FilePickerFileType ImageSvgz { get; } = new("Svgz") - { - Patterns = new[] { "*.svgz" }, - // TODO: - AppleUniformTypeIdentifiers = new[] { "public.svg-image" }, - // TODO: - MimeTypes = new[] { "image/svg+xml" } - }; - - public static FilePickerFileType Xaml { get; } = new("Xaml") - { - Patterns = new[] { "*.xaml" }, - // TODO: - AppleUniformTypeIdentifiers = new[] { "public.xaml" }, - // TODO: - MimeTypes = new[] { "application/xaml" } - }; - - public static FilePickerFileType Axaml { get; } = new("Axaml") - { - Patterns = new[] { "*.axaml" }, - // TODO: - AppleUniformTypeIdentifiers = new[] { "public.axaml" }, - // TODO: - MimeTypes = new[] { "application/axaml" } - }; - - public static FilePickerFileType Pdf { get; } = new("PDF document") - { - Patterns = new[] { "*.pdf" }, - AppleUniformTypeIdentifiers = new[] { "com.adobe.pdf" }, - MimeTypes = new[] { "application/pdf" } - }; - - public static FilePickerFileType Xps { get; } = new("XPS document") - { - Patterns = new[] { "*.xps" }, - AppleUniformTypeIdentifiers = new[] { "com.microsoft.xps" }, - MimeTypes = new[] { "application/oxps", "application/vnd.ms-xpsdocument" } - }; - - public static IStorageProvider? GetStorageProvider() - { - if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow: { } window }) - { - return window.StorageProvider; - } - - if (Application.Current?.ApplicationLifetime is ISingleViewApplicationLifetime { MainView: { } mainView }) - { - var visualRoot = mainView.GetVisualRoot(); - if (visualRoot is TopLevel topLevel) - { - return topLevel.StorageProvider; - } - } - - return null; - } -} +// using Avalonia; +// using Avalonia.Controls; +// using Avalonia.Controls.ApplicationLifetimes; +// using Avalonia.Platform.Storage; +// using Avalonia.VisualTree; + +// namespace TestApp.Services; + +// internal static class StorageService +// { +// public static FilePickerFileType All { get; } = new("All") +// { +// Patterns = new[] { "*.*" }, +// MimeTypes = new[] { "*/*" } +// }; + +// public static FilePickerFileType Json { get; } = new("Json") +// { +// Patterns = new[] { "*.json" }, +// AppleUniformTypeIdentifiers = new[] { "public.json" }, +// MimeTypes = new[] { "application/json" } +// }; + +// public static FilePickerFileType CSharp { get; } = new("C#") +// { +// Patterns = new[] { "*.cs" }, +// AppleUniformTypeIdentifiers = new[] { "public.csharp-source" }, +// MimeTypes = new[] { "text/plain" } +// }; + +// public static FilePickerFileType ImagePng { get; } = new("PNG image") +// { +// Patterns = new[] { "*.png" }, +// AppleUniformTypeIdentifiers = new[] { "public.png" }, +// MimeTypes = new[] { "image/png" } +// }; + +// public static FilePickerFileType ImageJpg { get; } = new("JPEG image") +// { +// Patterns = new[] { "*.jpg", "*.jpeg" }, +// AppleUniformTypeIdentifiers = new[] { "public.jpeg" }, +// MimeTypes = new[] { "image/jpeg" } +// }; + +// public static FilePickerFileType ImageAll { get; } = new("All Images") +// { +// Patterns = new[] { "*.png", "*.jpg", "*.jpeg", "*.bmp" }, +// AppleUniformTypeIdentifiers = new[] { "public.image" }, +// MimeTypes = new[] { "image/*" } +// }; + +// public static FilePickerFileType ImageSvg { get; } = new("Svg") +// { +// Patterns = new[] { "*.svg" }, +// AppleUniformTypeIdentifiers = new[] { "public.svg-image" }, +// MimeTypes = new[] { "image/svg+xml" } +// }; + +// public static FilePickerFileType ImageSvgz { get; } = new("Svgz") +// { +// Patterns = new[] { "*.svgz" }, +// // TODO: +// AppleUniformTypeIdentifiers = new[] { "public.svg-image" }, +// // TODO: +// MimeTypes = new[] { "image/svg+xml" } +// }; + +// public static FilePickerFileType Xaml { get; } = new("Xaml") +// { +// Patterns = new[] { "*.xaml" }, +// // TODO: +// AppleUniformTypeIdentifiers = new[] { "public.xaml" }, +// // TODO: +// MimeTypes = new[] { "application/xaml" } +// }; + +// public static FilePickerFileType Axaml { get; } = new("Axaml") +// { +// Patterns = new[] { "*.axaml" }, +// // TODO: +// AppleUniformTypeIdentifiers = new[] { "public.axaml" }, +// // TODO: +// MimeTypes = new[] { "application/axaml" } +// }; + +// public static FilePickerFileType Pdf { get; } = new("PDF document") +// { +// Patterns = new[] { "*.pdf" }, +// AppleUniformTypeIdentifiers = new[] { "com.adobe.pdf" }, +// MimeTypes = new[] { "application/pdf" } +// }; + +// public static FilePickerFileType Xps { get; } = new("XPS document") +// { +// Patterns = new[] { "*.xps" }, +// AppleUniformTypeIdentifiers = new[] { "com.microsoft.xps" }, +// MimeTypes = new[] { "application/oxps", "application/vnd.ms-xpsdocument" } +// }; + +// public static IStorageProvider? GetStorageProvider() +// { +// if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow: { } window }) +// { +// return window.StorageProvider; +// } + +// if (Application.Current?.ApplicationLifetime is ISingleViewApplicationLifetime { MainView: { } mainView }) +// { +// var visualRoot = mainView.GetVisualRoot(); +// if (visualRoot is TopLevel topLevel) +// { +// return topLevel.StorageProvider; +// } +// } + +// return null; +// } +// } diff --git a/samples/TestApp/TestApp.csproj b/samples/TestApp/TestApp.csproj index e3b7c8dc9..a38813c57 100644 --- a/samples/TestApp/TestApp.csproj +++ b/samples/TestApp/TestApp.csproj @@ -27,4 +27,8 @@ + + + + diff --git a/samples/TestApp/ViewLocator.cs b/samples/TestApp/ViewLocator.cs index 4fe844b80..db0887c40 100644 --- a/samples/TestApp/ViewLocator.cs +++ b/samples/TestApp/ViewLocator.cs @@ -7,7 +7,7 @@ namespace TestApp; public class ViewLocator : IDataTemplate { - public Control Build(object? data) + public IControl Build(object? data) { var name = data?.GetType().FullName?.Replace("ViewModel", "View"); var type = name is null ? null : Type.GetType(name); diff --git a/samples/TestApp/ViewModels/MainWindowViewModel.cs b/samples/TestApp/ViewModels/MainWindowViewModel.cs index f44bae1df..42939729a 100644 --- a/samples/TestApp/ViewModels/MainWindowViewModel.cs +++ b/samples/TestApp/ViewModels/MainWindowViewModel.cs @@ -11,7 +11,7 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Platform.Storage; +// using Avalonia.Platform.Storage; using Avalonia.Threading; using DynamicData; using DynamicData.Binding; @@ -19,7 +19,7 @@ using Svg.CodeGen.Skia; using Svg.Skia; using TestApp.Models; -using TestApp.Services; +// using TestApp.Services; namespace TestApp.ViewModels; @@ -61,7 +61,7 @@ public ReadOnlyObservableCollection? FilteredItems public ICommand CopyAsCSharpCommand { get; } public ICommand ExportCommand { get; } - +/* private List GetConfigurationFileTypes() { return new List @@ -83,7 +83,7 @@ private static List GetExportFileTypes() StorageService.All }; } - +*/ public MainWindowViewModel() { _items = new ObservableCollection(); @@ -122,6 +122,7 @@ public MainWindowViewModel() private async Task ExportExecute(Avalonia.Svg.Skia.Svg svg) { + /* if (_selectedItem is null || svg.Model is null) { return; @@ -155,10 +156,12 @@ private async Task ExportExecute(Avalonia.Svg.Skia.Svg svg) Debug.WriteLine(ex.StackTrace); } } + */ } private async Task CopyAsCSharpExecute(Avalonia.Svg.Skia.Svg svg) { + /* if (_selectedItem is null || svg?.Model is null) { return; @@ -180,6 +183,7 @@ await Dispatcher.UIThread.InvokeAsync(() => // ignored } }); + */ } private async Task AddItemExecute() @@ -219,6 +223,7 @@ private void ClearConfigurationExecute() private async Task SaveConfigurationExecute() { + /* var storageProvider = StorageService.GetStorageProvider(); if (storageProvider is null) { @@ -247,10 +252,12 @@ private async Task SaveConfigurationExecute() Debug.WriteLine(ex.StackTrace); } } + */ } private async Task LoadConfigurationExecute() { + /* var storageProvider = StorageService.GetStorageProvider(); if (storageProvider is null) { @@ -279,6 +286,7 @@ private async Task LoadConfigurationExecute() Debug.WriteLine(ex.StackTrace); } } + */ } private Func ItemQueryFilter(string? searchQuery) diff --git a/samples/TestApp/Views/MainView.axaml b/samples/TestApp/Views/MainView.axaml index 46ea0f5b9..2edc92dea 100644 --- a/samples/TestApp/Views/MainView.axaml +++ b/samples/TestApp/Views/MainView.axaml @@ -28,7 +28,7 @@