diff --git a/samples/ControlCatalog/DecoratedWindow.xaml b/samples/ControlCatalog/DecoratedWindow.xaml index 5251a2fa552..c778b31c427 100644 --- a/samples/ControlCatalog/DecoratedWindow.xaml +++ b/samples/ControlCatalog/DecoratedWindow.xaml @@ -2,7 +2,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="ControlCatalog.DecoratedWindow" Title="Avalonia Control Gallery" - xmlns:local="clr-namespace:ControlCatalog" HasSystemDecorations="False" Name="Window"> + xmlns:local="clr-namespace:ControlCatalog" SystemDecorations="None" Name="Window"> diff --git a/samples/ControlCatalog/MainWindow.xaml b/samples/ControlCatalog/MainWindow.xaml index 1e4bf2de388..d5513904c03 100644 --- a/samples/ControlCatalog/MainWindow.xaml +++ b/samples/ControlCatalog/MainWindow.xaml @@ -18,15 +18,15 @@ - - + + + Click="OnCloseClicked" /> diff --git a/samples/ControlCatalog/Pages/NumericUpDownPage.xaml b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml index 0e7351feb43..1f4d1e6018e 100644 --- a/samples/ControlCatalog/Pages/NumericUpDownPage.xaml +++ b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml @@ -54,11 +54,11 @@ Minimum: + NumberFormat="{Binding #upDown.NumberFormat}" VerticalAlignment="Center" Margin="2" HorizontalAlignment="Center"/> Maximum: + NumberFormat="{Binding #upDown.NumberFormat}" VerticalAlignment="Center" Margin="2" HorizontalAlignment="Center"/> Increment: - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + - - \ No newline at end of file + + diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml index a5a94a23225..0a1a9e60c68 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml @@ -11,15 +11,20 @@ Stretch="Uniform" DestinationRect="0,0,8,8"> - - - - - - + + + + + + + + + + + + diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Simple/Simple.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Simple/Simple.xaml index 1e507a91fe8..f21b03cee25 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Simple/Simple.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Simple/Simple.xaml @@ -11,15 +11,20 @@ Stretch="Uniform" DestinationRect="0,0,8,8"> - - - - - - + + + + + + + + + + + + diff --git a/src/Avalonia.Controls/DesktopApplicationExtensions.cs b/src/Avalonia.Controls/DesktopApplicationExtensions.cs index ddd4e57a40d..ddaed6bb0d7 100644 --- a/src/Avalonia.Controls/DesktopApplicationExtensions.cs +++ b/src/Avalonia.Controls/DesktopApplicationExtensions.cs @@ -8,8 +8,6 @@ namespace Avalonia.Controls { public static class DesktopApplicationExtensions { - [Obsolete("Running application without a cancellation token and a lifetime is no longer supported, see https://github.com/AvaloniaUI/Avalonia/wiki/Application-lifetimes for details", true)] - public static void Run(this Application app) => throw new NotSupportedException(); /// /// On desktop-style platforms runs the application's main loop until closable is closed diff --git a/src/Avalonia.Controls/DrawingPresenter.cs b/src/Avalonia.Controls/DrawingPresenter.cs deleted file mode 100644 index ee27aa7ec16..00000000000 --- a/src/Avalonia.Controls/DrawingPresenter.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using Avalonia.Controls.Shapes; -using Avalonia.Media; -using Avalonia.Metadata; - -namespace Avalonia.Controls -{ - [Obsolete("Use Image control with DrawingImage source")] - public class DrawingPresenter : Control - { - static DrawingPresenter() - { - AffectsMeasure(DrawingProperty); - AffectsRender(DrawingProperty); - } - - public static readonly StyledProperty DrawingProperty = - AvaloniaProperty.Register(nameof(Drawing)); - - public static readonly StyledProperty StretchProperty = - AvaloniaProperty.Register(nameof(Stretch), Stretch.Uniform); - - [Content] - public Drawing Drawing - { - get => GetValue(DrawingProperty); - set => SetValue(DrawingProperty, value); - } - - public Stretch Stretch - { - get => GetValue(StretchProperty); - set => SetValue(StretchProperty, value); - } - - private Matrix _transform = Matrix.Identity; - - protected override Size MeasureOverride(Size availableSize) - { - if (Drawing == null) return new Size(); - - var (size, transform) = Shape.CalculateSizeAndTransform(availableSize, Drawing.GetBounds(), Stretch); - - _transform = transform; - - return size; - } - - public override void Render(DrawingContext context) - { - if (Drawing != null) - { - using (context.PushPreTransform(_transform)) - using (context.PushClip(new Rect(Bounds.Size))) - { - Drawing.Draw(context); - } - } - } - } -} diff --git a/src/Avalonia.Controls/LoggingExtensions.cs b/src/Avalonia.Controls/LoggingExtensions.cs index 9eb3b140f69..ef14d0b4773 100644 --- a/src/Avalonia.Controls/LoggingExtensions.cs +++ b/src/Avalonia.Controls/LoggingExtensions.cs @@ -1,21 +1,10 @@ -using System; -using Avalonia.Controls; +using Avalonia.Controls; using Avalonia.Logging; namespace Avalonia { public static class LoggingExtensions { - [Obsolete("Use LogToTrace")] - public static T LogToDebug( - this T builder, - LogEventLevel level = LogEventLevel.Warning, - params string[] areas) - where T : AppBuilderBase, new() - { - return LogToTrace(builder, level, areas); - } - /// /// Logs Avalonia events to the sink. /// diff --git a/src/Avalonia.Controls/NativeMenuItem.cs b/src/Avalonia.Controls/NativeMenuItem.cs index 265e7119eb5..d22fdb2f842 100644 --- a/src/Avalonia.Controls/NativeMenuItem.cs +++ b/src/Avalonia.Controls/NativeMenuItem.cs @@ -186,13 +186,6 @@ public object? CommandParameter /// public event EventHandler? Click; - [Obsolete("Use Click event.")] - public event EventHandler Clicked - { - add => Click += value; - remove => Click -= value; - } - void INativeMenuItemExporterEventsImplBridge.RaiseClicked() { Click?.Invoke(this, new EventArgs()); diff --git a/src/Avalonia.Controls/NativeMenuItemSeparator.cs b/src/Avalonia.Controls/NativeMenuItemSeparator.cs index 49b36e714d7..97278130b1b 100644 --- a/src/Avalonia.Controls/NativeMenuItemSeparator.cs +++ b/src/Avalonia.Controls/NativeMenuItemSeparator.cs @@ -1,16 +1,7 @@ -using System; - -namespace Avalonia.Controls +namespace Avalonia.Controls { - - [Obsolete("This class exists to maintain backwards compatibility with existing code. Use NativeMenuItemSeparator instead")] - public class NativeMenuItemSeperator : NativeMenuItemSeparator - { - } - public class NativeMenuItemSeparator : NativeMenuItemBase { - [Obsolete("This is a temporary hack to make our MenuItem recognize this as a separator, don't use", true)] - public string Header => "-"; + } } diff --git a/src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs b/src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs index 705e68e3eaa..dc2b2cd7cc0 100644 --- a/src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs +++ b/src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs @@ -45,14 +45,6 @@ public class NumericUpDown : TemplatedControl AvaloniaProperty.RegisterDirect(nameof(ClipValueToMinMax), updown => updown.ClipValueToMinMax, (updown, b) => updown.ClipValueToMinMax = b); - /// - /// Defines the property. - /// - [Obsolete] - public static readonly DirectProperty CultureInfoProperty = - AvaloniaProperty.RegisterDirect(nameof(CultureInfo), o => o.CultureInfo, - (o, v) => o.CultureInfo = v, CultureInfo.CurrentCulture); - /// /// Defines the property. /// @@ -187,21 +179,6 @@ public bool ClipValueToMinMax set { SetAndRaise(ClipValueToMinMaxProperty, ref _clipValueToMinMax, value); } } - /// - /// Gets or sets the current CultureInfo. - /// - [Obsolete("CultureInfo is obsolete, please use NumberFormat instead.")] - public CultureInfo? CultureInfo - { - get { return _cultureInfo; } - set - { - SetAndRaise(CultureInfoProperty, ref _cultureInfo, value); - //Set and Raise the NumberFormatProperty when CultureInfo is changed. - SetAndRaise(NumberFormatProperty, ref _numberFormat, value?.NumberFormat); - } - } - /// /// Gets or sets the current NumberFormatInfo /// @@ -335,9 +312,6 @@ public NumericUpDown() /// static NumericUpDown() { -#pragma warning disable CS0612 // Type or member is obsolete - CultureInfoProperty.Changed.Subscribe(OnCultureInfoChanged); -#pragma warning restore CS0612 // Type or member is obsolete NumberFormatProperty.Changed.Subscribe(OnNumberFormatChanged); FormatStringProperty.Changed.Subscribe(FormatStringChanged); IncrementProperty.Changed.Subscribe(IncrementChanged); @@ -416,19 +390,6 @@ protected override void UpdateDataValidation( } } - /// - /// Called when the property value changed. - /// - /// The old value. - /// The new value. - protected virtual void OnCultureInfoChanged(CultureInfo? oldValue, CultureInfo? newValue) - { - if (IsInitialized) - { - SyncTextAndValueProperties(false, null); - } - } - /// /// Called when the property value changed. /// @@ -729,20 +690,6 @@ private void SetValidSpinDirection() } } - /// - /// Called when the property value changed. - /// - /// The event args. - private static void OnCultureInfoChanged(AvaloniaPropertyChangedEventArgs e) - { - if (e.Sender is NumericUpDown upDown) - { - var oldValue = (CultureInfo?)e.OldValue; - var newValue = (CultureInfo?)e.NewValue; - upDown.OnCultureInfoChanged(oldValue, newValue); - } - } - /// /// Called when the property value changed. /// diff --git a/src/Avalonia.Controls/Primitives/Popup.cs b/src/Avalonia.Controls/Primitives/Popup.cs index 468b743d9e5..f71a0c6f484 100644 --- a/src/Avalonia.Controls/Primitives/Popup.cs +++ b/src/Avalonia.Controls/Primitives/Popup.cs @@ -88,14 +88,6 @@ public class Popup : Control, IPopupHostProvider public static readonly StyledProperty PlacementTargetProperty = AvaloniaProperty.Register(nameof(PlacementTarget)); -#pragma warning disable 618 - /// - /// Defines the property. - /// - public static readonly StyledProperty ObeyScreenEdgesProperty = - AvaloniaProperty.Register(nameof(ObeyScreenEdges), true); -#pragma warning restore 618 - public static readonly StyledProperty OverlayDismissEventPassThroughProperty = AvaloniaProperty.Register(nameof(OverlayDismissEventPassThrough)); @@ -123,17 +115,6 @@ public class Popup : Control, IPopupHostProvider public static readonly StyledProperty VerticalOffsetProperty = AvaloniaProperty.Register(nameof(VerticalOffset)); - /// - /// Defines the property. - /// - [Obsolete("Use IsLightDismissEnabledProperty")] - public static readonly DirectProperty StaysOpenProperty = - AvaloniaProperty.RegisterDirect( - nameof(StaysOpen), - o => o.StaysOpen, - (o, v) => o.StaysOpen = v, - true); - /// /// Defines the property. /// @@ -299,13 +280,6 @@ public Control? PlacementTarget set { SetValue(PlacementTargetProperty, value); } } - [Obsolete("This property has no effect")] - public bool ObeyScreenEdges - { - get => GetValue(ObeyScreenEdgesProperty); - set => SetValue(ObeyScreenEdgesProperty, value); - } - /// /// Gets or sets a value indicating whether the event that closes the popup is passed /// through to the parent window. @@ -350,17 +324,6 @@ public double VerticalOffset set { SetValue(VerticalOffsetProperty, value); } } - /// - /// Gets or sets a value indicating whether the popup should stay open when the popup is - /// pressed or loses focus. - /// - [Obsolete("Use IsLightDismissEnabled")] - public bool StaysOpen - { - get => !IsLightDismissEnabled; - set => IsLightDismissEnabled = !value; - } - /// /// Gets or sets whether this popup appears on top of all other windows /// diff --git a/src/Avalonia.Controls/Primitives/TemplatedControl.cs b/src/Avalonia.Controls/Primitives/TemplatedControl.cs index dc52cc3ae20..2441da8920e 100644 --- a/src/Avalonia.Controls/Primitives/TemplatedControl.cs +++ b/src/Avalonia.Controls/Primitives/TemplatedControl.cs @@ -297,9 +297,6 @@ public sealed override void ApplyTemplate() var e = new TemplateAppliedEventArgs(nameScope); OnApplyTemplate(e); -#pragma warning disable CS0618 // Type or member is obsolete - OnTemplateApplied(e); -#pragma warning restore CS0618 // Type or member is obsolete RaiseEvent(e); } @@ -378,15 +375,6 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang } } - /// - /// Called when the control's template is applied. - /// - /// The event args. - [Obsolete("Use OnApplyTemplate")] - protected virtual void OnTemplateApplied(TemplateAppliedEventArgs e) - { - } - /// /// Called when the property changes. /// diff --git a/src/Avalonia.Controls/ProgressBar.cs b/src/Avalonia.Controls/ProgressBar.cs index 91114628ee5..1e406157d70 100644 --- a/src/Avalonia.Controls/ProgressBar.cs +++ b/src/Avalonia.Controls/ProgressBar.cs @@ -251,11 +251,9 @@ private void UpdateIndicator() TemplateProperties.Container2AnimationEndPosition = barIndicatorWidth2 * 1.66; // Position at 166% -#pragma warning disable CS0618 // Type or member is obsolete // Remove these properties when we switch to fluent as default and removed the old one. IndeterminateStartingOffset = -dim; IndeterminateEndingOffset = dim; -#pragma warning restore CS0618 // Type or member is obsolete var padding = Padding; var rectangle = new RectangleGeometry( diff --git a/src/Avalonia.Controls/RichTextBlock.cs b/src/Avalonia.Controls/RichTextBlock.cs index 1f8abbc30d0..3c902fa16a8 100644 --- a/src/Avalonia.Controls/RichTextBlock.cs +++ b/src/Avalonia.Controls/RichTextBlock.cs @@ -381,9 +381,7 @@ protected override void OnPointerPressed(PointerPressedEventArgs e) var hit = TextLayout.HitTestPoint(point); var index = hit.TextPosition; -#pragma warning disable CS0618 // Type or member is obsolete switch (e.ClickCount) -#pragma warning restore CS0618 // Type or member is obsolete { case 1: if (clickToSelect) diff --git a/src/Avalonia.Controls/SystemDialog.cs b/src/Avalonia.Controls/SystemDialog.cs index f3fb4d9a6d5..ee41b94b5ad 100644 --- a/src/Avalonia.Controls/SystemDialog.cs +++ b/src/Avalonia.Controls/SystemDialog.cs @@ -32,13 +32,6 @@ public abstract class FileDialog : FileSystemDialog [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] public abstract class FileSystemDialog : SystemDialog { - [Obsolete("Use Directory")] - public string? InitialDirectory - { - get => Directory; - set => Directory = value; - } - /// /// Gets or sets the initial directory that will be displayed when the file system dialog /// is opened. @@ -87,7 +80,7 @@ public FilePickerSaveOptions ToFilePickerSaveOptions() DefaultExtension = DefaultExtension, FileTypeChoices = Filters?.Select(f => new FilePickerFileType(f.Name!) { Patterns = f.Extensions.Select(e => $"*.{e}").ToArray() }).ToArray(), Title = Title, - SuggestedStartLocation = InitialDirectory is { } directory + SuggestedStartLocation = Directory is { } directory ? new BclStorageFolder(new System.IO.DirectoryInfo(directory)) : null, ShowOverwritePrompt = ShowOverwritePrompt @@ -129,7 +122,7 @@ public FilePickerOpenOptions ToFilePickerOpenOptions() AllowMultiple = AllowMultiple, FileTypeFilter = Filters?.Select(f => new FilePickerFileType(f.Name!) { Patterns = f.Extensions.Select(e => $"*.{e}").ToArray() }).ToArray(), Title = Title, - SuggestedStartLocation = InitialDirectory is { } directory + SuggestedStartLocation = Directory is { } directory ? new BclStorageFolder(new System.IO.DirectoryInfo(directory)) : null }; @@ -142,13 +135,6 @@ public FilePickerOpenOptions ToFilePickerOpenOptions() [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] public class OpenFolderDialog : FileSystemDialog { - [Obsolete("Use Directory")] - public string? DefaultDirectory - { - get => Directory; - set => Directory = value; - } - /// /// Shows the open folder dialog. /// @@ -170,7 +156,7 @@ public FolderPickerOpenOptions ToFolderPickerOpenOptions() return new FolderPickerOpenOptions { Title = Title, - SuggestedStartLocation = InitialDirectory is { } directory + SuggestedStartLocation = Directory is { } directory ? new BclStorageFolder(new System.IO.DirectoryInfo(directory)) : null }; diff --git a/src/Avalonia.Controls/TextBox.cs b/src/Avalonia.Controls/TextBox.cs index 4c9e9327d45..d53302ef224 100644 --- a/src/Avalonia.Controls/TextBox.cs +++ b/src/Avalonia.Controls/TextBox.cs @@ -1165,9 +1165,7 @@ protected override void OnPointerPressed(PointerPressedEventArgs e) SetAndRaise(CaretIndexProperty, ref _caretIndex, index); -#pragma warning disable CS0618 // Type or member is obsolete switch (e.ClickCount) -#pragma warning restore CS0618 // Type or member is obsolete { case 1: if (clickToSelect) diff --git a/src/Avalonia.Controls/TopLevel.cs b/src/Avalonia.Controls/TopLevel.cs index 1c1df844312..47fc9d79882 100644 --- a/src/Avalonia.Controls/TopLevel.cs +++ b/src/Avalonia.Controls/TopLevel.cs @@ -404,9 +404,6 @@ protected virtual void HandleClosed() LayoutManager?.Dispose(); } - [Obsolete("Use HandleResized(Size, PlatformResizeReason)")] - protected virtual void HandleResized(Size clientSize) => HandleResized(clientSize, PlatformResizeReason.Unspecified); - /// /// Handles a resize notification from . /// diff --git a/src/Avalonia.Controls/Window.cs b/src/Avalonia.Controls/Window.cs index 9b4bb51acaf..1f3b10c0cc3 100644 --- a/src/Avalonia.Controls/Window.cs +++ b/src/Avalonia.Controls/Window.cs @@ -79,16 +79,6 @@ public class Window : WindowBase, IStyleable, IFocusScope, ILayoutRoot public static readonly StyledProperty SizeToContentProperty = AvaloniaProperty.Register(nameof(SizeToContent)); - /// - /// Enables or disables system window decorations (title bar, buttons, etc) - /// - [Obsolete("Use SystemDecorationsProperty instead")] - public static readonly DirectProperty HasSystemDecorationsProperty = - AvaloniaProperty.RegisterDirect( - nameof(HasSystemDecorations), - o => o.HasSystemDecorations, - (o, v) => o.HasSystemDecorations = v); - /// /// Defines the property. /// @@ -289,25 +279,6 @@ public string? Title set { SetValue(TitleProperty, value); } } - /// - /// Enables or disables system window decorations (title bar, buttons, etc) - /// - [Obsolete("Use SystemDecorations instead")] - public bool HasSystemDecorations - { - get => SystemDecorations == SystemDecorations.Full; - set - { - var oldValue = HasSystemDecorations; - - if (oldValue != value) - { - SystemDecorations = value ? SystemDecorations.Full : SystemDecorations.None; - RaisePropertyChanged(HasSystemDecorationsProperty, oldValue, value); - } - } - } - /// /// Gets or sets if the ClientArea is Extended into the Window Decorations (chrome or border). /// @@ -985,9 +956,6 @@ protected sealed override void HandleClosed() Owner = null; } - [Obsolete("Use HandleResized(Size, PlatformResizeReason)")] - protected sealed override void HandleResized(Size clientSize) => HandleResized(clientSize, PlatformResizeReason.Unspecified); - /// protected sealed override void HandleResized(Size clientSize, PlatformResizeReason reason) { @@ -1033,19 +1001,9 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang base.OnPropertyChanged(change); if (change.Property == SystemDecorationsProperty) { - var (typedOldValue, typedNewValue) = change.GetOldAndNewValue(); + var (_, typedNewValue) = change.GetOldAndNewValue(); PlatformImpl?.SetSystemDecorations(typedNewValue); - - var o = typedOldValue == SystemDecorations.Full; - var n = typedNewValue == SystemDecorations.Full; - - if (o != n) - { -#pragma warning disable CS0618 // Type or member is obsolete - RaisePropertyChanged(HasSystemDecorationsProperty, o, n); -#pragma warning restore CS0618 // Type or member is obsolete - } } } diff --git a/src/Avalonia.Controls/WindowBase.cs b/src/Avalonia.Controls/WindowBase.cs index cb68c1f6e10..89483cd566d 100644 --- a/src/Avalonia.Controls/WindowBase.cs +++ b/src/Avalonia.Controls/WindowBase.cs @@ -94,9 +94,6 @@ public bool IsActive public Screens Screens { get; private set; } - [Obsolete("No longer used. Always returns false.")] - protected bool AutoSizing => false; - /// /// Gets or sets the owner of the window. /// @@ -169,9 +166,6 @@ public virtual void Show() } } - [Obsolete("No longer used. Has no effect.")] - protected IDisposable BeginAutoSizing() => Disposable.Empty; - /// /// Ensures that the window is initialized. /// @@ -226,9 +220,6 @@ protected override void HandleClosed() } } - [Obsolete("Use HandleResized(Size, PlatformResizeReason)")] - protected override void HandleResized(Size clientSize) => HandleResized(clientSize, PlatformResizeReason.Unspecified); - /// /// Handles a resize notification from . /// diff --git a/src/Avalonia.Diagnostics/Diagnostics/Screenshots/FilePickerHandler.cs b/src/Avalonia.Diagnostics/Diagnostics/Screenshots/FilePickerHandler.cs index fb57058ae95..4153d2d38c8 100644 --- a/src/Avalonia.Diagnostics/Diagnostics/Screenshots/FilePickerHandler.cs +++ b/src/Avalonia.Diagnostics/Diagnostics/Screenshots/FilePickerHandler.cs @@ -3,6 +3,8 @@ using System.Linq; using System.Threading.Tasks; using Avalonia.Controls; +using Avalonia.Platform.Storage; +using Avalonia.Platform.Storage.FileIO; using Lifetimes = Avalonia.Controls.ApplicationLifetimes; namespace Avalonia.Diagnostics.Screenshots @@ -59,24 +61,25 @@ Window GetWindow(IControl control) protected async override Task GetStream(IControl control) { Stream? output = default; - var result = await new SaveFileDialog() + var result = await GetWindow(control).StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions { + SuggestedStartLocation = new BclStorageFolder(new DirectoryInfo(ScreenshotsRoot)), Title = Title, - Filters = new() { new FileDialogFilter() { Name = "PNG", Extensions = new() { "png" } } }, - Directory = ScreenshotsRoot, - }.ShowAsync(GetWindow(control)); - if (!string.IsNullOrWhiteSpace(result)) + FileTypeChoices = new FilePickerFileType[] { new FilePickerFileType("PNG") { Patterns = new string[] { "*.png" } } } + }); + + if (result!=null && !string.IsNullOrWhiteSpace(result.Name)) { - var foldler = Path.GetDirectoryName(result); + var folder = Path.GetDirectoryName(result.Name); // Directory information for path, or null if path denotes a root directory or is // null. Returns System.String.Empty if path does not contain directory information. - if (!string.IsNullOrWhiteSpace(foldler)) + if (!string.IsNullOrWhiteSpace(folder)) { - if (!Directory.Exists(foldler)) + if (!Directory.Exists(folder)) { - Directory.CreateDirectory(foldler); + Directory.CreateDirectory(folder); } - output = new FileStream(result, FileMode.Create); + output = new FileStream(result.Name, FileMode.Create); } } return output; diff --git a/src/Avalonia.Dialogs/AboutAvaloniaDialog.xaml b/src/Avalonia.Dialogs/AboutAvaloniaDialog.xaml index a1d06f800f7..65df347ee25 100644 --- a/src/Avalonia.Dialogs/AboutAvaloniaDialog.xaml +++ b/src/Avalonia.Dialogs/AboutAvaloniaDialog.xaml @@ -76,7 +76,11 @@ - + + + + + diff --git a/src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml b/src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml index 55f48930579..b8ade96b6f8 100644 --- a/src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml +++ b/src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml @@ -138,7 +138,11 @@ - + + + + + @@ -231,7 +235,11 @@ - + + + + + diff --git a/src/Avalonia.Themes.Simple/Controls/CalendarDatePicker.xaml b/src/Avalonia.Themes.Simple/Controls/CalendarDatePicker.xaml index 43fc8c7a349..724c317beb4 100644 --- a/src/Avalonia.Themes.Simple/Controls/CalendarDatePicker.xaml +++ b/src/Avalonia.Themes.Simple/Controls/CalendarDatePicker.xaml @@ -118,7 +118,7 @@ + IsLightDismissEnabled="False">