Browse Source

Merge pull request #8732 from AvaloniaUI/remove-obsolete-members-from-avalonia.controls-namespace

Remove obsolete members from Avalonia.Controls assembly.
pull/8757/head
Tako 4 years ago
committed by GitHub
parent
commit
1f2aef4873
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      samples/ControlCatalog/DecoratedWindow.xaml
  2. 6
      samples/ControlCatalog/MainWindow.xaml
  3. 4
      samples/ControlCatalog/Pages/NumericUpDownPage.xaml
  4. 8
      samples/ControlCatalog/ViewModels/ContextPageViewModel.cs
  5. 7
      samples/ControlCatalog/ViewModels/MenuPageViewModel.cs
  6. 265
      samples/RenderDemo/Pages/DrawingPage.xaml
  7. 23
      src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml
  8. 23
      src/Avalonia.Controls.ColorPicker/Themes/Simple/Simple.xaml
  9. 2
      src/Avalonia.Controls/DesktopApplicationExtensions.cs
  10. 61
      src/Avalonia.Controls/DrawingPresenter.cs
  11. 13
      src/Avalonia.Controls/LoggingExtensions.cs
  12. 7
      src/Avalonia.Controls/NativeMenuItem.cs
  13. 13
      src/Avalonia.Controls/NativeMenuItemSeparator.cs
  14. 53
      src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs
  15. 37
      src/Avalonia.Controls/Primitives/Popup.cs
  16. 12
      src/Avalonia.Controls/Primitives/TemplatedControl.cs
  17. 2
      src/Avalonia.Controls/ProgressBar.cs
  18. 2
      src/Avalonia.Controls/RichTextBlock.cs
  19. 20
      src/Avalonia.Controls/SystemDialog.cs
  20. 2
      src/Avalonia.Controls/TextBox.cs
  21. 3
      src/Avalonia.Controls/TopLevel.cs
  22. 44
      src/Avalonia.Controls/Window.cs
  23. 9
      src/Avalonia.Controls/WindowBase.cs
  24. 23
      src/Avalonia.Diagnostics/Diagnostics/Screenshots/FilePickerHandler.cs
  25. 6
      src/Avalonia.Dialogs/AboutAvaloniaDialog.xaml
  26. 12
      src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml
  27. 2
      src/Avalonia.Themes.Simple/Controls/CalendarDatePicker.xaml

2
samples/ControlCatalog/DecoratedWindow.xaml

@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ControlCatalog.DecoratedWindow" x:Class="ControlCatalog.DecoratedWindow"
Title="Avalonia Control Gallery" Title="Avalonia Control Gallery"
xmlns:local="clr-namespace:ControlCatalog" HasSystemDecorations="False" Name="Window"> xmlns:local="clr-namespace:ControlCatalog" SystemDecorations="None" Name="Window">
<NativeMenu.Menu> <NativeMenu.Menu>
<NativeMenu> <NativeMenu>
<NativeMenuItem Header="Decorated"> <NativeMenuItem Header="Decorated">

6
samples/ControlCatalog/MainWindow.xaml

@ -18,15 +18,15 @@
<NativeMenu> <NativeMenu>
<NativeMenuItem Header="File"> <NativeMenuItem Header="File">
<NativeMenu> <NativeMenu>
<NativeMenuItem Icon="/Assets/test_icon.ico" Header="Open" Clicked="OnOpenClicked" Gesture="Ctrl+O"/> <NativeMenuItem Icon="/Assets/test_icon.ico" Header="Open" Click="OnOpenClicked" Gesture="Ctrl+O"/>
<NativeMenuItemSeperator/><!-- Uses incorrect spelling to demonstrate backwards compatibility --> <NativeMenuItemSeparator/>
<NativeMenuItem Icon="/Assets/github_icon.png" Header="Recent"> <NativeMenuItem Icon="/Assets/github_icon.png" Header="Recent">
<NativeMenu/> <NativeMenu/>
</NativeMenuItem> </NativeMenuItem>
<NativeMenuItemSeparator/> <NativeMenuItemSeparator/>
<NativeMenuItem Header="{x:Static local:MainWindow.MenuQuitHeader}" <NativeMenuItem Header="{x:Static local:MainWindow.MenuQuitHeader}"
Gesture="{x:Static local:MainWindow.MenuQuitGesture}" Gesture="{x:Static local:MainWindow.MenuQuitGesture}"
Clicked="OnCloseClicked" /> Click="OnCloseClicked" />
</NativeMenu> </NativeMenu>
</NativeMenuItem> </NativeMenuItem>
<NativeMenuItem Header="Edit"> <NativeMenuItem Header="Edit">

4
samples/ControlCatalog/Pages/NumericUpDownPage.xaml

@ -54,11 +54,11 @@
<Grid Grid.Row="0" Grid.Column="2" Margin="8" RowDefinitions="Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="Auto, Auto"> <Grid Grid.Row="0" Grid.Column="2" Margin="8" RowDefinitions="Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="Auto, Auto">
<TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Minimum:</TextBlock> <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Minimum:</TextBlock>
<NumericUpDown Grid.Row="0" Grid.Column="1" Value="{Binding #upDown.Minimum}" <NumericUpDown Grid.Row="0" Grid.Column="1" Value="{Binding #upDown.Minimum}"
CultureInfo="{Binding #upDown.CultureInfo}" VerticalAlignment="Center" Margin="2" HorizontalAlignment="Center"/> NumberFormat="{Binding #upDown.NumberFormat}" VerticalAlignment="Center" Margin="2" HorizontalAlignment="Center"/>
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Maximum:</TextBlock> <TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Maximum:</TextBlock>
<NumericUpDown Grid.Row="1" Grid.Column="1" Value="{Binding #upDown.Maximum}" <NumericUpDown Grid.Row="1" Grid.Column="1" Value="{Binding #upDown.Maximum}"
CultureInfo="{Binding #upDown.CultureInfo}" VerticalAlignment="Center" Margin="2" HorizontalAlignment="Center"/> NumberFormat="{Binding #upDown.NumberFormat}" VerticalAlignment="Center" Margin="2" HorizontalAlignment="Center"/>
<TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Increment:</TextBlock> <TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Increment:</TextBlock>
<NumericUpDown Grid.Row="2" Grid.Column="1" Value="{Binding #upDown.Increment}" VerticalAlignment="Center" <NumericUpDown Grid.Row="2" Grid.Column="1" Value="{Binding #upDown.Increment}" VerticalAlignment="Center"

