From 4ab158372ac2ea9be1f18617bb9354f4f4f8e986 Mon Sep 17 00:00:00 2001 From: Tom Laird-McConnell Date: Sun, 24 Nov 2024 21:17:39 -0600 Subject: [PATCH] cleanup sample --- .../GalleryViews/GalleryStorage.axaml.cs | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/src/Consolonia.Gallery/Gallery/GalleryViews/GalleryStorage.axaml.cs b/src/Consolonia.Gallery/Gallery/GalleryViews/GalleryStorage.axaml.cs index 74c6fa7..38d1ae0 100644 --- a/src/Consolonia.Gallery/Gallery/GalleryViews/GalleryStorage.axaml.cs +++ b/src/Consolonia.Gallery/Gallery/GalleryViews/GalleryStorage.axaml.cs @@ -59,22 +59,10 @@ private async Task OpenFiles(string title, bool allowMultiple) SuggestedStartLocation = new SystemStorageFolder(new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))), FileTypeFilter = new List() { - new FilePickerFileType("All files") - { - Patterns = new List() { "*" } - }, - new FilePickerFileType("Text") - { - Patterns = new List() { "*.txt" } - }, - new FilePickerFileType("Comma Delimited Files") - { - Patterns = new List() { "*.csv" } - }, - new FilePickerFileType("PDF") - { - Patterns = new List() { "*.pdf" } - } + new FilePickerFileType("All files") { Patterns = new[] { "*" } }, + new FilePickerFileType("Text") { Patterns = new[] { "*.txt" } }, + new FilePickerFileType("Comma Delimited Files") { Patterns = new[] { "*.csv" } }, + new FilePickerFileType("PDF") { Patterns = new[] { "*.pdf" } } }, }); @@ -128,14 +116,9 @@ private async void OnSaveFile(object sender, Avalonia.Interactivity.RoutedEventA SuggestedFileName = "NewFile.txt", FileTypeChoices = new List() { - new FilePickerFileType("Text") - { - Patterns = new List() { "*.txt" } - }, - new FilePickerFileType("Comma delimited values") - { - Patterns = new List() { "*.csv" } - }, + new FilePickerFileType("Text") { Patterns = new[] { "*.txt" } }, + new FilePickerFileType("Comma Delimited Files") { Patterns = new[] { "*.csv" } }, + new FilePickerFileType("PDF") { Patterns = new[] { "*.pdf" } } }, });