Skip to content

Commit e48896d

Browse files
authored
Update Avalonia to 0.10.0-preview1 (#23)
1 parent 2c63232 commit e48896d

File tree

16 files changed

+35
-73
lines changed

16 files changed

+35
-73
lines changed

Source/Examples/Avalonia/AvaloniaExamples/App.xaml.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
using Avalonia;
33
using Avalonia.Controls;
44
using Avalonia.Controls.ApplicationLifetimes;
5-
using Avalonia.Logging.Serilog;
65
using Avalonia.Markup.Xaml;
7-
using Serilog;
86
using OxyPlot.Avalonia;
97

108
namespace AvaloniaExamples
@@ -33,9 +31,11 @@ public override void OnFrameworkInitializationCompleted()
3331
static void Main(string[] args)
3432
{
3533
OxyPlotModule.EnsureLoaded();
36-
InitializeLogging();
3734
AppBuilder.Configure<App>()
3835
.UsePlatformDetect()
36+
#if DEBUG
37+
.LogToDebug()
38+
#endif
3939
.StartWithClassicDesktopLifetime(args);
4040
}
4141

@@ -45,15 +45,5 @@ public static void AttachDevTools(Window window)
4545
DevToolsExtensions.AttachDevTools(window);
4646
#endif
4747
}
48-
49-
private static void InitializeLogging()
50-
{
51-
#if DEBUG
52-
SerilogLogger.Initialize(new LoggerConfiguration()
53-
.MinimumLevel.Warning()
54-
.WriteTo.Trace(outputTemplate: "{Area}: {Message}")
55-
.CreateLogger());
56-
#endif
57-
}
5848
}
5949
}

Source/Examples/Avalonia/AvaloniaExamples/AvaloniaExamples.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<ItemGroup>
1313
<PackageReference Include="JetBrains.Annotations" Version="11.0.0" />
1414
<ProjectReference Include="..\..\..\OxyPlot.Avalonia\OxyPlot.Avalonia.csproj" />
15-
<PackageReference Include="Serilog.Sinks.Trace" Version="2.1.0" />
16-
<PackageReference Include="Avalonia.Desktop" Version="0.9.3" />
15+
<PackageReference Include="Avalonia.Desktop" Version="0.10.0-preview1" />
16+
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.0-preview1" />
1717
</ItemGroup>
1818
</Project>

Source/Examples/Avalonia/ExampleBrowser/ExampleBrowser.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
</AvaloniaResource>
1313
</ItemGroup>
1414
<ItemGroup>
15-
<PackageReference Include="Avalonia" Version="0.9.3" />
16-
<PackageReference Include="Avalonia.Desktop" Version="0.9.3" />
15+
<PackageReference Include="Avalonia.Desktop" Version="0.10.0-preview1" />
16+
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.0-preview1" />
1717
<PackageReference Include="OxyPlot.Core" Version="2.0.0" />
1818
<PackageReference Include="OxyPlot.ExampleLibrary" Version="2.0.0" />
1919
</ItemGroup>

Source/Examples/Avalonia/ExampleBrowser/Program.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using Avalonia;
3-
using Avalonia.Controls.ApplicationLifetimes;
4-
using Avalonia.Logging.Serilog;
1+
using Avalonia;
52

63
namespace ExampleBrowser
74
{

Source/Examples/Avalonia/MemoryTest/App.xaml.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
using Avalonia;
33
using Avalonia.Controls;
44
using Avalonia.Controls.ApplicationLifetimes;
5-
using Avalonia.Logging.Serilog;
65
using Avalonia.Markup.Xaml;
7-
using Serilog;
86
using OxyPlot.Avalonia;
97

108
namespace MemoryTest
@@ -33,26 +31,18 @@ public override void OnFrameworkInitializationCompleted()
3331
static void Main(string[] args)
3432
{
3533
OxyPlotModule.EnsureLoaded();
36-
InitializeLogging();
3734
AppBuilder.Configure<App>()
3835
.UsePlatformDetect()
36+
#if DEBUG
37+
.LogToDebug()
38+
#endif
3939
.StartWithClassicDesktopLifetime(args);
4040
}
4141

4242
public static void AttachDevTools(Window window)
4343
{
4444
#if DEBUG
4545
DevToolsExtensions.AttachDevTools(window);
46-
#endif
47-
}
48-
49-
private static void InitializeLogging()
50-
{
51-
#if DEBUG
52-
SerilogLogger.Initialize(new LoggerConfiguration()
53-
.MinimumLevel.Warning()
54-
.WriteTo.Trace(outputTemplate: "{Area}: {Message}")
55-
.CreateLogger());
5646
#endif
5747
}
5848
}

