From df4189ce0e97a8c5a25688e7c0860f95b73fd7ba Mon Sep 17 00:00:00 2001 From: Max Katz Date: Wed, 7 Feb 2024 00:04:11 -0800 Subject: [PATCH] Implement TopLevel.Launcher (#14320) * Implement ILauncher * Update dialogs page to include Launcher buttons * Fix control catalog * Add return comments --- samples/ControlCatalog/Pages/DialogsPage.xaml | 9 ++ .../ControlCatalog/Pages/DialogsPage.xaml.cs | 31 +++++++ .../Platform/AndroidLauncher.cs | 56 ++++++++++++ .../Platform/SkiaPlatform/TopLevelImpl.cs | 7 ++ .../Platform/Storage/FileIO/BclLauncher.cs | 90 +++++++++++++++++++ .../Platform/Storage/ILauncher.cs | 69 ++++++++++++++ src/Avalonia.Controls/TopLevel.cs | 3 +- .../AboutAvaloniaDialog.xaml.cs | 50 +---------- src/Avalonia.Native/WindowImplBase.cs | 6 ++ src/Avalonia.X11/X11Window.cs | 7 ++ .../Interop/NavigationHelper.cs | 3 + .../Storage/BrowserLauncher.cs | 28 ++++++ .../Avalonia.Tizen/Platform/Permissions.cs | 1 + .../Avalonia.Tizen/Platform/TizenLauncher.cs | 71 +++++++++++++++ src/Tizen/Avalonia.Tizen/TopLevelImpl.cs | 5 ++ src/Windows/Avalonia.Win32/WindowImpl.cs | 8 +- src/iOS/Avalonia.iOS/AvaloniaView.cs | 5 ++ src/iOS/Avalonia.iOS/IOSLauncher.cs | 45 ++++++++++ 18 files changed, 445 insertions(+), 49 deletions(-) create mode 100644 src/Android/Avalonia.Android/Platform/AndroidLauncher.cs create mode 100644 src/Avalonia.Base/Platform/Storage/FileIO/BclLauncher.cs create mode 100644 src/Avalonia.Base/Platform/Storage/ILauncher.cs create mode 100644 src/Browser/Avalonia.Browser/Storage/BrowserLauncher.cs create mode 100644 src/Tizen/Avalonia.Tizen/Platform/TizenLauncher.cs create mode 100644 src/iOS/Avalonia.iOS/IOSLauncher.cs diff --git a/samples/ControlCatalog/Pages/DialogsPage.xaml b/samples/ControlCatalog/Pages/DialogsPage.xaml index 2c1a774273e..60d991e324d 100644 --- a/samples/ControlCatalog/Pages/DialogsPage.xaml +++ b/samples/ControlCatalog/Pages/DialogsPage.xaml @@ -51,6 +51,15 @@ + + + + + + + + + diff --git a/samples/ControlCatalog/Pages/DialogsPage.xaml.cs b/samples/ControlCatalog/Pages/DialogsPage.xaml.cs index c92eaf3e0e2..a5423fab523 100644 --- a/samples/ControlCatalog/Pages/DialogsPage.xaml.cs +++ b/samples/ControlCatalog/Pages/DialogsPage.xaml.cs @@ -25,6 +25,7 @@ public DialogsPage() this.InitializeComponent(); IStorageFolder? lastSelectedDirectory = null; + IStorageItem? lastSelectedItem = null; bool ignoreTextChanged = false; var results = this.Get("PickerLastResults"); @@ -290,11 +291,40 @@ List GetFilters() await SetPickerResult(folder is null ? null : new[] { folder }); SetFolder(folder); }; + + this.Get