8
samples/ControlCatalog/ViewModels/ContextPageViewModel.cs

@ -53,14 +53,14 @@ namespace ControlCatalog.ViewModels
var window = View?.GetVisualRoot() as Window; var window = View?.GetVisualRoot() as Window;
if (window == null) if (window == null)
return; return;
var dialog = new OpenFileDialog();
var result = await dialog.ShowAsync(window); var result = await window.StorageProvider.OpenFilePickerAsync(new Avalonia.Platform.Storage.FilePickerOpenOptions() { AllowMultiple = true });
if (result != null) if (result != null)
{ {
foreach (var path in result) foreach (var file in result)
{ {
System.Diagnostics.Debug.WriteLine($"Opened: {path}"); System.Diagnostics.Debug.WriteLine($"Opened: {file.Name}");
} }
} }
} }

7
samples/ControlCatalog/ViewModels/MenuPageViewModel.cs

@ -74,14 +74,13 @@ namespace ControlCatalog.ViewModels
var window = View?.GetVisualRoot() as Window; var window = View?.GetVisualRoot() as Window;
if (window == null) if (window == null)
return; return;
var dialog = new OpenFileDialog(); var result = await window.StorageProvider.OpenFilePickerAsync(new Avalonia.Platform.Storage.FilePickerOpenOptions() { AllowMultiple = true });
var result = await dialog.ShowAsync(window);
if (result != null) if (result != null)
{ {
foreach (var path in result) foreach (var file in result)
{ {
System.Diagnostics.Debug.WriteLine($"Opened: {path}"); System.Diagnostics.Debug.WriteLine($"Opened: {file.Name}");
} }
} }
} }

265
samples/RenderDemo/Pages/DrawingPage.xaml

