diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index f636007..b9ba3a6 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -20,7 +20,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Set up JDK 11 uses: actions/setup-java@v4 with: @@ -51,7 +51,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Setup XCode uses: maxim-lobanov/setup-xcode@v1 with: @@ -77,7 +77,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Install workloads run: dotnet workload install android wasm-tools maui-android - name: Install Android tools diff --git a/Source/OxyPlot.Maui.Skia/OxyPlot.Maui.Skia.csproj b/Source/OxyPlot.Maui.Skia/OxyPlot.Maui.Skia.csproj index 75244b4..9b271a6 100644 --- a/Source/OxyPlot.Maui.Skia/OxyPlot.Maui.Skia.csproj +++ b/Source/OxyPlot.Maui.Skia/OxyPlot.Maui.Skia.csproj @@ -1,17 +1,17 @@ - net8.0;net8.0-android34.0 - $(TargetFrameworks);net8.0-ios;net8.0-maccatalyst - $(TargetFrameworks);net8.0-windows10.0.19041.0 + net8.0;net8.0-android34.0;net9.0;net9.0-android + $(TargetFrameworks);net8.0-ios;net8.0-maccatalyst;net9.0-ios;net9.0-maccatalyst + $(TargetFrameworks);net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0 true true enable - 14.2 - 14.0 + 12.2 + 15.0 21.0 10.0.17763.0 10.0.17763.0 @@ -30,19 +30,16 @@ https://github.com/oxyplot/oxyplot-maui - + false + - - - - diff --git a/Source/OxyPlot.Maui.Skia/PlotViewBase.cs b/Source/OxyPlot.Maui.Skia/PlotViewBase.cs index d3e1303..eaf0e93 100644 --- a/Source/OxyPlot.Maui.Skia/PlotViewBase.cs +++ b/Source/OxyPlot.Maui.Skia/PlotViewBase.cs @@ -8,7 +8,7 @@ public abstract partial class PlotViewBase : BaseTemplatedView, IPlotView public event Action UpdateFinished; public event Action RenderStarted; public event Action RenderFinished; - + private int mainThreadId = 1; protected override void OnControlInitialized(Grid control) @@ -74,7 +74,7 @@ protected override void OnControlInitialized(Grid control) /// protected PlotViewBase() { - this.TrackerDefinitions = new ObservableCollection(); + TrackerDefinitions = new ObservableCollection(); DefaultTrackerTemplate = new ControlTemplate(() => { @@ -84,7 +84,7 @@ protected PlotViewBase() tc.Content = TrackerControl.DefaultTrackerTemplateContentProvider(); return tc; }); - this.LayoutChanged += this.OnLayoutUpdated; + SizeChanged += OnSizeUpdated; } /// @@ -147,14 +147,14 @@ public void InvalidatePlot(bool updateData = true) { return; } - + UpdateStarted?.Invoke(); lock (this.ActualModel.SyncRoot) { ((IPlotModel)this.ActualModel).Update(updateData); } - + UpdateFinished?.Invoke(); this.BeginInvoke(this.Render); @@ -452,7 +452,7 @@ private bool IsInVisualTree() /// /// The sender. /// The event args. - private void OnLayoutUpdated(object sender, EventArgs e) + private void OnSizeUpdated(object sender, EventArgs e) { // if we were not in the visual tree the last time we tried to render but are now, we have to render if (!this.isInVisualTree && this.IsInVisualTree()) diff --git a/Source/OxyPlot.Maui.Skia/Tracker/TrackerControl.xaml.cs b/Source/OxyPlot.Maui.Skia/Tracker/TrackerControl.xaml.cs index 4832b58..7909007 100644 --- a/Source/OxyPlot.Maui.Skia/Tracker/TrackerControl.xaml.cs +++ b/Source/OxyPlot.Maui.Skia/Tracker/TrackerControl.xaml.cs @@ -372,7 +372,11 @@ private void UpdatePositionAndBorder() var canvasWidth = parent.Width; var canvasHeight = parent.Height; +#if NET9_0_OR_GREATER + var contentSize = content.Measure(canvasWidth, canvasHeight); +#else var contentSize = content.Measure(canvasWidth, canvasHeight).Request; +#endif var contentWidth = contentSize.Width; var contentHeight = contentSize.Height; diff --git a/Source/OxyplotMauiSample/App.xaml.cs b/Source/OxyplotMauiSample/App.xaml.cs index 32ee563..d02ccbf 100644 --- a/Source/OxyplotMauiSample/App.xaml.cs +++ b/Source/OxyplotMauiSample/App.xaml.cs @@ -1,11 +1,16 @@ -namespace OxyplotMauiSample + +namespace OxyplotMauiSample { public partial class App { public App() { InitializeComponent(); - MainPage = new AppShell(); + } + + protected override Window CreateWindow(IActivationState activationState) + { + return new Window(new AppShell()); } } } \ No newline at end of file diff --git a/Source/OxyplotMauiSample/OxyplotMauiSample.csproj b/Source/OxyplotMauiSample/OxyplotMauiSample.csproj index 2acb689..1399708 100644 --- a/Source/OxyplotMauiSample/OxyplotMauiSample.csproj +++ b/Source/OxyplotMauiSample/OxyplotMauiSample.csproj @@ -1,9 +1,9 @@  - net8.0-android34.0 - $(TargetFrameworks);net8.0-ios;net8.0-maccatalyst - $(TargetFrameworks);net8.0-windows10.0.19041.0 + net9.0-android + $(TargetFrameworks);net9.0-ios;net9.0-maccatalyst + $(TargetFrameworks);net9.0-windows10.0.19041.0 Exe @@ -23,18 +23,15 @@ 1.0 1 - 14.2 - 14.0 + 12.2 + 15.0 21.0 10.0.17763.0 10.0.17763.0 6.5 - - false - - + false @@ -65,7 +62,7 @@ - + diff --git a/Source/OxyplotMauiSample/Pages/CustomTrackerPage.xaml b/Source/OxyplotMauiSample/Pages/CustomTrackerPage.xaml index 0bc5763..f1042e9 100644 --- a/Source/OxyplotMauiSample/Pages/CustomTrackerPage.xaml +++ b/Source/OxyplotMauiSample/Pages/CustomTrackerPage.xaml @@ -1,44 +1,72 @@  - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/Source/OxyplotMauiSample/Pages/IssueDemos/IssueDemoPage.xaml b/Source/OxyplotMauiSample/Pages/IssueDemos/IssueDemoPage.xaml index 48c9769..91dde47 100644 --- a/Source/OxyplotMauiSample/Pages/IssueDemos/IssueDemoPage.xaml +++ b/Source/OxyplotMauiSample/Pages/IssueDemos/IssueDemoPage.xaml @@ -7,13 +7,13 @@ Title="Select demo"> - - + + diff --git a/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/AllBackgroundColorsSet.xaml b/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/AllBackgroundColorsSet.xaml index 24b9f93..f874a01 100644 --- a/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/AllBackgroundColorsSet.xaml +++ b/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/AllBackgroundColorsSet.xaml @@ -2,8 +2,14 @@ + xmlns:local="clr-namespace:OxyplotMauiSample" + x:Class="OxyplotMauiSample.AllBackgroundColorsSet" + x:DataType="local:AllBackgroundColorsSet" + BackgroundColor="Yellow"> - + \ No newline at end of file diff --git a/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/ChangeVisibility.xaml b/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/ChangeVisibility.xaml index fd6da41..064e373 100644 --- a/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/ChangeVisibility.xaml +++ b/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/ChangeVisibility.xaml @@ -1,12 +1,18 @@  - + - + + Model="{Binding Model}"/> \ No newline at end of file diff --git a/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/NoBackgroundColor.xaml b/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/NoBackgroundColor.xaml index b3bd19e..6d77151 100644 --- a/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/NoBackgroundColor.xaml +++ b/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/NoBackgroundColor.xaml @@ -1,4 +1,9 @@  - - + + \ No newline at end of file diff --git a/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/PageBackgroundColor.xaml b/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/PageBackgroundColor.xaml index 8a4e242..225cc4e 100644 --- a/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/PageBackgroundColor.xaml +++ b/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/PageBackgroundColor.xaml @@ -4,6 +4,8 @@ xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:oxy="clr-namespace:OxyPlot.Maui.Skia;assembly=OxyPlot.Maui.Skia" + xmlns:local="clr-namespace:OxyplotMauiSample" + x:DataType="local:PageBackgroundColor" BackgroundColor="Yellow"> - + \ No newline at end of file diff --git a/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/PlotModelBackground.xaml b/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/PlotModelBackground.xaml index 39e65b2..a4bbc25 100644 --- a/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/PlotModelBackground.xaml +++ b/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/PlotModelBackground.xaml @@ -1,4 +1,9 @@  - - + + \ No newline at end of file diff --git a/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/PlotViewBackgroundColor.xaml b/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/PlotViewBackgroundColor.xaml index 4e166f8..49a17f2 100644 --- a/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/PlotViewBackgroundColor.xaml +++ b/Source/OxyplotMauiSample/Pages/IssueDemos/Pages/PlotViewBackgroundColor.xaml @@ -1,8 +1,11 @@  - - + xmlns:local="clr-namespace:OxyplotMauiSample" + x:Class="OxyplotMauiSample.PlotViewBackgroundColor" + x:DataType="local:PlotViewBackgroundColor"> + \ No newline at end of file