Source/Examples/Avalonia/MemoryTest/MemoryTest.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<ItemGroup>
1313
<PackageReference Include="JetBrains.Annotations" Version="11.0.0" />
1414
<ProjectReference Include="..\..\..\OxyPlot.Avalonia\OxyPlot.Avalonia.csproj" />
15-
<PackageReference Include="Serilog.Sinks.Trace" Version="2.1.0" />
16-
<PackageReference Include="Avalonia.Desktop" Version="0.9.3" />
15+
<PackageReference Include="Avalonia.Desktop" Version="0.10.0-preview1" />
16+
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.0-preview1" />
1717
</ItemGroup>
1818
</Project>

Source/Examples/Avalonia/SimpleDemo/MainWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class MainWindow : Window
2525
public MainWindow()
2626
{
2727
InitializeComponent();
28-
DevToolsExtensions.AttachDevTools(this);
28+
this.AttachDevTools();
2929
}
3030

3131
private void InitializeComponent()

Source/Examples/Avalonia/SimpleDemo/SimpleDemo.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<PackageReference Include="JetBrains.Annotations" Version="11.0.0" />
1414
<ProjectReference Include="..\..\..\OxyPlot.Avalonia\OxyPlot.Avalonia.csproj" />
1515
<PackageReference Include="Serilog.Sinks.Trace" Version="2.1.0" />
16-
<PackageReference Include="Avalonia.Desktop" Version="0.9.3" />
16+
<PackageReference Include="Avalonia.Desktop" Version="0.10.0-preview1" />
17+
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.0-preview1" />
1718
</ItemGroup>
1819
</Project>

Source/OxyPlot.Avalonia/Axes/Axis.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ protected void OnDataChanged()
13801380
/// The on property changed handler.
13811381
/// </summary>
13821382
/// <param name="e">The event args.</param>
1383-
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs e)
1383+
protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> e)
13841384
{
13851385
base.OnPropertyChanged(e);
13861386
if (e.Property.OwnerType == GetType())

Source/OxyPlot.Avalonia/Axes/LinearColorAxis.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,7 @@ public class LinearColorAxis : Axis
4141
/// <summary>
4242
/// Identifies the <see cref="PaletteSizeProperty"/> dependency property.
4343
/// </summary>
44-
public static readonly StyledProperty<int> PaletteSizeProperty = AvaloniaProperty.Register<LinearColorAxis, int>(nameof(PaletteSize), 20, validate: (obj, val) =>
45-
{
46-
if (!ValidatePaletteSize(val))
47-
{
48-
throw new System.ArgumentException();
49-
}
50-
51-
return val;
52-
});
44+
public static readonly StyledProperty<int> PaletteSizeProperty = AvaloniaProperty.Register<LinearColorAxis, int>(nameof(PaletteSize), 20, validate: ValidatePaletteSize);
5345

5446
/// <summary>
5547
/// Initializes a new instance of the <see cref="LinearColorAxis"/> class.
@@ -209,9 +201,9 @@ private static OxyPalette Interpolate(List<GradientStop> stops, int paletteSize)
209201
/// <returns>
210202
/// The validation result.
211203
/// </returns>
212-
private static bool ValidatePaletteSize(object value)
204+
private static bool ValidatePaletteSize(int value)
213205
{
214-
return (int)value >= 1;
206+
return value >= 1;
215207
}
216208

217209
static LinearColorAxis()

0 commit comments

Comments
 (0)