@ -1,134 +1,141 @@
<UserControl <UserControl
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="RenderDemo.Pages.DrawingPage"> x:Class="RenderDemo.Pages.DrawingPage">
<UserControl.Styles> <UserControl.Styles>
<Style> <Style>
<Style.Resources> <Style.Resources>
<DrawingGroup x:Key="Bulb"> <DrawingGroup x:Key="Bulb">
<DrawingGroup.Transform> <DrawingGroup.Transform>
<MatrixTransform Matrix="1,0,0,1,0,-1028.4" /> <MatrixTransform Matrix="1,0,0,1,0,-1028.4" />
</DrawingGroup.Transform> </DrawingGroup.Transform>
<DrawingGroup> <DrawingGroup>
<DrawingGroup.Transform> <DrawingGroup.Transform>
<MatrixTransform Matrix="1,0,0,1.25,-10,1031.4" /> <MatrixTransform Matrix="1,0,0,1.25,-10,1031.4" />
</DrawingGroup.Transform> </DrawingGroup.Transform>
<GeometryDrawing Brush="#FF7F8C8D" <GeometryDrawing Brush="#FF7F8C8D"
Geometry="F1 M24,14 A2,2,0,1,1,20,14 A2,2,0,1,1,24,14 z" /> Geometry="F1 M24,14 A2,2,0,1,1,20,14 A2,2,0,1,1,24,14 z" />
</DrawingGroup> </DrawingGroup>
<GeometryDrawing Brush="#FFF39C12" <GeometryDrawing Brush="#FFF39C12"
Geometry="F1 M12,1030.4 C8.134,1030.4 5,1033.6 5,1037.6 5,1040.7 8.125,1043.5 9,1045.4 9.875,1047.2 9,1050.4 9,1050.4 L12,1049.9 15,1050.4 C15,1050.4 14.125,1047.2 15,1045.4 15.875,1043.5 19,1040.7 19,1037.6 19,1033.6 15.866,1030.4 12,1030.4 z" /> Geometry="F1 M12,1030.4 C8.134,1030.4 5,1033.6 5,1037.6 5,1040.7 8.125,1043.5 9,1045.4 9.875,1047.2 9,1050.4 9,1050.4 L12,1049.9 15,1050.4 C15,1050.4 14.125,1047.2 15,1045.4 15.875,1043.5 19,1040.7 19,1037.6 19,1033.6 15.866,1030.4 12,1030.4 z" />
<GeometryDrawing Brush="#FFF1C40F" <GeometryDrawing Brush="#FFF1C40F"
Geometry="F1 M12,1030.4 C15.866,1030.4 19,1033.6 19,1037.6 19,1040.7 15.875,1043.5 15,1045.4 14.125,1047.2 15,1050.4 15,1050.4 L12,1049.9 12,1030.4 z" /> Geometry="F1 M12,1030.4 C15.866,1030.4 19,1033.6 19,1037.6 19,1040.7 15.875,1043.5 15,1045.4 14.125,1047.2 15,1050.4 15,1050.4 L12,1049.9 12,1030.4 z" />
<GeometryDrawing Brush="#FFE67E22" <GeometryDrawing Brush="#FFE67E22"
Geometry="F1 M9,1036.4 L8,1037.4 12,1049.4 16,1037.4 15,1036.4 14,1037.4 13,1036.4 12,1037.4 11,1036.4 10,1037.4 9,1036.4 z M9,1037.4 L10,1038.4 10.5,1037.9 11,1037.4 11.5,1037.9 12,1038.4 12.5,1037.9 13,1037.4 13.5,1037.9 14,1038.4 15,1037.4 15.438,1037.8 12,1048.1 8.5625,1037.8 9,1037.4 z" /> Geometry="F1 M9,1036.4 L8,1037.4 12,1049.4 16,1037.4 15,1036.4 14,1037.4 13,1036.4 12,1037.4 11,1036.4 10,1037.4 9,1036.4 z M9,1037.4 L10,1038.4 10.5,1037.9 11,1037.4 11.5,1037.9 12,1038.4 12.5,1037.9 13,1037.4 13.5,1037.9 14,1038.4 15,1037.4 15.438,1037.8 12,1048.1 8.5625,1037.8 9,1037.4 z" />
<DrawingGroup> <DrawingGroup>
<DrawingGroup.Transform> <DrawingGroup.Transform>
<MatrixTransform Matrix="1,0,0,1,9,1045.4" /> <MatrixTransform Matrix="1,0,0,1,9,1045.4" />
</DrawingGroup.Transform> </DrawingGroup.Transform>
<GeometryDrawing Brush="#FFBDC3C7"> <GeometryDrawing Brush="#FFBDC3C7">
<GeometryDrawing.Geometry> <GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,6,5" /> <RectangleGeometry Rect="0,0,6,5" />
</GeometryDrawing.Geometry> </GeometryDrawing.Geometry>
</GeometryDrawing> </GeometryDrawing>
</DrawingGroup> </DrawingGroup>
<GeometryDrawing Brush="#FF95A5A6" <GeometryDrawing Brush="#FF95A5A6"
Geometry="F1 M9,1045.4 L9,1050.4 12,1050.4 12,1049.4 15,1049.4 15,1048.4 12,1048.4 12,1047.4 15,1047.4 15,1046.4 12,1046.4 12,1045.4 9,1045.4 z" /> Geometry="F1 M9,1045.4 L9,1050.4 12,1050.4 12,1049.4 15,1049.4 15,1048.4 12,1048.4 12,1047.4 15,1047.4 15,1046.4 12,1046.4 12,1045.4 9,1045.4 z" />
<GeometryDrawing Brush="#FF7F8C8D" <GeometryDrawing Brush="#FF7F8C8D"
Geometry="F1 M9,1046.4 L9,1047.4 12,1047.4 12,1046.4 9,1046.4 z M9,1048.4 L9,1049.4 12,1049.4 12,1048.4 9,1048.4 z" /> Geometry="F1 M9,1046.4 L9,1047.4 12,1047.4 12,1046.4 9,1046.4 z M9,1048.4 L9,1049.4 12,1049.4 12,1048.4 9,1048.4 z" />
</DrawingGroup> </DrawingGroup>
</Style.Resources> </Style.Resources>
</Style> </Style>
</UserControl.Styles> </UserControl.Styles>
<Grid RowDefinitions="Auto,Auto,Auto" <Grid RowDefinitions="Auto,Auto,Auto"
ColumnDefinitions="Auto,Auto,Auto,Auto"> ColumnDefinitions="Auto,Auto,Auto,Auto">
<TextBlock Text="None" <TextBlock Text="None"
Margin="3" /> Margin="3" />
<Border Grid.Column="0" <Border Grid.Column="0"
Grid.Row="1" Grid.Row="1"
VerticalAlignment="Top" VerticalAlignment="Top"
HorizontalAlignment="Left" HorizontalAlignment="Left"
BorderThickness="1" BorderThickness="1"
BorderBrush="Gray" BorderBrush="Gray"
Margin="5"> Margin="5">
<DrawingPresenter Drawing="{DynamicResource Bulb}" /> <Image>
</Border> <Image.Source>
<TextBlock Text="Fill" <DrawingImage Drawing="{DynamicResource Bulb}" />
Margin="3" </Image.Source>
Grid.Column="1" /> </Image>
<Border Grid.Column="1" </Border>
Grid.Row="1" <TextBlock Text="Fill"
VerticalAlignment="Top" Margin="3"
HorizontalAlignment="Left" Grid.Column="1" />
BorderThickness="1" <Border Grid.Column="1"
BorderBrush="Gray" Grid.Row="1"
Margin="5"> VerticalAlignment="Top"
<DrawingPresenter Drawing="{DynamicResource Bulb}" HorizontalAlignment="Left"
Width="100" BorderThickness="1"
Height="50" BorderBrush="Gray"
Stretch="Fill" /> Margin="5">
</Border> <Image Width="100" Height="50" Stretch="Fill">
<TextBlock Text="Uniform" <Image.Source>
Margin="3" <DrawingImage Drawing="{DynamicResource Bulb}" />
Grid.Column="2" /> </Image.Source>
<Border Grid.Column="2" </Image>
Grid.Row="1" </Border>
VerticalAlignment="Top" <TextBlock Text="Uniform"
HorizontalAlignment="Left" Margin="3"
BorderThickness="1" Grid.Column="2" />
BorderBrush="Gray" <Border Grid.Column="2"
Margin="5"> Grid.Row="1"
<DrawingPresenter Drawing="{DynamicResource Bulb}" VerticalAlignment="Top"
Width="100" HorizontalAlignment="Left"
Height="50" BorderThickness="1"
Stretch="Uniform" /> BorderBrush="Gray"
</Border> Margin="5">
<TextBlock Text="UniformToFill" <Image Width="100" Height="50" Stretch="Uniform">
Margin="3" <Image.Source>
Grid.Column="3" /> <DrawingImage Drawing="{DynamicResource Bulb}" />
<Border Grid.Column="3" </Image.Source>
Grid.Row="1" </Image>
VerticalAlignment="Top" </Border>
HorizontalAlignment="Left" <TextBlock Text="UniformToFill"
BorderThickness="1" Margin="3"
BorderBrush="Gray" Grid.Column="3" />
Margin="5"> <Border Grid.Column="3"
<DrawingPresenter Drawing="{DynamicResource Bulb}" Grid.Row="1"
Width="100" VerticalAlignment="Top"
Height="50" HorizontalAlignment="Left"
Stretch="UniformToFill" /> BorderThickness="1"
</Border> BorderBrush="Gray"
Margin="5">
<Image Width="100" Height="50" Stretch="UniformToFill">
<Image.Source>
<DrawingImage Drawing="{DynamicResource Bulb}" />
</Image.Source>
</Image>
</Border>
<!-- For comparison --> <!-- For comparison -->
<Ellipse Grid.Row="2" <Ellipse Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Width="100" Width="100"
Height="50" Height="50"
Stretch="None" Stretch="None"
Fill="Blue" Fill="Blue"
Margin="5"/> Margin="5"/>
<Ellipse Grid.Row="2" <Ellipse Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Height="50" Height="50"
Stretch="Fill" Stretch="Fill"
Fill="Blue" Fill="Blue"
Margin="5" /> Margin="5" />
<Ellipse Grid.Row="2" <Ellipse Grid.Row="2"
Grid.Column="2" Grid.Column="2"
Width="100" Width="100"
Height="50" Height="50"
Stretch="Uniform" Stretch="Uniform"
Fill="Blue" Fill="Blue"
Margin="5" /> Margin="5" />
<Ellipse Grid.Row="2" <Ellipse Grid.Row="2"
Grid.Column="3" Grid.Column="3"
Width="100" Width="100"
Height="50" Height="50"
Stretch="UniformToFill" Stretch="UniformToFill"
Fill="Blue" Fill="Blue"
Margin="5" /> Margin="5" />
</Grid> </Grid>
</UserControl> </UserControl>

