Repository navigation
Update to Avalonia 12 and fix a number of issues - #76
Closed
izakusilov wants to merge 52 commits into
Closed
izakusilov wants to merge 52 commits into
izakusilov wants to merge 52 commits into
Conversation
This was referenced Oct 24, 2026
Merged
Author
|
Closing in favor of smaller PRs that are easier to review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update to Avalonia 12 and fix a number of issues
This PR moves
OxyPlot.Avaloniato Avalonia 12 and OxyPlot.Core 2.2.0, fixes a number of bugs found along the way, and adds a headless test project. Every commit builds on its own; the work is split by topic so it can be reviewed commit by commit.Avalonia 12 / OxyPlot 2.2.0
AvaloniaVersion12.1.4,OxyPlotCoreVersion2.2.0, package version 2.2.0.OxyPlot.Avalonianow targetsnet8.0(Avalonia 12 no longer shipsnetstandard2.0assemblies).IClipboard.SetTextAsyncis an extension method in Avalonia 12 (Avalonia.Input.Platform).Default.axamldeclarex:DataType.Avalonia.Diagnosticsis gone in Avalonia 12, so the dev tools hooks were removed from the examples; the examples opt out of compiled bindings by default.Bitmap.Save(Stream)is obsolete, the overload withPngBitmapEncoderOptionsis used.TrackerControl.LineDashArrayis anAvaloniaList<double>, as expected byShape.StrokeDashArray.Fixes
Rendering and export
CroppedBitmapinstead ofClip.DrawLineBalancedis computed once per line instead of once per point.SaveBitmap/ToBitmapthrow descriptive exceptions and restore the live model afterwards.Input
ContextRequestedand is suppressed after dragging with the mouse.PlotBaseis focusable but not a tab stop.Plot, series, axes and annotations
Plot.SyncLogicalTreehandlesReset,MoveandReplace; adding or removing elements updates the model data.PlotBase.UpdateModelis virtual andPlotoverrides it, soInvalidatePlotsynchronizes in-place edits of the wrappers.IsVisible,BaseValue,IsStacked,StackGroup, heat map bounds,InterpolationAlgorithm,Mapping,Limit,GapWidth, date time axis settings, etc.Series.Foreground/FontFamilyare only copied to the OxyPlot series when set explicitly (so labels followPlot.TextColor, also in dark themes).LinearBarSeries,AngleAxis.Position,RectangleAnnotationbounds).LogarithmicAxis.BaseandFunctionAnnotation.Resolutionare validated (invalid values made the core loop forever).LinearColorAxispalette interpolation honorsPaletteSizeand no longer divides by zero.Axis.MaximumMargingot the value ofMinimumMargin;ExtraGridlineswas registered under a different name.AreaSeries.Color2, duplicateTwoColorAreaSeries.Fill), deadHeatMapSeries.LowColor/HighColor, untypedScatterSeries.Mapping, missingLineStyle2/Lo/Hi,BoxWidth,MedianThicknessandColorAxisKeyforwarding.Breaking changes
TrackerControl.LineDashArrayis anAvaloniaList<double>.HeatMapSeries.LowColorandHeatMapSeries.HighColorwere removed (they were not wired to anything).Plot.TitleAlignmentPropertywas renamed toPlot.TitleHorizontalAlignmentProperty.Plot.PlotAreaBackgroundis anIBrush(wasBrush).PlotBase.UpdateModelis virtual.ArgumentExceptionfor invalidLogarithmicAxis.Base/FunctionAnnotation.Resolution.InvalidOperationExceptioninstead ofNullReferenceExceptioninSaveBitmap/ToBitmapwithout a model.AngleAxis.Position,LinearBarSeries.BarWidth/StrokeThickness, legend font sizes,RectangleAnnotationbounds.Tests
Source/OxyPlot.Avalonia.Testsis a new xUnit v3 project that shows controls in a headless Avalonia window (with Skia rendering) and covers the changes above.dotnet test Source/OxyPlot.Avalonia.slnruns it, and the Linux CI job now does so too.Relationship to #74
#74 also moves the project to Avalonia 12. It is a minimal migration: it bumps the package versions, adds the
Avalonia.Input.Platformusing, addsx:DataTypeto the tracker templates and adapts the examples. This PR contains the same migration steps (first commit) and goes further, so it is both broader in scope and, I believe, more correct:TrackerControl.LineDashArrayis changed toAvaloniaList<double>, the typeShape.StrokeDashArrayuses in Avalonia 12; it is stillList<double>in added support for avalonia 12 #74.Bitmap.Save(Stream)overload is replaced and the exported bitmap is disposed.OxyPlot.Avaloniatargetsnet8.0, the lowest framework Avalonia 12 supports, so .NET 8 applications can use the package; added support for avalonia 12 #74 targetsnet10.0only.LogarithmicAxis.Base/FunctionAnnotation.Resolution, the layout failure on non-finite shapes and theRectangleAnnotationdefault bounds that no longer match OxyPlot.Core 2.2.0.If the maintainers prefer, the first commit ("Update to Avalonia 12 and OxyPlot 2.2.0") is the equivalent of #74 and the remaining commits can be reviewed or merged separately.