23
src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml

@ -11,15 +11,20 @@
Stretch="Uniform" Stretch="Uniform"
DestinationRect="0,0,8,8"> DestinationRect="0,0,8,8">
<VisualBrush.Visual> <VisualBrush.Visual>
<DrawingPresenter Width="8" <Image Width="8" Height="8">
Height="8"> <Image.Source>
<DrawingGroup> <DrawingImage>
<GeometryDrawing Geometry="M0,0 L2,0 2,2, 0,2Z" <DrawingImage.Drawing>
Brush="Transparent" /> <DrawingGroup>
<GeometryDrawing Geometry="M0,1 L2,1 2,2, 1,2 1,0 0,0Z" <GeometryDrawing Geometry="M0,0 L2,0 2,2, 0,2Z"
Brush="#19808080" /> Brush="Transparent" />
</DrawingGroup> <GeometryDrawing Geometry="M0,1 L2,1 2,2, 1,2 1,0 0,0Z"
</DrawingPresenter> Brush="#19808080" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</VisualBrush.Visual> </VisualBrush.Visual>
</VisualBrush> </VisualBrush>

23
src/Avalonia.Controls.ColorPicker/Themes/Simple/Simple.xaml

@ -11,15 +11,20 @@
Stretch="Uniform" Stretch="Uniform"
DestinationRect="0,0,8,8"> DestinationRect="0,0,8,8">
<VisualBrush.Visual> <VisualBrush.Visual>
<DrawingPresenter Width="8" <Image Width="8" Height="8">
Height="8"> <Image.Source>
<DrawingGroup> <DrawingImage>
<GeometryDrawing Geometry="M0,0 L2,0 2,2, 0,2Z" <DrawingImage.Drawing>
Brush="Transparent" /> <DrawingGroup>
<GeometryDrawing Geometry="M0,1 L2,1 2,2, 1,2 1,0 0,0Z" <GeometryDrawing Geometry="M0,0 L2,0 2,2, 0,2Z"
Brush="#19808080" /> Brush="Transparent" />
</DrawingGroup> <GeometryDrawing Geometry="M0,1 L2,1 2,2, 1,2 1,0 0,0Z"
</DrawingPresenter> Brush="#19808080" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</VisualBrush.Visual> </VisualBrush.Visual>
</VisualBrush> </VisualBrush>

2
src/Avalonia.Controls/DesktopApplicationExtensions.cs

@ -8,8 +8,6 @@ namespace Avalonia.Controls
{ {
public static class DesktopApplicationExtensions 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();
/// <summary> /// <summary>
/// On desktop-style platforms runs the application's main loop until closable is closed /// On desktop-style platforms runs the application's main loop until closable is closed

61
src/Avalonia.Controls/DrawingPresenter.cs

@ -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<DrawingPresenter>(DrawingProperty);
AffectsRender<DrawingPresenter>(DrawingProperty);
}
public static readonly StyledProperty<Drawing> DrawingProperty =
AvaloniaProperty.Register<DrawingPresenter, Drawing>(nameof(Drawing));
public static readonly StyledProperty<Stretch> StretchProperty =
AvaloniaProperty.Register<DrawingPresenter, Stretch>(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);
}
}
}
}
}

13
src/Avalonia.Controls/LoggingExtensions.cs

@ -1,21 +1,10 @@
using System; using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Logging; using Avalonia.Logging;
namespace Avalonia namespace Avalonia
{ {
public static class LoggingExtensions public static class LoggingExtensions
{ {
[Obsolete("Use LogToTrace")]
public static T LogToDebug<T>(
this T builder,
LogEventLevel level = LogEventLevel.Warning,
params string[] areas)
where T : AppBuilderBase<T>, new()
{
return LogToTrace(builder, level, areas);
}
/// <summary> /// <summary>
/// Logs Avalonia events to the <see cref="System.Diagnostics.Trace"/> sink. /// Logs Avalonia events to the <see cref="System.Diagnostics.Trace"/> sink.
/// </summary> /// </summary>

7
src/Avalonia.Controls/NativeMenuItem.cs

@ -186,13 +186,6 @@ namespace Avalonia.Controls
/// </summary> /// </summary>
public event EventHandler? Click; public event EventHandler? Click;
[Obsolete("Use Click event.")]
public event EventHandler Clicked
{
add => Click += value;
remove => Click -= value;
}
void INativeMenuItemExporterEventsImplBridge.RaiseClicked() void INativeMenuItemExporterEventsImplBridge.RaiseClicked()
{ {
Click?.Invoke(this, new EventArgs()); Click?.Invoke(this, new EventArgs());

13
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 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 => "-";
} }
} }

53
src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs

@ -45,14 +45,6 @@ namespace Avalonia.Controls
AvaloniaProperty.RegisterDirect<NumericUpDown, bool>(nameof(ClipValueToMinMax), AvaloniaProperty.RegisterDirect<NumericUpDown, bool>(nameof(ClipValueToMinMax),
updown => updown.ClipValueToMinMax, (updown, b) => updown.ClipValueToMinMax = b); updown => updown.ClipValueToMinMax, (updown, b) => updown.ClipValueToMinMax = b);
/// <summary>
/// Defines the <see cref="CultureInfo"/> property.
/// </summary>
[Obsolete]
public static readonly DirectProperty<NumericUpDown, CultureInfo?> CultureInfoProperty =
AvaloniaProperty.RegisterDirect<NumericUpDown, CultureInfo?>(nameof(CultureInfo), o => o.CultureInfo,
(o, v) => o.CultureInfo = v, CultureInfo.CurrentCulture);
/// <summary> /// <summary>
/// Defines the <see cref="NumberFormat"/> property. /// Defines the <see cref="NumberFormat"/> property.
/// </summary> /// </summary>
@ -187,21 +179,6 @@ namespace Avalonia.Controls
set { SetAndRaise(ClipValueToMinMaxProperty, ref _clipValueToMinMax, value); } set { SetAndRaise(ClipValueToMinMaxProperty, ref _clipValueToMinMax, value); }
} }
/// <summary>
/// Gets or sets the current CultureInfo.
/// </summary>
[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);
}
}
/// <summary> /// <summary>
/// Gets or sets the current NumberFormatInfo /// Gets or sets the current NumberFormatInfo
/// </summary> /// </summary>
@ -335,9 +312,6 @@ namespace Avalonia.Controls
/// </summary> /// </summary>
static 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); NumberFormatProperty.Changed.Subscribe(OnNumberFormatChanged);
FormatStringProperty.Changed.Subscribe(FormatStringChanged); FormatStringProperty.Changed.Subscribe(FormatStringChanged);
IncrementProperty.Changed.Subscribe(IncrementChanged); IncrementProperty.Changed.Subscribe(IncrementChanged);
@ -416,19 +390,6 @@ namespace Avalonia.Controls
} }
} }
/// <summary>
/// Called when the <see cref="CultureInfo"/> property value changed.
/// </summary>
/// <param name="oldValue">The old value.</param>
/// <param name="newValue">The new value.</param>
protected virtual void OnCultureInfoChanged(CultureInfo? oldValue, CultureInfo? newValue)
{
if (IsInitialized)
{
SyncTextAndValueProperties(false, null);
}
}
/// <summary> /// <summary>
/// Called when the <see cref="NumberFormat"/> property value changed. /// Called when the <see cref="NumberFormat"/> property value changed.
/// </summary> /// </summary>
@ -729,20 +690,6 @@ namespace Avalonia.Controls
} }
} }
/// <summary>
/// Called when the <see cref="CultureInfo"/> property value changed.
/// </summary>
/// <param name="e">The event args.</param>
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);
}
}
/// <summary> /// <summary>
/// Called when the <see cref="NumberFormat"/> property value changed. /// Called when the <see cref="NumberFormat"/> property value changed.
/// </summary> /// </summary>

37
src/Avalonia.Controls/Primitives/Popup.cs

@ -88,14 +88,6 @@ namespace Avalonia.Controls.Primitives
public static readonly StyledProperty<Control?> PlacementTargetProperty = public static readonly StyledProperty<Control?> PlacementTargetProperty =
AvaloniaProperty.Register<Popup, Control?>(nameof(PlacementTarget)); AvaloniaProperty.Register<Popup, Control?>(nameof(PlacementTarget));
#pragma warning disable 618
/// <summary>
/// Defines the <see cref="ObeyScreenEdges"/> property.
/// </summary>
public static readonly StyledProperty<bool> ObeyScreenEdgesProperty =
AvaloniaProperty.Register<Popup, bool>(nameof(ObeyScreenEdges), true);
#pragma warning restore 618
public static readonly StyledProperty<bool> OverlayDismissEventPassThroughProperty = public static readonly StyledProperty<bool> OverlayDismissEventPassThroughProperty =
AvaloniaProperty.Register<Popup, bool>(nameof(OverlayDismissEventPassThrough)); AvaloniaProperty.Register<Popup, bool>(nameof(OverlayDismissEventPassThrough));
@ -123,17 +115,6 @@ namespace Avalonia.Controls.Primitives
public static readonly StyledProperty<double> VerticalOffsetProperty = public static readonly StyledProperty<double> VerticalOffsetProperty =
AvaloniaProperty.Register<Popup, double>(nameof(VerticalOffset)); AvaloniaProperty.Register<Popup, double>(nameof(VerticalOffset));
/// <summary>
/// Defines the <see cref="StaysOpen"/> property.
/// </summary>
[Obsolete("Use IsLightDismissEnabledProperty")]
public static readonly DirectProperty<Popup, bool> StaysOpenProperty =
AvaloniaProperty.RegisterDirect<Popup, bool>(
nameof(StaysOpen),
o => o.StaysOpen,
(o, v) => o.StaysOpen = v,
true);
/// <summary> /// <summary>
/// Defines the <see cref="Topmost"/> property. /// Defines the <see cref="Topmost"/> property.
/// </summary> /// </summary>
@ -299,13 +280,6 @@ namespace Avalonia.Controls.Primitives
set { SetValue(PlacementTargetProperty, value); } set { SetValue(PlacementTargetProperty, value); }
} }
[Obsolete("This property has no effect")]
public bool ObeyScreenEdges
{
get => GetValue(ObeyScreenEdgesProperty);
set => SetValue(ObeyScreenEdgesProperty, value);
}
/// <summary> /// <summary>
/// Gets or sets a value indicating whether the event that closes the popup is passed /// Gets or sets a value indicating whether the event that closes the popup is passed
/// through to the parent window. /// through to the parent window.
@ -350,17 +324,6 @@ namespace Avalonia.Controls.Primitives
set { SetValue(VerticalOffsetProperty, value); } set { SetValue(VerticalOffsetProperty, value); }
} }
/// <summary>
/// Gets or sets a value indicating whether the popup should stay open when the popup is
/// pressed or loses focus.
/// </summary>
[Obsolete("Use IsLightDismissEnabled")]
public bool StaysOpen
{
get => !IsLightDismissEnabled;
set => IsLightDismissEnabled = !value;
}
/// <summary> /// <summary>
/// Gets or sets whether this popup appears on top of all other windows /// Gets or sets whether this popup appears on top of all other windows
/// </summary> /// </summary>

12
src/Avalonia.Controls/Primitives/TemplatedControl.cs

@ -297,9 +297,6 @@ namespace Avalonia.Controls.Primitives
var e = new TemplateAppliedEventArgs(nameScope); var e = new TemplateAppliedEventArgs(nameScope);
OnApplyTemplate(e); OnApplyTemplate(e);
#pragma warning disable CS0618 // Type or member is obsolete
OnTemplateApplied(e);
#pragma warning restore CS0618 // Type or member is obsolete
RaiseEvent(e); RaiseEvent(e);
} }
@ -378,15 +375,6 @@ namespace Avalonia.Controls.Primitives
} }
} }
/// <summary>
/// Called when the control's template is applied.
/// </summary>
/// <param name="e">The event args.</param>
[Obsolete("Use OnApplyTemplate")]
protected virtual void OnTemplateApplied(TemplateAppliedEventArgs e)
{
}
/// <summary> /// <summary>
/// Called when the <see cref="Template"/> property changes. /// Called when the <see cref="Template"/> property changes.
/// </summary> /// </summary>

2
src/Avalonia.Controls/ProgressBar.cs

@ -251,11 +251,9 @@ namespace Avalonia.Controls
TemplateProperties.Container2AnimationEndPosition = barIndicatorWidth2 * 1.66; // Position at 166% 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. // Remove these properties when we switch to fluent as default and removed the old one.
IndeterminateStartingOffset = -dim; IndeterminateStartingOffset = -dim;
IndeterminateEndingOffset = dim; IndeterminateEndingOffset = dim;
#pragma warning restore CS0618 // Type or member is obsolete
var padding = Padding; var padding = Padding;
var rectangle = new RectangleGeometry( var rectangle = new RectangleGeometry(

2
src/Avalonia.Controls/RichTextBlock.cs

@ -381,9 +381,7 @@ namespace Avalonia.Controls
var hit = TextLayout.HitTestPoint(point); var hit = TextLayout.HitTestPoint(point);
var index = hit.TextPosition; var index = hit.TextPosition;
#pragma warning disable CS0618 // Type or member is obsolete
switch (e.ClickCount) switch (e.ClickCount)
#pragma warning restore CS0618 // Type or member is obsolete
{ {
case 1: case 1:
if (clickToSelect) if (clickToSelect)

20
src/Avalonia.Controls/SystemDialog.cs

@ -32,13 +32,6 @@ namespace Avalonia.Controls
[Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")]
public abstract class FileSystemDialog : SystemDialog public abstract class FileSystemDialog : SystemDialog
{ {
[Obsolete("Use Directory")]
public string? InitialDirectory
{
get => Directory;
set => Directory = value;
}
/// <summary> /// <summary>
/// Gets or sets the initial directory that will be displayed when the file system dialog /// Gets or sets the initial directory that will be displayed when the file system dialog
/// is opened. /// is opened.
@ -87,7 +80,7 @@ namespace Avalonia.Controls
DefaultExtension = DefaultExtension, DefaultExtension = DefaultExtension,
FileTypeChoices = Filters?.Select(f => new FilePickerFileType(f.Name!) { Patterns = f.Extensions.Select(e => $"*.{e}").ToArray() }).ToArray(), FileTypeChoices = Filters?.Select(f => new FilePickerFileType(f.Name!) { Patterns = f.Extensions.Select(e => $"*.{e}").ToArray() }).ToArray(),
Title = Title, Title = Title,
SuggestedStartLocation = InitialDirectory is { } directory SuggestedStartLocation = Directory is { } directory
? new BclStorageFolder(new System.IO.DirectoryInfo(directory)) ? new BclStorageFolder(new System.IO.DirectoryInfo(directory))
: null, : null,
ShowOverwritePrompt = ShowOverwritePrompt ShowOverwritePrompt = ShowOverwritePrompt
@ -129,7 +122,7 @@ namespace Avalonia.Controls
AllowMultiple = AllowMultiple, AllowMultiple = AllowMultiple,
FileTypeFilter = Filters?.Select(f => new FilePickerFileType(f.Name!) { Patterns = f.Extensions.Select(e => $"*.{e}").ToArray() }).ToArray(), FileTypeFilter = Filters?.Select(f => new FilePickerFileType(f.Name!) { Patterns = f.Extensions.Select(e => $"*.{e}").ToArray() }).ToArray(),
Title = Title, Title = Title,
SuggestedStartLocation = InitialDirectory is { } directory SuggestedStartLocation = Directory is { } directory
? new BclStorageFolder(new System.IO.DirectoryInfo(directory)) ? new BclStorageFolder(new System.IO.DirectoryInfo(directory))
: null : null
}; };
@ -142,13 +135,6 @@ namespace Avalonia.Controls
[Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")]
public class OpenFolderDialog : FileSystemDialog public class OpenFolderDialog : FileSystemDialog
{ {
[Obsolete("Use Directory")]
public string? DefaultDirectory
{
get => Directory;
set => Directory = value;
}
/// <summary> /// <summary>
/// Shows the open folder dialog. /// Shows the open folder dialog.
/// </summary> /// </summary>
@ -170,7 +156,7 @@ namespace Avalonia.Controls
return new FolderPickerOpenOptions return new FolderPickerOpenOptions
{ {
Title = Title, Title = Title,
SuggestedStartLocation = InitialDirectory is { } directory SuggestedStartLocation = Directory is { } directory
? new BclStorageFolder(new System.IO.DirectoryInfo(directory)) ? new BclStorageFolder(new System.IO.DirectoryInfo(directory))
: null : null
}; };

2
src/Avalonia.Controls/TextBox.cs

@ -1165,9 +1165,7 @@ namespace Avalonia.Controls
SetAndRaise(CaretIndexProperty, ref _caretIndex, index); SetAndRaise(CaretIndexProperty, ref _caretIndex, index);
#pragma warning disable CS0618 // Type or member is obsolete
switch (e.ClickCount) switch (e.ClickCount)
#pragma warning restore CS0618 // Type or member is obsolete
{ {
case 1: case 1:
if (clickToSelect) if (clickToSelect)

3
src/Avalonia.Controls/TopLevel.cs

@ -404,9 +404,6 @@ namespace Avalonia.Controls
LayoutManager?.Dispose(); LayoutManager?.Dispose();
} }
[Obsolete("Use HandleResized(Size, PlatformResizeReason)")]
protected virtual void HandleResized(Size clientSize) => HandleResized(clientSize, PlatformResizeReason.Unspecified);
/// <summary> /// <summary>
/// Handles a resize notification from <see cref="ITopLevelImpl.Resized"/>. /// Handles a resize notification from <see cref="ITopLevelImpl.Resized"/>.
/// </summary> /// </summary>

44
src/Avalonia.Controls/Window.cs

@ -79,16 +79,6 @@ namespace Avalonia.Controls
public static readonly StyledProperty<SizeToContent> SizeToContentProperty = public static readonly StyledProperty<SizeToContent> SizeToContentProperty =
AvaloniaProperty.Register<Window, SizeToContent>(nameof(SizeToContent)); AvaloniaProperty.Register<Window, SizeToContent>(nameof(SizeToContent));
/// <summary>
/// Enables or disables system window decorations (title bar, buttons, etc)
/// </summary>
[Obsolete("Use SystemDecorationsProperty instead")]
public static readonly DirectProperty<Window, bool> HasSystemDecorationsProperty =
AvaloniaProperty.RegisterDirect<Window, bool>(
nameof(HasSystemDecorations),
o => o.HasSystemDecorations,
(o, v) => o.HasSystemDecorations = v);
/// <summary> /// <summary>
/// Defines the <see cref="ExtendClientAreaToDecorationsHint"/> property. /// Defines the <see cref="ExtendClientAreaToDecorationsHint"/> property.
/// </summary> /// </summary>
@ -289,25 +279,6 @@ namespace Avalonia.Controls
set { SetValue(TitleProperty, value); } set { SetValue(TitleProperty, value); }
} }
/// <summary>
/// Enables or disables system window decorations (title bar, buttons, etc)
/// </summary>
[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);
}
}
}
/// <summary> /// <summary>
/// Gets or sets if the ClientArea is Extended into the Window Decorations (chrome or border). /// Gets or sets if the ClientArea is Extended into the Window Decorations (chrome or border).
/// </summary> /// </summary>
@ -985,9 +956,6 @@ namespace Avalonia.Controls
Owner = null; Owner = null;
} }
[Obsolete("Use HandleResized(Size, PlatformResizeReason)")]
protected sealed override void HandleResized(Size clientSize) => HandleResized(clientSize, PlatformResizeReason.Unspecified);
/// <inheritdoc/> /// <inheritdoc/>
protected sealed override void HandleResized(Size clientSize, PlatformResizeReason reason) protected sealed override void HandleResized(Size clientSize, PlatformResizeReason reason)
{ {
@ -1033,19 +1001,9 @@ namespace Avalonia.Controls
base.OnPropertyChanged(change); base.OnPropertyChanged(change);
if (change.Property == SystemDecorationsProperty) if (change.Property == SystemDecorationsProperty)
{ {
var (typedOldValue, typedNewValue) = change.GetOldAndNewValue<SystemDecorations>(); var (_, typedNewValue) = change.GetOldAndNewValue<SystemDecorations>();
PlatformImpl?.SetSystemDecorations(typedNewValue); 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
}
} }
} }

9
src/Avalonia.Controls/WindowBase.cs

@ -94,9 +94,6 @@ namespace Avalonia.Controls
public Screens Screens { get; private set; } public Screens Screens { get; private set; }
[Obsolete("No longer used. Always returns false.")]
protected bool AutoSizing => false;
/// <summary> /// <summary>
/// Gets or sets the owner of the window. /// Gets or sets the owner of the window.
/// </summary> /// </summary>
@ -169,9 +166,6 @@ namespace Avalonia.Controls
} }
} }
[Obsolete("No longer used. Has no effect.")]
protected IDisposable BeginAutoSizing() => Disposable.Empty;
/// <summary> /// <summary>
/// Ensures that the window is initialized. /// Ensures that the window is initialized.
/// </summary> /// </summary>
@ -226,9 +220,6 @@ namespace Avalonia.Controls
} }
} }
[Obsolete("Use HandleResized(Size, PlatformResizeReason)")]
protected override void HandleResized(Size clientSize) => HandleResized(clientSize, PlatformResizeReason.Unspecified);
/// <summary> /// <summary>
/// Handles a resize notification from <see cref="ITopLevelImpl.Resized"/>. /// Handles a resize notification from <see cref="ITopLevelImpl.Resized"/>.
/// </summary> /// </summary>

23
src/Avalonia.Diagnostics/Diagnostics/Screenshots/FilePickerHandler.cs

@ -3,6 +3,8 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Platform.Storage;
using Avalonia.Platform.Storage.FileIO;
using Lifetimes = Avalonia.Controls.ApplicationLifetimes; using Lifetimes = Avalonia.Controls.ApplicationLifetimes;
namespace Avalonia.Diagnostics.Screenshots namespace Avalonia.Diagnostics.Screenshots
@ -59,24 +61,25 @@ namespace Avalonia.Diagnostics.Screenshots
protected async override Task<Stream?> GetStream(IControl control) protected async override Task<Stream?> GetStream(IControl control)
{ {
Stream? output = default; 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, Title = Title,
Filters = new() { new FileDialogFilter() { Name = "PNG", Extensions = new() { "png" } } }, FileTypeChoices = new FilePickerFileType[] { new FilePickerFileType("PNG") { Patterns = new string[] { "*.png" } } }
Directory = ScreenshotsRoot, });
}.ShowAsync(GetWindow(control));
if (!string.IsNullOrWhiteSpace(result)) 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 // 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. // 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; return output;

6
src/Avalonia.Dialogs/AboutAvaloniaDialog.xaml

@ -76,7 +76,11 @@
</Canvas> </Canvas>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="18"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="18">
<Border Height="70" Width="70"> <Border Height="70" Width="70">
<DrawingPresenter Drawing="{DynamicResource AvaloniaLogo}" /> <Image>
<Image.Source>
<DrawingImage Drawing="{DynamicResource AvaloniaLogo}"/>
</Image.Source>
</Image>
</Border> </Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,-10,0,0"> <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,-10,0,0">
<TextBlock Text="{Binding Version, StringFormat=Avalonia {0}}" FontSize="40" Foreground="White" /> <TextBlock Text="{Binding Version, StringFormat=Avalonia {0}}" FontSize="40" Foreground="White" />

12
src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml

@ -138,7 +138,11 @@
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Spacing="4" Orientation="Horizontal" Background="Transparent"> <StackPanel Spacing="4" Orientation="Horizontal" Background="Transparent">
<DrawingPresenter Width="16" Height="16" Drawing="{Binding IconKey, Converter={StaticResource Icons}}"/> <Image Width="16" Height="16">
<Image.Source>
<DrawingImage Drawing="{Binding IconKey, Converter={StaticResource Icons}}"/>
</Image.Source>
</Image>
<TextBlock Text="{Binding DisplayName}"/> <TextBlock Text="{Binding DisplayName}"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
@ -231,7 +235,11 @@
<ColumnDefinition SharedSizeGroup="Splitter" /> <ColumnDefinition SharedSizeGroup="Splitter" />
<ColumnDefinition SharedSizeGroup="Size" /> <ColumnDefinition SharedSizeGroup="Size" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<DrawingPresenter Width="16" Height="16" Drawing="{Binding IconKey, Converter={StaticResource Icons}}"/> <Image Width="16" Height="16">
<Image.Source>
<DrawingImage Drawing="{Binding IconKey, Converter={StaticResource Icons}}"/>
</Image.Source>
</Image>
<TextBlock Grid.Column="2" Text="{Binding DisplayName}"/> <TextBlock Grid.Column="2" Text="{Binding DisplayName}"/>
<TextBlock Grid.Column="4" Text="{Binding Modified}" /> <TextBlock Grid.Column="4" Text="{Binding Modified}" />
<TextBlock Grid.Column="6" Text="{Binding Type}" /> <TextBlock Grid.Column="6" Text="{Binding Type}" />

2
src/Avalonia.Themes.Simple/Controls/CalendarDatePicker.xaml

@ -118,7 +118,7 @@
<Popup Name="PART_Popup" <Popup Name="PART_Popup"
PlacementTarget="{TemplateBinding}" PlacementTarget="{TemplateBinding}"
StaysOpen="False"> IsLightDismissEnabled="False">
<Calendar Name="PART_Calendar" <Calendar Name="PART_Calendar"
DisplayDate="{TemplateBinding DisplayDate}" DisplayDate="{TemplateBinding DisplayDate}"
DisplayDateEnd="{TemplateBinding DisplayDateEnd}" DisplayDateEnd="{TemplateBinding DisplayDateEnd}"

Loading…
Cancel
Save