diff --git a/.github/actions/comment-progress/action.yml b/.github/actions/comment-progress/action.yml
new file mode 100644
index 000000000..aaca64b1f
--- /dev/null
+++ b/.github/actions/comment-progress/action.yml
@@ -0,0 +1,57 @@
+name: "Comment"
+description: "Creates or updates a comment on the PR with the progress of the tests"
+inputs:
+ comment_id:
+ description: 'The ID of the comment to append to'
+ required: false
+ content:
+ description: 'The content to add to the comment'
+ required: true
+outputs:
+ comment_id:
+ description: "ID of the comment"
+ value: ${{ steps.update-comment.outputs.comment_id }}
+runs:
+ using: "composite"
+ steps:
+ - id: update-comment
+ uses: actions/github-script@v8
+ with:
+ script: |
+ const commentId = "${{ inputs.comment_id }}";
+ let content = `${{ inputs.content }}`;
+
+ if (!commentId) {
+ const newComment = await github.rest.issues.createComment({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body: content
+ });
+
+ core.setOutput("comment_id", newComment.data.id);
+
+ return;
+ }
+
+ const comment = await github.rest.issues.getComment({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ comment_id: commentId
+ });
+
+ content = content
+ .replace(new RegExp('#success', 'g'), '✅ passed')
+ .replace(new RegExp('#failure', 'g'), '❌ failed');
+
+ let body = comment.data.body;
+
+ body += `\n${content}`;
+
+ await github.rest.issues.updateComment({
+ comment_id: commentId,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body
+ });
\ No newline at end of file
diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml
new file mode 100644
index 000000000..3ec9d2ae4
--- /dev/null
+++ b/.github/actions/run-tests/action.yml
@@ -0,0 +1,95 @@
+name: "Run tests"
+description: "Runs the specified tests using factos or core tests"
+inputs:
+ use-factos:
+ description: 'Whether to use factos for test selection'
+ required: true
+ id:
+ description: "Identifier for the test target"
+ required: true
+ test-id:
+ description: 'The test id to select for factos'
+ required: false
+ default: ""
+ target-framework:
+ description: 'The target framework to use'
+ required: false
+ default: ""
+ workloads:
+ description: 'The workloads array to install'
+ required: false
+ default: ""
+ xcode-path:
+ description: 'The Xcode path to select'
+ required: false
+ use-android-emulator:
+ description: 'Whether to use android emulator'
+ required: false
+ comment_id:
+ description: 'The ID of the comment to append to'
+ required: false
+runs:
+ using: "composite"
+ steps:
+ - name: Select Xcode version
+ shell: pwsh
+ if: ${{ inputs.xcode-path }}
+ run: sudo xcode-select -s ${{ inputs.xcode-path }}
+
+ - name: Setup .NET and Workloads
+ uses: ./.github/actions/setup-dotnet-and-workloads
+ with:
+ workloads: ${{ inputs.workloads }}
+
+ - name: Download local packages
+ uses: actions/download-artifact@v7.0.0
+ with:
+ path: ./artifacts
+
+ - name: Configure NuGet sources
+ shell: pwsh
+ run:
+ dotnet nuget add source ${{ github.workspace }}/artifacts --name local
+
+ # run tests using the factos selection and the console when no emulator is needed
+ - name: Run UI tests
+ if : ${{ inputs.use-factos == 'true' && inputs.use-android-emulator != 'true' }}
+ shell: pwsh
+ run: dotnet run --project tests/UITests -c Release --report-trx --no-progress --select ${{ inputs.test-id }} --test-env tf=${{ inputs.target-framework }} lvcversionsuffix=-${{ github.sha }}
+
+ # run tests using the factos selection inside the android emulator
+ - name: Enable KVM
+ if : ${{ inputs.use-factos == 'true' && inputs.use-android-emulator == 'true' }}
+ shell: pwsh
+ run: |
+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
+ sudo udevadm control --reload-rules
+ sudo udevadm trigger --name-match=kvm
+ - name: Start Android emulator and run tests
+ if : ${{ inputs.use-factos == 'true' && inputs.use-android-emulator == 'true' }}
+ uses: reactivecircus/android-emulator-runner@v2.35.0
+ with:
+ api-level: 35
+ target: google_apis
+ arch: x86_64
+ script:
+ dotnet run --project tests/UITests -c Release --report-trx --no-progress --select ${{ inputs.test-id }} --test-env tf=${{ inputs.target-framework }} lvcversionsuffix=-${{ github.sha }}
+
+ # run core tests when factos is not used
+ # the Debug config is required even we are testing the nuget packages in Release.
+ # this is because some optimizations in Release make the tests fail, but the code
+ # that fails is not related to the nuget packages but to the test code itself
+ # there is a function that mocks the ui drawing that fails in Release optimizations.
+ # ToDo: fix that, or now that we have ui tests, maybe just run the tests in the ui?.
+ - name: Run tests
+ if : ${{ inputs.use-factos != 'true' }}
+ shell: pwsh
+ run: dotnet run --project tests/CoreTests/CoreTests.csproj -c Debug -f ${{ inputs.target-framework }} --report-trx -p:UseNuGetPackages=true -p:LiveChartsVersionSuffix=-${{ github.sha }}
+
+ - name: Upload test results
+ if: always()
+ uses: actions/upload-artifact@v6.0.0
+ with:
+ name: test-results-${{ inputs.test-id }}
+ retention-days: 30
+ path: "**/*.trx"
diff --git a/.github/actions/setup-dotnet-and-workloads/action.yml b/.github/actions/setup-dotnet-and-workloads/action.yml
new file mode 100644
index 000000000..a02b4db9b
--- /dev/null
+++ b/.github/actions/setup-dotnet-and-workloads/action.yml
@@ -0,0 +1,23 @@
+name: "Setup .Net and Workloads"
+description: "Sets up .NET SDK 10 and installs the specified workloads"
+inputs:
+ workloads:
+ description: 'The workloads array to install'
+ required: false
+ default: ""
+runs:
+ using: "composite"
+ steps:
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v5.0.1
+ with:
+ dotnet-version: '10.0.100'
+
+ - name: Install Workloads
+ if: ${{ inputs.workloads != '' }}
+ shell: pwsh
+ run: |
+ $workloads = "${{ inputs.workloads }}".Split(' ')
+ foreach ($workload in $workloads) {
+ dotnet workload install $workload
+ }
\ No newline at end of file
diff --git a/.github/workflows/compile-all-views.yml b/.github/workflows/compile-all-views.yml
deleted file mode 100644
index aa883600b..000000000
--- a/.github/workflows/compile-all-views.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-name: "Compile all views"
-
-on:
- push:
- branches: [ master, dev ]
- pull_request:
- branches: [ master, dev ]
- schedule:
- - cron: '35 19 * * 4'
-
-jobs:
- analyze:
- name: Analyze
- runs-on: windows-2022
-
- strategy:
- fail-fast: false
- matrix:
- language: [ 'csharp' ]
- targetplatform: [ x86, x64 ]
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
-
- - uses: actions/setup-dotnet@v4
- with:
- dotnet-version: '8.0.x'
-
- - name: Install MAUI workload
- run: dotnet workload install maui
-
- - name: Compile Debug
- run: ./build/build-windows.ps1 -configuration "Debug"
diff --git a/.github/workflows/livecharts.yml b/.github/workflows/livecharts.yml
new file mode 100644
index 000000000..bfdae42e0
--- /dev/null
+++ b/.github/workflows/livecharts.yml
@@ -0,0 +1,378 @@
+name: LiveCharts
+permissions:
+ contents: read
+ actions: read
+ checks: write
+ pull-requests: write
+
+on:
+ pull_request:
+ branches: [ master, dev ]
+
+jobs:
+
+ report-progress-starting:
+ runs-on: ubuntu-24.04
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6.0.1
+ - uses: ./.github/actions/comment-progress
+ id: create-comment
+ with:
+ content: |
+ Thanks for your contribution!
+
+ We are starting the build and test process. This may take a while.
+ You can find more details below as the process continues or at the [actions tab](https://github.com/Live-Charts/LiveCharts2/actions/runs/${{ github.run_id }}).
+ outputs:
+ comment_id: ${{ steps.create-comment.outputs.comment_id }}
+
+ pack:
+ runs-on: windows-2025
+ needs: report-progress-starting
+ strategy:
+ matrix:
+ include:
+ - short-name: core
+ project: src/LiveChartsCore
+ - short-name: skiasharp
+ project: src/skiasharp/LiveChartsCore.SkiaSharp
+ - short-name: avalonia-skiasharp
+ project: src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia
+ workloads: wasm-tools, maui
+ - short-name: blazor-skiasharp
+ project: src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor
+ - short-name: eto-skiasharp
+ project: src/skiasharp/LiveChartsCore.SkiaSharpView.Eto
+ - short-name: maui-skiasharp
+ project: src/skiasharp/LiveChartsCore.SkiaSharpView.Maui
+ workloads: maui
+ - short-name: uno-skiasharp
+ project: src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI
+ workloads: wasm-tools, maui
+ - short-name: winui-skiasharp
+ project: src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI
+ - short-name: winforms-skiasharp
+ project: src/skiasharp/LiveChartsCore.SkiaSharp.WinForms
+ - short-name: wpf-skiasharp
+ project: src/skiasharp/LiveChartsCore.SkiaSharp.WPF
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6.0.1
+
+ - name: Setup .NET and Workloads
+ uses: ./.github/actions/setup-dotnet-and-workloads
+ with:
+ workloads: ${{ matrix.workloads }}
+
+ - name: Pack
+ run:
+ dotnet pack ${{ matrix.project }} -c Release -o artifacts /p:IsPacking=true /p:LiveChartsVersionSuffix=-${{ github.sha }}
+
+ - name: Upload packages
+ id: upload
+ uses: actions/upload-artifact@v6.0.0
+ with:
+ name: ${{ matrix.short-name }}-package
+ retention-days: 30
+ path: |
+ artifacts/*.nupkg
+ artifacts/*.snupkg
+
+ collect-packages:
+ runs-on: ubuntu-24.04
+ needs: [pack, report-progress-starting]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6.0.1
+
+ - name: Merge all package artifacts into one
+ uses: actions/upload-artifact/merge@v6
+ id: merge
+ with:
+ name: nuget-packages
+ pattern: "*-package"
+ retention-days: 30
+ delete-merged: true
+
+ - name: Update Comment
+ uses: ./.github/actions/comment-progress
+ with:
+ comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}
+ content: |
+
+ ---
+
+ All packages have been packed successfully! 📦✅
+ You can download the NuGet packages for this build [here](${{ steps.merge.outputs.artifact-url }}).
+
+ The packages will be available for 30 days, you can either [use them directly](https://stackoverflow.com/questions/43400069/add-a-package-with-a-local-package-file-in-dotnet), or wait for this PR to be merged to have them published to NuGet.org.
+
+ ---
+
+ Tests will start now, you can monitor their progress below or at the [actions tab](https://github.com/Live-Charts/LiveCharts2/actions/runs/${{ github.run_id }}).
+
+ test-core:
+ runs-on: windows-2025
+ needs: [pack, report-progress-starting]
+ strategy:
+ fail-fast: false
+ matrix:
+ framework: [ net8.0, net462 ]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6.0.1
+
+ - name: Run tests
+ uses: ./.github/actions/run-tests
+ with:
+ id: core
+ test-id: core-${{ matrix.framework }}
+ use-factos: false
+ target-framework: ${{ matrix.framework }}
+ comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}
+
+ test-windows:
+ runs-on: windows-2025
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - id: avalonia-desktop
+ - id: eto
+ - id: maui
+ tf: net10.0-windows10.0.19041.0
+ workloads: maui
+ - id: uno
+ tf: net10.0-desktop
+ workloads: maui
+ - id: winui
+ - id: winforms-net10
+ - id: winforms-net10w19041
+ - id: winforms-net462
+ - id: wpf-net10
+ - id: wpf-net10w19041
+ - id: wpf-net462
+
+ needs: [pack, report-progress-starting]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6.0.1
+
+ - name: Run UI tests
+ uses: ./.github/actions/run-tests
+ with:
+ id: windows
+ use-factos: true
+ test-id: ${{ matrix.id }}
+ workloads: ${{ matrix.workloads }}
+ target-framework: ${{ matrix.tf }}
+ comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}
+
+ test-linux:
+ runs-on: ubuntu-24.04
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - id: avalonia-desktop
+ # - id: eto, requires additional setup i think...
+ - id: uno
+ tf: net10.0-desktop
+ workloads: android
+ needs: [pack, report-progress-starting]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6.0.1
+
+ - name: Setup headless display
+ uses: pyvista/setup-headless-display-action@v4.2
+
+ - name: Run UI tests
+ uses: ./.github/actions/run-tests
+ with:
+ id: linux
+ use-factos: true
+ test-id: ${{ matrix.id }}
+ workloads: ${{ matrix.workloads }}
+ target-framework: ${{ matrix.tf }}
+ comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}
+
+ test-mac:
+ runs-on: macos-26
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - id: avalonia-desktop
+ - id: eto
+ - id: maui
+ tf: net10.0-maccatalyst
+ workloads: maui
+ - id: uno
+ tf: net10.0-desktop
+ workloads: maui
+ needs: [pack, report-progress-starting]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6.0.1
+
+ - name: Run UI tests
+ uses: ./.github/actions/run-tests
+ with:
+ id: mac
+ use-factos: true
+ test-id: ${{ matrix.id }}
+ workloads: ${{ matrix.workloads }}
+ target-framework: ${{ matrix.tf }}
+ xcode-path: /Applications/Xcode_26.2.app
+ comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}
+
+ test-browser:
+ runs-on: ubuntu-24.04
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - id: blazor
+ workloads: wasm-tools
+ - id: avalonia-browser
+ workloads: wasm-tools
+ # disabled for now, in this uno version, idk why on wasm no tests are detected.
+ # - id: uno
+ # tf: net10.0-browserwasm
+ # workloads: wasm-tools android
+ needs: [pack, report-progress-starting]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6.0.1
+
+ - name: Run UI tests
+ uses: ./.github/actions/run-tests
+ with:
+ id: browser
+ use-factos: true
+ test-id: ${{ matrix.id }}
+ workloads: ${{ matrix.workloads }}
+ # target-framework: ${{ matrix.tf }}
+ comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}
+
+ # test-android:
+ # runs-on: ubuntu-24.04
+ # strategy:
+ # fail-fast: false
+ # matrix:
+ # include:
+ # - id: avalonia-android
+ # workloads: android
+ # - id: maui
+ # tf: net10.0-android
+ # workloads: maui-android
+ # # disabled for now, in this uno version, idk why on android no tests are detected.
+ # # - id: uno
+ # # tf: net10.0-android
+ # # workloads: android
+ # needs: [pack, report-progress-starting]
+ # steps:
+ # - name: Checkout
+ # uses: actions/checkout@v6.0.1
+
+ # - name: Run UI tests
+ # uses: ./.github/actions/run-tests
+ # with:
+ # id: android
+ # use-factos: true
+ # test-id: ${{ matrix.id }}
+ # workloads: ${{ matrix.workloads }}
+ # target-framework: ${{ matrix.tf }}
+ # use-android-emulator: true
+ # comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}
+
+ # test-ios:
+ # runs-on: macos-26
+ # strategy:
+ # fail-fast: false
+ # matrix:
+ # include:
+ # - id: avalonia-ios
+ # workloads: ios
+ # - id: maui
+ # tf: net10.0-ios
+ # workloads: maui
+ # # disabled for now, in this uno version, it takes 3 times longer than the others (about 40 mins)
+ # # - id: uno
+ # # tf: net10.0-ios
+ # # workloads: ios android
+ # needs: [pack, report-progress-starting]
+ # steps:
+ # - name: Checkout
+ # uses: actions/checkout@v6.0.1
+
+ # - name: Run UI tests
+ # uses: ./.github/actions/run-tests
+ # with:
+ # id: ios
+ # use-factos: true
+ # test-id: ${{ matrix.id }}
+ # workloads: ${{ matrix.workloads }}
+ # target-framework: ${{ matrix.tf }}
+ # xcode-path: /Applications/Xcode_26.2.app
+ # comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}
+
+ after-tests:
+ runs-on: ubuntu-24.04
+ if: always()
+ needs:
+ - report-progress-starting
+ - test-core
+ - test-windows
+ - test-linux
+ - test-mac
+ - test-browser
+ # - test-android
+ # - test-ios
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6.0.1
+
+ - name: Download all test results
+ uses: actions/download-artifact@v7.0.0
+ with:
+ pattern: test-results-*
+ path: ./test-results
+
+ - name: Publish all test results
+ id: report
+ uses: dorny/test-reporter@v2.4.0
+ with:
+ name: all-test-results
+ path: "./test-results/**/*.trx"
+ reporter: dotnet-trx
+
+ - name: Report tests completion
+ if: ${{ always() && !contains(join(needs.*.result, ' '), 'failure') && !contains(join(needs.*.result, ' '), 'cancelled') }}
+ uses: ./.github/actions/comment-progress
+ with:
+ comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}
+ content: |
+ ### Test Results Summary (Passed) ✅ :partying_face:
+
+ ${{ steps.report.outputs.skipped }} skipped.
+ ${{ steps.report.outputs.failed }} failed.
+ ${{ steps.report.outputs.passed }} passed! ✅
+
+ - name: Report tests failure
+ if: ${{ always() && (contains(join(needs.*.result, ' '), 'failure') || contains(join(needs.*.result, ' '), 'cancelled')) }}
+ uses: ./.github/actions/comment-progress
+ with:
+ comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}
+ content: |
+ ### Test Results Summary (Failure) ❌ :disappointed_relieved:
+
+ | Core | Windows | Linux | Mac | Browser | Android | iOS |
+ |-------|---------|-------|-----|---------|---------|-----|
+ | #${{ needs.test-core.result }} | #${{ needs.test-windows.result }} | #${{ needs.test-linux.result }} | #${{ needs.test-mac.result }} | #${{ needs.test-browser.result }} | #${{ needs.test-android.result }} | #${{ needs.test-ios.result }} |
+
+ ${{ steps.report.outputs.skipped }} skipped.
+ ${{ steps.report.outputs.passed }} passed.
+ ${{ steps.report.outputs.failed }} failed. ❌
\ No newline at end of file
diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml
deleted file mode 100644
index c374437a6..000000000
--- a/.github/workflows/run-unit-tests.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-name: "Unit tests"
-
-on:
- push:
- branches: [ master, dev ]
- pull_request:
- branches: [ master, dev ]
- schedule:
- - cron: '35 19 * * 4'
-
-jobs:
- analyze:
- name: Analyze
- runs-on: windows-2022
-
- strategy:
- fail-fast: false
- matrix:
- language: [ 'csharp' ]
- targetplatform: [ x86, x64 ]
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
-
- - uses: actions/setup-dotnet@v4
- with:
- dotnet-version: '8.0.x'
-
- - name: Run unit tests
- run: dotnet test ./tests/LiveChartsCore.UnitTesting
diff --git a/.gitignore b/.gitignore
index 60c112fae..3b350716c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -344,9 +344,3 @@ healthchecksdb
samples/XamarinSample/XamarinSample/XamarinSample.Android/XamarinSample.Android.csproj
samples/XamarinSample/XamarinSample/XamarinSample.Android/Resources/Resource.designer.cs
nuget.exe
-
-# Yes it is recommended to share the *.snk, but there are few reasons
-# other than the ones mentioned in the next link that makes me want to keep this private, also singed.
-# https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/strong-naming#create-strong-named-net-libraries
-*LiveCharts.snk
-build/pack.singed.ps1
diff --git a/Directory.Build.props b/Directory.Build.props
index 524e55e3c..716be58e8 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,11 +1,14 @@
- 2.0.0-rc6.1
+ -rc6.1
+ 2.0.0$(LiveChartsVersionSuffix)1.0.1BetoRodriguez
- preview
+ 14.0
+ enable
+ enable8.3.1.1
-
+
+ false
+
+ 0.8.0
+
+
falsetrue
diff --git a/LiveCharts.Tests.slnx b/LiveCharts.Tests.slnx
new file mode 100644
index 000000000..99c3de6a9
--- /dev/null
+++ b/LiveCharts.Tests.slnx
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LiveCharts.slnx b/LiveCharts.slnx
index 13d141687..c8c22a61b 100644
--- a/LiveCharts.slnx
+++ b/LiveCharts.slnx
@@ -142,13 +142,23 @@
-
+
-
+
+
+
+
+
+
-
+
+
+
+
+
+
diff --git a/LiveCharts.snk b/LiveCharts.snk
new file mode 100644
index 000000000..16a1ee945
Binary files /dev/null and b/LiveCharts.snk differ
diff --git a/build/NativeSharedLinks.Build.props b/build/NativeSharedLinks.Build.props
new file mode 100644
index 000000000..035b31743
--- /dev/null
+++ b/build/NativeSharedLinks.Build.props
@@ -0,0 +1,7 @@
+
+
+
+ Native\%(RecursiveDir)%(Filename).cs
+
+
+
diff --git a/build/SharedLinks.Build.props b/build/SharedLinks.Build.props
new file mode 100644
index 000000000..562ae3669
--- /dev/null
+++ b/build/SharedLinks.Build.props
@@ -0,0 +1,40 @@
+
+
+
+ %(Filename).cs
+ SourceGenChart.cs
+
+
+
+ %(Filename).cs
+ CartesianChart.cs
+
+
+ CartesianChart.cs
+
+
+
+ %(Filename).cs
+ PieChart.cs
+
+
+ PieChart.cs
+
+
+
+ %(Filename).cs
+ PolarChart.cs
+
+
+ PolarChart.cs
+
+
+
+ %(Filename).cs
+ GeoMap.cs
+
+
+ GeoMap.cs
+
+
+
diff --git a/build/UITestsLinks.Build.props b/build/UITestsLinks.Build.props
new file mode 100644
index 000000000..e46b397b5
--- /dev/null
+++ b/build/UITestsLinks.Build.props
@@ -0,0 +1,7 @@
+
+
+
+ UITests\%(RecursiveDir)%(Filename).cs
+
+
+
diff --git a/build/WinUISharedLinks.Build.props b/build/WinUISharedLinks.Build.props
new file mode 100644
index 000000000..151f313bc
--- /dev/null
+++ b/build/WinUISharedLinks.Build.props
@@ -0,0 +1,24 @@
+
+
+
+ %(RecursiveDir)%(Filename).cs
+
+
+
+ CartesianChart.cs
+
+
+
+ PieChart.cs
+
+
+
+ PolarChart.cs
+
+
+
+ GeoMap.cs
+
+
+
+
diff --git a/build/XamlSharedLinks.Build.props b/build/XamlSharedLinks.Build.props
new file mode 100644
index 000000000..9d0b23e57
--- /dev/null
+++ b/build/XamlSharedLinks.Build.props
@@ -0,0 +1,7 @@
+
+
+
+ XamlFriendlySourceGenerated\%(Filename).cs
+
+
+
diff --git a/build/build-windows.ps1 b/build/build-windows.ps1
deleted file mode 100644
index 3829a83f4..000000000
--- a/build/build-windows.ps1
+++ /dev/null
@@ -1,30 +0,0 @@
-param([string]$configuration = "Release")
-
-dotnet workload install macos
-dotnet workload install ios
-dotnet workload install maccatalyst
-dotnet workload install android
-
-dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj -c $configuration
-dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsCore.SkiaSharpView.WinForms.csproj -c $configuration
-dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharp.Wpf/LiveChartsCore.SkiaSharpView.Wpf.csproj -c $configuration
-dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharp.Xamarin.Forms/LiveChartsCore.SkiaSharpView.Xamarin.Forms.csproj -c $configuration
-dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveChartsCore.SkiaSharpView.Blazor.csproj -c $configuration
-dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsCore.SkiaSharpView.Eto.csproj -c $configuration
-
-$msbuild = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
-
-& $msbuild `
- ./src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj `
- /p:configuration=$configuration `
- /restore
-
-& $msbuild `
- ./src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.csproj `
- /p:configuration=$configuration `
- /restore
-
-& $msbuild `
- ./src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/LiveChartsCore.SkiaSharpView.Uno.WinUI.csproj `
- /p:configuration=$configuration `
- /restore
\ No newline at end of file
diff --git a/generators/LiveChartsGenerators/LiveChartsGenerators.csproj b/generators/LiveChartsGenerators/LiveChartsGenerators.csproj
index 4f3c3893b..803eb7679 100644
--- a/generators/LiveChartsGenerators/LiveChartsGenerators.csproj
+++ b/generators/LiveChartsGenerators/LiveChartsGenerators.csproj
@@ -2,9 +2,6 @@
netstandard2.0
- $(GlobalLangVersion)
- enable
- enabletruetrue
diff --git a/global.json b/global.json
deleted file mode 100644
index 907a4317c..000000000
--- a/global.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "sdk": {
- "version": "9.0.101",
- "rollForward": "latestFeature"
- },
- "msbuild-sdks": {
- "Uno.Sdk": "6.2.36"
- }
-}
diff --git a/src/LiveChartsCore/images/icon.png b/icon.png
similarity index 100%
rename from src/LiveChartsCore/images/icon.png
rename to icon.png
diff --git a/nuget.props b/nuget.props
new file mode 100644
index 000000000..ed02460e6
--- /dev/null
+++ b/nuget.props
@@ -0,0 +1,29 @@
+
+
+ $(LiveChartsVersion)
+ $(LiveChartsAuthors)
+ icon.png
+ https://github.com/beto-rodriguez/LiveCharts2
+ true
+
+
+ true
+ true
+
+
+ true
+ snupkg
+
+
+ $(SolutionDir)nukpg
+
+
+ true
+
+ true
+ MIT
+ true
+
+ Simple, stunning, interactive and powerful data visualization for .Net.
+
+
diff --git a/readme.txt b/readme.txt
deleted file mode 100644
index 98e1f3ed1..000000000
--- a/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-For Uno, open ./samples/UnoPlatform/UnoPlatform.slnx
diff --git a/samples/AvaloniaSample/App.axaml.cs b/samples/AvaloniaSample/App.axaml.cs
index 2db5e6307..d17561480 100644
--- a/samples/AvaloniaSample/App.axaml.cs
+++ b/samples/AvaloniaSample/App.axaml.cs
@@ -4,6 +4,10 @@
using LiveChartsCore; // mark
using ViewModelsSamples;
+#if UI_TESTING
+using Factos.Avalonia;
+#endif
+
namespace AvaloniaSample;
public partial class App : Application
@@ -19,6 +23,9 @@ public override void Initialize()
public override void OnFrameworkInitializationCompleted()
{
+#if UI_TESTING
+ this.UseFactosApp();
+#else
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow();
@@ -29,5 +36,6 @@ public override void OnFrameworkInitializationCompleted()
}
base.OnFrameworkInitializationCompleted();
+#endif
}
}
diff --git a/samples/AvaloniaSample/AvaloniaSample.csproj b/samples/AvaloniaSample/AvaloniaSample.csproj
index d706cf2a4..15b37dd2f 100644
--- a/samples/AvaloniaSample/AvaloniaSample.csproj
+++ b/samples/AvaloniaSample/AvaloniaSample.csproj
@@ -3,9 +3,7 @@
- net8.0
- enable
- $(GlobalLangVersion)
+ net10.0true
@@ -39,5 +37,16 @@
+
+
+
+
+
+
+
+
+
+ $(DefineConstants);UI_TESTING;XAML_UI_TESTING;AVALONIA_UI_TESTING
+
diff --git a/samples/AvaloniaSample/Bars/AutoUpdate/View.axaml b/samples/AvaloniaSample/Bars/AutoUpdate/View.axaml
index cf9182536..ce049aeba 100644
--- a/samples/AvaloniaSample/Bars/AutoUpdate/View.axaml
+++ b/samples/AvaloniaSample/Bars/AutoUpdate/View.axaml
@@ -22,7 +22,7 @@
-
+ this.Find("chart")!;
+#endif
}
diff --git a/samples/AvaloniaSample/General/FirstChart/View.axaml b/samples/AvaloniaSample/General/FirstChart/View.axaml
index 41059fe23..8b32d3b3e 100644
--- a/samples/AvaloniaSample/General/FirstChart/View.axaml
+++ b/samples/AvaloniaSample/General/FirstChart/View.axaml
@@ -7,8 +7,7 @@
xmlns:scg="clr-namespace:System.Collections.Generic;assembly=netstandard">
-
+ LegendPosition="Right">
(CartesianChart)Content!;
+#endif
}
diff --git a/samples/AvaloniaSample/Pies/AutoUpdate/View.axaml b/samples/AvaloniaSample/Pies/AutoUpdate/View.axaml
index 1d7ce3923..67462e995 100644
--- a/samples/AvaloniaSample/Pies/AutoUpdate/View.axaml
+++ b/samples/AvaloniaSample/Pies/AutoUpdate/View.axaml
@@ -17,7 +17,7 @@
-
+ this.Find("chart")!;
+#endif
}
diff --git a/samples/AvaloniaSample/Pies/Basic/View.axaml.cs b/samples/AvaloniaSample/Pies/Basic/View.axaml.cs
index 6ee809c65..4ac35e06d 100644
--- a/samples/AvaloniaSample/Pies/Basic/View.axaml.cs
+++ b/samples/AvaloniaSample/Pies/Basic/View.axaml.cs
@@ -1,5 +1,6 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
+using LiveChartsCore.SkiaSharpView.Avalonia;
namespace AvaloniaSample.Pies.Basic;
@@ -14,4 +15,8 @@ private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
+
+#if UI_TESTING
+ public PieChart Chart => (PieChart)Content!;
+#endif
}
diff --git a/samples/AvaloniaSample/Platforms/AvaloniaSample.Android/AvaloniaSample.Android.csproj b/samples/AvaloniaSample/Platforms/AvaloniaSample.Android/AvaloniaSample.Android.csproj
index 811245771..a833d3788 100644
--- a/samples/AvaloniaSample/Platforms/AvaloniaSample.Android/AvaloniaSample.Android.csproj
+++ b/samples/AvaloniaSample/Platforms/AvaloniaSample.Android/AvaloniaSample.Android.csproj
@@ -2,7 +2,7 @@
Exe
- net8.0-android
+ net10.0-android21enablecom.CompanyName.AvaloniaSample
diff --git a/samples/AvaloniaSample/Platforms/AvaloniaSample.Android/Properties/AndroidManifest.xml b/samples/AvaloniaSample/Platforms/AvaloniaSample.Android/Properties/AndroidManifest.xml
index d5a465ef9..0d0e8acfb 100644
--- a/samples/AvaloniaSample/Platforms/AvaloniaSample.Android/Properties/AndroidManifest.xml
+++ b/samples/AvaloniaSample/Platforms/AvaloniaSample.Android/Properties/AndroidManifest.xml
@@ -1,6 +1,5 @@
-
-
-
+
+
diff --git a/samples/AvaloniaSample/Platforms/AvaloniaSample.Browser/AvaloniaSample.Browser.csproj b/samples/AvaloniaSample/Platforms/AvaloniaSample.Browser/AvaloniaSample.Browser.csproj
index 25fde94e7..81a3f8ad5 100644
--- a/samples/AvaloniaSample/Platforms/AvaloniaSample.Browser/AvaloniaSample.Browser.csproj
+++ b/samples/AvaloniaSample/Platforms/AvaloniaSample.Browser/AvaloniaSample.Browser.csproj
@@ -1,6 +1,6 @@
- net9.0-browser
+ net10.0-browserExetrue
diff --git a/samples/AvaloniaSample/Platforms/AvaloniaSample.Desktop/AvaloniaSample.Desktop.csproj b/samples/AvaloniaSample/Platforms/AvaloniaSample.Desktop/AvaloniaSample.Desktop.csproj
index 532652333..35e94a879 100644
--- a/samples/AvaloniaSample/Platforms/AvaloniaSample.Desktop/AvaloniaSample.Desktop.csproj
+++ b/samples/AvaloniaSample/Platforms/AvaloniaSample.Desktop/AvaloniaSample.Desktop.csproj
@@ -4,7 +4,7 @@
WinExe
- net8.0
+ net10.0enabletrueapp.manifest
diff --git a/samples/AvaloniaSample/Platforms/AvaloniaSample.iOS/AvaloniaSample.iOS.csproj b/samples/AvaloniaSample/Platforms/AvaloniaSample.iOS/AvaloniaSample.iOS.csproj
index d794b8344..0f1545bcf 100644
--- a/samples/AvaloniaSample/Platforms/AvaloniaSample.iOS/AvaloniaSample.iOS.csproj
+++ b/samples/AvaloniaSample/Platforms/AvaloniaSample.iOS/AvaloniaSample.iOS.csproj
@@ -1,7 +1,7 @@
Exe
- net9.0-ios
+ net10.0-ios13.0enable
diff --git a/samples/AvaloniaSample/Polar/Basic/View.axaml.cs b/samples/AvaloniaSample/Polar/Basic/View.axaml.cs
index 3385bc8ad..d3044120e 100644
--- a/samples/AvaloniaSample/Polar/Basic/View.axaml.cs
+++ b/samples/AvaloniaSample/Polar/Basic/View.axaml.cs
@@ -1,5 +1,6 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
+using LiveChartsCore.SkiaSharpView.Avalonia;
namespace AvaloniaSample.Polar.Basic;
@@ -14,4 +15,8 @@ private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
+
+#if UI_TESTING
+ public PolarChart Chart => (PolarChart)Content!;
+#endif
}
diff --git a/samples/AvaloniaSample/VisualTest/DataTemplate/View.axaml b/samples/AvaloniaSample/VisualTest/DataTemplate/View.axaml
index 14a1df2b5..4d073d724 100644
--- a/samples/AvaloniaSample/VisualTest/DataTemplate/View.axaml
+++ b/samples/AvaloniaSample/VisualTest/DataTemplate/View.axaml
@@ -1,28 +1,41 @@
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/AvaloniaSample/VisualTest/DataTemplate/View.axaml.cs b/samples/AvaloniaSample/VisualTest/DataTemplate/View.axaml.cs
index 6588f3fc4..34d72a437 100644
--- a/samples/AvaloniaSample/VisualTest/DataTemplate/View.axaml.cs
+++ b/samples/AvaloniaSample/VisualTest/DataTemplate/View.axaml.cs
@@ -1,5 +1,8 @@
+using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
+using Avalonia.VisualTree;
+using LiveChartsCore.Kernel.Sketches;
namespace AvaloniaSample.VisualTest.DataTemplate;
@@ -10,6 +13,21 @@ public View()
InitializeComponent();
}
+ public IEnumerable FindCharts(Visual? parent = null)
+ {
+ parent ??= (Visual)Content!;
+
+ foreach (var child in parent.GetVisualChildren())
+ {
+ if (child is IChartView chart)
+ yield return chart;
+
+ foreach (var descendant in FindCharts(child))
+ yield return descendant;
+ }
+ }
+
+
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
diff --git a/samples/BlazorSample/BlazorSample.csproj b/samples/BlazorSample/BlazorSample.csproj
index 6e6093dd2..113730193 100644
--- a/samples/BlazorSample/BlazorSample.csproj
+++ b/samples/BlazorSample/BlazorSample.csproj
@@ -1,9 +1,8 @@
- net9.0
+ net10.0enable
- enable
@@ -19,8 +18,8 @@
-
-
+
+
@@ -35,4 +34,15 @@
+
+
+
+
+
+
+
+
+ $(DefineConstants);UI_TESTING;BLAZOR_UI_TESTING
+
+
diff --git a/samples/BlazorSample/Pages/Axes/ColorsAndPosition.razor b/samples/BlazorSample/Pages/Axes/ColorsAndPosition/View.razor
similarity index 95%
rename from samples/BlazorSample/Pages/Axes/ColorsAndPosition.razor
rename to samples/BlazorSample/Pages/Axes/ColorsAndPosition/View.razor
index 39bfeb799..c0e00baa0 100644
--- a/samples/BlazorSample/Pages/Axes/ColorsAndPosition.razor
+++ b/samples/BlazorSample/Pages/Axes/ColorsAndPosition/View.razor
@@ -29,7 +29,8 @@
private Axis[] yAxes;
private Random random = new Random();
- public ColorsAndPosition()
+ // for simplicity we use the page constructor
+ public View()
{
xAxis = new Axis
{
diff --git a/samples/BlazorSample/Pages/Axes/Crosshairs.razor b/samples/BlazorSample/Pages/Axes/Crosshairs/View.razor
similarity index 96%
rename from samples/BlazorSample/Pages/Axes/Crosshairs.razor
rename to samples/BlazorSample/Pages/Axes/Crosshairs/View.razor
index 2f0b8a93e..cc5e8f899 100644
--- a/samples/BlazorSample/Pages/Axes/Crosshairs.razor
+++ b/samples/BlazorSample/Pages/Axes/Crosshairs/View.razor
@@ -26,7 +26,8 @@
private Axis[] xAxes;
private Axis[] yAxes;
- public Crosshairs()
+ // for simplicity we use the page constructor
+ public View()
{
var crosshairColor = new SKColor(255, 0, 51);
var crosshairBackground = new LiveChartsCore.Drawing.LvcColor(255, 0, 51);
diff --git a/samples/BlazorSample/Pages/Axes/CustomSeparatorsInterval.razor b/samples/BlazorSample/Pages/Axes/CustomSeparatorsInterval/View.razor
similarity index 90%
rename from samples/BlazorSample/Pages/Axes/CustomSeparatorsInterval.razor
rename to samples/BlazorSample/Pages/Axes/CustomSeparatorsInterval/View.razor
index 9b24e7569..5b766a81e 100644
--- a/samples/BlazorSample/Pages/Axes/CustomSeparatorsInterval.razor
+++ b/samples/BlazorSample/Pages/Axes/CustomSeparatorsInterval/View.razor
@@ -17,7 +17,8 @@
private Axis yAxis;
private Axis[] yAxes;
- public CustomSeparatorsInterval()
+ // for simplicity we use the page constructor
+ public View()
{
var customSeparators = new double[] { 0, 10, 25, 50, 100 };
yAxis = new Axis
diff --git a/samples/BlazorSample/Pages/Axes/DateTimeScaled.razor b/samples/BlazorSample/Pages/Axes/DateTimeScaled/View.razor
similarity index 94%
rename from samples/BlazorSample/Pages/Axes/DateTimeScaled.razor
rename to samples/BlazorSample/Pages/Axes/DateTimeScaled/View.razor
index df424fe57..5b47ae535 100644
--- a/samples/BlazorSample/Pages/Axes/DateTimeScaled.razor
+++ b/samples/BlazorSample/Pages/Axes/DateTimeScaled/View.razor
@@ -30,7 +30,8 @@
private Axis[] xAxes;
- public DateTimeScaled()
+ // for simplicity we use the page constructor
+ public View()
{
xAxes = new Axis[]
{
diff --git a/samples/BlazorSample/Pages/Axes/LabelsFormat.razor b/samples/BlazorSample/Pages/Axes/LabelsFormat/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Axes/LabelsFormat.razor
rename to samples/BlazorSample/Pages/Axes/LabelsFormat/View.razor
diff --git a/samples/BlazorSample/Pages/Axes/LabelsFormat2.razor b/samples/BlazorSample/Pages/Axes/LabelsFormat2/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Axes/LabelsFormat2.razor
rename to samples/BlazorSample/Pages/Axes/LabelsFormat2/View.razor
diff --git a/samples/BlazorSample/Pages/Axes/LabelsRotation.razor b/samples/BlazorSample/Pages/Axes/LabelsRotation/View.razor
similarity index 96%
rename from samples/BlazorSample/Pages/Axes/LabelsRotation.razor
rename to samples/BlazorSample/Pages/Axes/LabelsRotation/View.razor
index 705cb2641..7fcafaab5 100644
--- a/samples/BlazorSample/Pages/Axes/LabelsRotation.razor
+++ b/samples/BlazorSample/Pages/Axes/LabelsRotation/View.razor
@@ -25,7 +25,8 @@
private Axis[] xAxes;
private Axis[] yAxes;
- public LabelsRotation()
+ // for simplicity we use the page constructor
+ public View()
{
static string tooltipFormat(ChartPoint point) =>
$"This is {Environment.NewLine}" +
diff --git a/samples/BlazorSample/Pages/Axes/Logarithmic.razor b/samples/BlazorSample/Pages/Axes/Logarithmic/View.razor
similarity index 94%
rename from samples/BlazorSample/Pages/Axes/Logarithmic.razor
rename to samples/BlazorSample/Pages/Axes/Logarithmic/View.razor
index 35fbcba30..3f623b04b 100644
--- a/samples/BlazorSample/Pages/Axes/Logarithmic.razor
+++ b/samples/BlazorSample/Pages/Axes/Logarithmic/View.razor
@@ -11,7 +11,8 @@
@code {
- static Logarithmic()
+ // for simplicity we configure the mapping here
+ static View()
{
var logBase = 10d;
// Register the logarithmic point mapper
diff --git a/samples/BlazorSample/Pages/Axes/MatchScale.razor b/samples/BlazorSample/Pages/Axes/MatchScale/View.razor
similarity index 97%
rename from samples/BlazorSample/Pages/Axes/MatchScale.razor
rename to samples/BlazorSample/Pages/Axes/MatchScale/View.razor
index 06520cb2a..2e3e71137 100644
--- a/samples/BlazorSample/Pages/Axes/MatchScale.razor
+++ b/samples/BlazorSample/Pages/Axes/MatchScale/View.razor
@@ -25,7 +25,8 @@
private Axis[] yAxes;
private DrawMarginFrame frame;
- public MatchScale()
+ // for simplicity we use the page constructor
+ public View()
{
values = new ObservablePoint[1001];
var fx = EasingFunctions.BounceInOut;
diff --git a/samples/BlazorSample/Pages/Axes/Multiple.razor b/samples/BlazorSample/Pages/Axes/Multiple/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Axes/Multiple.razor
rename to samples/BlazorSample/Pages/Axes/Multiple/View.razor
diff --git a/samples/BlazorSample/Pages/Axes/NamedLabels.razor b/samples/BlazorSample/Pages/Axes/NamedLabels/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Axes/NamedLabels.razor
rename to samples/BlazorSample/Pages/Axes/NamedLabels/View.razor
diff --git a/samples/BlazorSample/Pages/Axes/Paging.razor b/samples/BlazorSample/Pages/Axes/Paging/View.razor
similarity index 96%
rename from samples/BlazorSample/Pages/Axes/Paging.razor
rename to samples/BlazorSample/Pages/Axes/Paging/View.razor
index 079f164de..8189e6d97 100644
--- a/samples/BlazorSample/Pages/Axes/Paging.razor
+++ b/samples/BlazorSample/Pages/Axes/Paging/View.razor
@@ -23,7 +23,8 @@
private Axis xAxis;
private Axis[] xAxes;
- public Paging()
+ // for simplicity we use the page constructor
+ public View()
{
values = Fetch();
xAxis = new Axis();
diff --git a/samples/BlazorSample/Pages/Axes/Shared.razor b/samples/BlazorSample/Pages/Axes/Shared/View.razor
similarity index 96%
rename from samples/BlazorSample/Pages/Axes/Shared.razor
rename to samples/BlazorSample/Pages/Axes/Shared/View.razor
index 186ddb624..d6b70fbc0 100644
--- a/samples/BlazorSample/Pages/Axes/Shared.razor
+++ b/samples/BlazorSample/Pages/Axes/Shared/View.razor
@@ -34,7 +34,8 @@
private ISeries[] series2;
private int max;
- public Shared()
+ // for simplicity we use the page constructor
+ public View()
{
values1 = Fetch(100);
values2 = Fetch(50);
diff --git a/samples/BlazorSample/Pages/Axes/Style.razor b/samples/BlazorSample/Pages/Axes/Style/View.razor
similarity index 97%
rename from samples/BlazorSample/Pages/Axes/Style.razor
rename to samples/BlazorSample/Pages/Axes/Style/View.razor
index 028c03a34..2bf00c08e 100644
--- a/samples/BlazorSample/Pages/Axes/Style.razor
+++ b/samples/BlazorSample/Pages/Axes/Style/View.razor
@@ -25,7 +25,8 @@
private Axis[] yAxes;
private DrawMarginFrame frame;
- public Style()
+ // for simplicity we use the page constructor
+ public View()
{
values = new ObservablePoint[1001];
var fx = EasingFunctions.BounceInOut;
diff --git a/samples/BlazorSample/Pages/Axes/TimeSpanScaled.razor b/samples/BlazorSample/Pages/Axes/TimeSpanScaled/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Axes/TimeSpanScaled.razor
rename to samples/BlazorSample/Pages/Axes/TimeSpanScaled/View.razor
diff --git a/samples/BlazorSample/Pages/Bars/AutoUpdate.razor b/samples/BlazorSample/Pages/Bars/AutoUpdate/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Bars/AutoUpdate.razor
rename to samples/BlazorSample/Pages/Bars/AutoUpdate/View.razor
diff --git a/samples/BlazorSample/Pages/Bars/Basic.razor b/samples/BlazorSample/Pages/Bars/Basic/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Bars/Basic.razor
rename to samples/BlazorSample/Pages/Bars/Basic/View.razor
diff --git a/samples/BlazorSample/Pages/Bars/Custom.razor b/samples/BlazorSample/Pages/Bars/Custom/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Bars/Custom.razor
rename to samples/BlazorSample/Pages/Bars/Custom/View.razor
diff --git a/samples/BlazorSample/Pages/Bars/DelayedAnimation.razor b/samples/BlazorSample/Pages/Bars/DelayedAnimation/View.razor
similarity index 96%
rename from samples/BlazorSample/Pages/Bars/DelayedAnimation.razor
rename to samples/BlazorSample/Pages/Bars/DelayedAnimation/View.razor
index 6a877b7e4..60cf3cb3c 100644
--- a/samples/BlazorSample/Pages/Bars/DelayedAnimation.razor
+++ b/samples/BlazorSample/Pages/Bars/DelayedAnimation/View.razor
@@ -11,7 +11,8 @@
@code {
private ISeries[] series;
- public DelayedAnimation()
+ // for simplicity we use the page constructor
+ public View()
{
var values1 = FetchValues(0);
var values2 = FetchValues(-0.15f);
diff --git a/samples/BlazorSample/Pages/Bars/Layered.razor b/samples/BlazorSample/Pages/Bars/Layered/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Bars/Layered.razor
rename to samples/BlazorSample/Pages/Bars/Layered/View.razor
diff --git a/samples/BlazorSample/Pages/Bars/Race.razor b/samples/BlazorSample/Pages/Bars/Race/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Bars/Race.razor
rename to samples/BlazorSample/Pages/Bars/Race/View.razor
diff --git a/samples/BlazorSample/Pages/Bars/RowsWithLabels.razor b/samples/BlazorSample/Pages/Bars/RowsWithLabels/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Bars/RowsWithLabels.razor
rename to samples/BlazorSample/Pages/Bars/RowsWithLabels/View.razor
diff --git a/samples/BlazorSample/Pages/Bars/Spacing.razor b/samples/BlazorSample/Pages/Bars/Spacing/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Bars/Spacing.razor
rename to samples/BlazorSample/Pages/Bars/Spacing/View.razor
diff --git a/samples/BlazorSample/Pages/Bars/WithBackground.razor b/samples/BlazorSample/Pages/Bars/WithBackground/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Bars/WithBackground.razor
rename to samples/BlazorSample/Pages/Bars/WithBackground/View.razor
diff --git a/samples/BlazorSample/Pages/Box/Basic.razor b/samples/BlazorSample/Pages/Box/Basic/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Box/Basic.razor
rename to samples/BlazorSample/Pages/Box/Basic/View.razor
diff --git a/samples/BlazorSample/Pages/Design/LinearGradients.razor b/samples/BlazorSample/Pages/Design/LinearGradients/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Design/LinearGradients.razor
rename to samples/BlazorSample/Pages/Design/LinearGradients/View.razor
diff --git a/samples/BlazorSample/Pages/Design/RadialGradients.razor b/samples/BlazorSample/Pages/Design/RadialGradients/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Design/RadialGradients.razor
rename to samples/BlazorSample/Pages/Design/RadialGradients/View.razor
diff --git a/samples/BlazorSample/Pages/Design/StrokeDashArray.razor b/samples/BlazorSample/Pages/Design/StrokeDashArray/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Design/StrokeDashArray.razor
rename to samples/BlazorSample/Pages/Design/StrokeDashArray/View.razor
diff --git a/samples/BlazorSample/Pages/Error/Basic.razor b/samples/BlazorSample/Pages/Error/Basic/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Error/Basic.razor
rename to samples/BlazorSample/Pages/Error/Basic/View.razor
diff --git a/samples/BlazorSample/Pages/Events/AddPointOnClick.razor b/samples/BlazorSample/Pages/Events/AddPointOnClick/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Events/AddPointOnClick.razor
rename to samples/BlazorSample/Pages/Events/AddPointOnClick/View.razor
diff --git a/samples/BlazorSample/Pages/Events/Tutorial.razor b/samples/BlazorSample/Pages/Events/Tutorial/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Events/Tutorial.razor
rename to samples/BlazorSample/Pages/Events/Tutorial/View.razor
diff --git a/samples/BlazorSample/Pages/Financial/BasicCandlesticks.razor b/samples/BlazorSample/Pages/Financial/BasicCandlesticks/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Financial/BasicCandlesticks.razor
rename to samples/BlazorSample/Pages/Financial/BasicCandlesticks/View.razor
diff --git a/samples/BlazorSample/Pages/General/ChartToImage.razor b/samples/BlazorSample/Pages/General/ChartToImage/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/General/ChartToImage.razor
rename to samples/BlazorSample/Pages/General/ChartToImage/View.razor
diff --git a/samples/BlazorSample/Pages/General/ConditionalDraw.razor b/samples/BlazorSample/Pages/General/ConditionalDraw/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/General/ConditionalDraw.razor
rename to samples/BlazorSample/Pages/General/ConditionalDraw/View.razor
diff --git a/samples/BlazorSample/Pages/General/DrawOnCanvas.razor b/samples/BlazorSample/Pages/General/DrawOnCanvas/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/General/DrawOnCanvas.razor
rename to samples/BlazorSample/Pages/General/DrawOnCanvas/View.razor
diff --git a/samples/BlazorSample/Pages/General/FirstChart.razor b/samples/BlazorSample/Pages/General/FirstChart/View.razor
similarity index 91%
rename from samples/BlazorSample/Pages/General/FirstChart.razor
rename to samples/BlazorSample/Pages/General/FirstChart/View.razor
index a164d89fd..fe28a7768 100644
--- a/samples/BlazorSample/Pages/General/FirstChart.razor
+++ b/samples/BlazorSample/Pages/General/FirstChart/View.razor
@@ -7,6 +7,7 @@
@using LiveChartsCore.SkiaSharpView.Blazor
@@ -24,4 +25,6 @@
Name = "Ana"
}
];
+
+ public CartesianChart Chart;
}
diff --git a/samples/BlazorSample/Pages/General/Legends.razor b/samples/BlazorSample/Pages/General/Legends/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/General/Legends.razor
rename to samples/BlazorSample/Pages/General/Legends/View.razor
diff --git a/samples/BlazorSample/Pages/General/MapPoints.razor b/samples/BlazorSample/Pages/General/MapPoints/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/General/MapPoints.razor
rename to samples/BlazorSample/Pages/General/MapPoints/View.razor
diff --git a/samples/BlazorSample/Pages/General/MultiThreading.razor b/samples/BlazorSample/Pages/General/MultiThreading/View.razor
similarity index 98%
rename from samples/BlazorSample/Pages/General/MultiThreading.razor
rename to samples/BlazorSample/Pages/General/MultiThreading/View.razor
index be045b200..ef515b39d 100644
--- a/samples/BlazorSample/Pages/General/MultiThreading.razor
+++ b/samples/BlazorSample/Pages/General/MultiThreading/View.razor
@@ -3,6 +3,7 @@
@using LiveChartsCore;
@using LiveChartsCore.SkiaSharpView;
@using System.Collections.ObjectModel
+@using System.Threading
@code {
- static TemplatedTooltips()
+ // for simplicity we configure the mapping here
+ static View()
{
LiveCharts.Configure(config =>
config.HasMap((dataPoint, index) => new(index, dataPoint.Value)));
diff --git a/samples/BlazorSample/Pages/General/Tooltips.razor b/samples/BlazorSample/Pages/General/Tooltips/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/General/Tooltips.razor
rename to samples/BlazorSample/Pages/General/Tooltips/View.razor
diff --git a/samples/BlazorSample/Pages/General/UserDefinedTypes.razor b/samples/BlazorSample/Pages/General/UserDefinedTypes/View.razor
similarity index 96%
rename from samples/BlazorSample/Pages/General/UserDefinedTypes.razor
rename to samples/BlazorSample/Pages/General/UserDefinedTypes/View.razor
index 546b8b02a..de7850b8c 100644
--- a/samples/BlazorSample/Pages/General/UserDefinedTypes.razor
+++ b/samples/BlazorSample/Pages/General/UserDefinedTypes/View.razor
@@ -15,7 +15,8 @@
public double Population { get; set; }
}
- static UserDefinedTypes()
+ // for simplicity we configure the mapping here
+ static View()
{
LiveCharts.Configure(config =>
config.HasMap((city, index) => new(index, city.Population)));
diff --git a/samples/BlazorSample/Pages/General/Visibility.razor b/samples/BlazorSample/Pages/General/Visibility/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/General/Visibility.razor
rename to samples/BlazorSample/Pages/General/Visibility/View.razor
diff --git a/samples/BlazorSample/Pages/General/VisualElements.razor b/samples/BlazorSample/Pages/General/VisualElements/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/General/VisualElements.razor
rename to samples/BlazorSample/Pages/General/VisualElements/View.razor
diff --git a/samples/BlazorSample/Pages/Heat/Basic.razor b/samples/BlazorSample/Pages/Heat/Basic/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Heat/Basic.razor
rename to samples/BlazorSample/Pages/Heat/Basic/View.razor
diff --git a/samples/BlazorSample/Pages/Home.razor b/samples/BlazorSample/Pages/Home.razor
index 9001e0bd2..ca173a3b0 100644
--- a/samples/BlazorSample/Pages/Home.razor
+++ b/samples/BlazorSample/Pages/Home.razor
@@ -1,7 +1,22 @@
@page "/"
+@if(isUITest)
+{
+
+}
+else
+{
Home
Hello, world!
-Welcome to your new app.
+
Welcome to your new app.
+}
+
+@code {
+#if UI_TESTING
+ private bool isUITest = true;
+#else
+ private bool isUITest = false;
+#endif
+}
diff --git a/samples/BlazorSample/Pages/Lines/Area.razor b/samples/BlazorSample/Pages/Lines/Area/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Lines/Area.razor
rename to samples/BlazorSample/Pages/Lines/Area/View.razor
diff --git a/samples/BlazorSample/Pages/Lines/AutoUpdate.razor b/samples/BlazorSample/Pages/Lines/AutoUpdate/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Lines/AutoUpdate.razor
rename to samples/BlazorSample/Pages/Lines/AutoUpdate/View.razor
diff --git a/samples/BlazorSample/Pages/Lines/Basic.razor b/samples/BlazorSample/Pages/Lines/Basic/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Lines/Basic.razor
rename to samples/BlazorSample/Pages/Lines/Basic/View.razor
diff --git a/samples/BlazorSample/Pages/Lines/Custom.razor b/samples/BlazorSample/Pages/Lines/Custom/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Lines/Custom.razor
rename to samples/BlazorSample/Pages/Lines/Custom/View.razor
diff --git a/samples/BlazorSample/Pages/Lines/CustomPoints.razor b/samples/BlazorSample/Pages/Lines/CustomPoints/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Lines/CustomPoints.razor
rename to samples/BlazorSample/Pages/Lines/CustomPoints/View.razor
diff --git a/samples/BlazorSample/Pages/Lines/Padding.razor b/samples/BlazorSample/Pages/Lines/Padding/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Lines/Padding.razor
rename to samples/BlazorSample/Pages/Lines/Padding/View.razor
diff --git a/samples/BlazorSample/Pages/Lines/Properties.razor b/samples/BlazorSample/Pages/Lines/Properties/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Lines/Properties.razor
rename to samples/BlazorSample/Pages/Lines/Properties/View.razor
diff --git a/samples/BlazorSample/Pages/Lines/Straight.razor b/samples/BlazorSample/Pages/Lines/Straight/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Lines/Straight.razor
rename to samples/BlazorSample/Pages/Lines/Straight/View.razor
diff --git a/samples/BlazorSample/Pages/Lines/XY.razor b/samples/BlazorSample/Pages/Lines/XY/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Lines/XY.razor
rename to samples/BlazorSample/Pages/Lines/XY/View.razor
diff --git a/samples/BlazorSample/Pages/Lines/Zoom.razor b/samples/BlazorSample/Pages/Lines/Zoom/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Lines/Zoom.razor
rename to samples/BlazorSample/Pages/Lines/Zoom/View.razor
diff --git a/samples/BlazorSample/Pages/Maps/World.razor b/samples/BlazorSample/Pages/Maps/World/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Maps/World.razor
rename to samples/BlazorSample/Pages/Maps/World/View.razor
diff --git a/samples/BlazorSample/Pages/Pies/AngularGauge.razor b/samples/BlazorSample/Pages/Pies/AngularGauge/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Pies/AngularGauge.razor
rename to samples/BlazorSample/Pages/Pies/AngularGauge/View.razor
diff --git a/samples/BlazorSample/Pages/Pies/AutoUpdate.razor b/samples/BlazorSample/Pages/Pies/AutoUpdate/View.razor
similarity index 96%
rename from samples/BlazorSample/Pages/Pies/AutoUpdate.razor
rename to samples/BlazorSample/Pages/Pies/AutoUpdate/View.razor
index ea24df0a9..461e9cc92 100644
--- a/samples/BlazorSample/Pages/Pies/AutoUpdate.razor
+++ b/samples/BlazorSample/Pages/Pies/AutoUpdate/View.razor
@@ -11,6 +11,7 @@
@@ -55,4 +56,6 @@
{
return new[] { _random.Next(1, 10) };
}
+
+ public PieChart Chart;
}
diff --git a/samples/BlazorSample/Pages/Pies/Basic.razor b/samples/BlazorSample/Pages/Pies/Basic/View.razor
similarity index 95%
rename from samples/BlazorSample/Pages/Pies/Basic.razor
rename to samples/BlazorSample/Pages/Pies/Basic/View.razor
index 7d73da7e9..470d0fbca 100644
--- a/samples/BlazorSample/Pages/Pies/Basic.razor
+++ b/samples/BlazorSample/Pages/Pies/Basic/View.razor
@@ -8,6 +8,7 @@
@using SkiaSharp
@@ -29,4 +30,6 @@
Paint = new SolidColorPaint(SKColors.Black)
});
}
+
+ public PieChart Chart;
}
diff --git a/samples/BlazorSample/Pages/Pies/Custom.razor b/samples/BlazorSample/Pages/Pies/Custom/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Pies/Custom.razor
rename to samples/BlazorSample/Pages/Pies/Custom/View.razor
diff --git a/samples/BlazorSample/Pages/Pies/Doughnut.razor b/samples/BlazorSample/Pages/Pies/Doughnut/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Pies/Doughnut.razor
rename to samples/BlazorSample/Pages/Pies/Doughnut/View.razor
diff --git a/samples/BlazorSample/Pages/Pies/Gauge1.razor b/samples/BlazorSample/Pages/Pies/Gauge1/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Pies/Gauge1.razor
rename to samples/BlazorSample/Pages/Pies/Gauge1/View.razor
diff --git a/samples/BlazorSample/Pages/Pies/Gauge2.razor b/samples/BlazorSample/Pages/Pies/Gauge2/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Pies/Gauge2.razor
rename to samples/BlazorSample/Pages/Pies/Gauge2/View.razor
diff --git a/samples/BlazorSample/Pages/Pies/Gauge3.razor b/samples/BlazorSample/Pages/Pies/Gauge3/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Pies/Gauge3.razor
rename to samples/BlazorSample/Pages/Pies/Gauge3/View.razor
diff --git a/samples/BlazorSample/Pages/Pies/Gauge4.razor b/samples/BlazorSample/Pages/Pies/Gauge4/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Pies/Gauge4.razor
rename to samples/BlazorSample/Pages/Pies/Gauge4/View.razor
diff --git a/samples/BlazorSample/Pages/Pies/Gauge5.razor b/samples/BlazorSample/Pages/Pies/Gauge5/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Pies/Gauge5.razor
rename to samples/BlazorSample/Pages/Pies/Gauge5/View.razor
diff --git a/samples/BlazorSample/Pages/Pies/Icons.razor b/samples/BlazorSample/Pages/Pies/Icons/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Pies/Icons.razor
rename to samples/BlazorSample/Pages/Pies/Icons/View.razor
diff --git a/samples/BlazorSample/Pages/Pies/Nested.razor b/samples/BlazorSample/Pages/Pies/Nested/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Pies/Nested.razor
rename to samples/BlazorSample/Pages/Pies/Nested/View.razor
diff --git a/samples/BlazorSample/Pages/Pies/NightingaleRose.razor b/samples/BlazorSample/Pages/Pies/NightingaleRose/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Pies/NightingaleRose.razor
rename to samples/BlazorSample/Pages/Pies/NightingaleRose/View.razor
diff --git a/samples/BlazorSample/Pages/Pies/OutLabels.razor b/samples/BlazorSample/Pages/Pies/OutLabels/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Pies/OutLabels.razor
rename to samples/BlazorSample/Pages/Pies/OutLabels/View.razor
diff --git a/samples/BlazorSample/Pages/Pies/Pushout.razor b/samples/BlazorSample/Pages/Pies/Pushout/View.razor
similarity index 100%
rename from samples/BlazorSample/Pages/Pies/Pushout.razor
rename to samples/BlazorSample/Pages/Pies/Pushout/View.razor
diff --git a/samples/BlazorSample/Pages/Polar/Basic.razor b/samples/BlazorSample/Pages/Polar/Basic/View.razor
similarity index 97%
rename from samples/BlazorSample/Pages/Polar/Basic.razor
rename to samples/BlazorSample/Pages/Polar/Basic/View.razor
index de5091a68..3e254f7ec 100644
--- a/samples/BlazorSample/Pages/Polar/Basic.razor
+++ b/samples/BlazorSample/Pages/Polar/Basic/View.razor
@@ -8,6 +8,7 @@
@using SkiaSharp
("#app");
builder.RootComponents.Add("head::after");
-builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
+builder.Services
+ .AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
+
+#if UI_TESTING
+builder.Services.AddScoped();
+#endif
await builder.Build().RunAsync();
diff --git a/samples/EtoFormsSample/Bars/AutoUpdate/View.cs b/samples/EtoFormsSample/Bars/AutoUpdate/View.cs
index f8a76bda5..820d57e89 100644
--- a/samples/EtoFormsSample/Bars/AutoUpdate/View.cs
+++ b/samples/EtoFormsSample/Bars/AutoUpdate/View.cs
@@ -103,4 +103,8 @@ private ObservableCollection FetchValues()
new ObservableValue(random.Next(0, 10))
};
}
+
+#if UI_TESTING
+ public CartesianChart Chart => cartesianChart;
+#endif
}
diff --git a/samples/EtoFormsSample/EtoFormsSample.csproj b/samples/EtoFormsSample/EtoFormsSample.csproj
index ce4d04a59..b607f8d78 100644
--- a/samples/EtoFormsSample/EtoFormsSample.csproj
+++ b/samples/EtoFormsSample/EtoFormsSample.csproj
@@ -1,4 +1,4 @@
-
+
- $(GlobalLangVersion)
@@ -40,4 +39,15 @@
+
+
+
+
+
+
+
+
+ $(DefineConstants);UI_TESTING;ETO_UI_TESTING
+
+
\ No newline at end of file
diff --git a/samples/EtoFormsSample/Form1.cs b/samples/EtoFormsSample/Form1.cs
index 844f50d28..5a4c74ab8 100644
--- a/samples/EtoFormsSample/Form1.cs
+++ b/samples/EtoFormsSample/Form1.cs
@@ -18,10 +18,10 @@ public Form1()
var listbox = new ListBox() { DataStore = ViewModelsSamples.Index.Samples };
listbox.SelectedIndexChanged += listBox1_SelectedIndexChanged;
- var image = new ImageView() { Image = Bitmap.FromResource("EtoFormsSample.Images.livecharts.png") };
+ //var image = new ImageView() { Image = Bitmap.FromResource("EtoFormsSample.Images.livecharts.png") };
_leftside = new DynamicLayout(
- new DynamicRow(image),
+ //new DynamicRow(image),
new DynamicRow(listbox)
);
diff --git a/samples/EtoFormsSample/General/FirstChart/View.cs b/samples/EtoFormsSample/General/FirstChart/View.cs
index 9d2d15b12..2e3dadff6 100644
--- a/samples/EtoFormsSample/General/FirstChart/View.cs
+++ b/samples/EtoFormsSample/General/FirstChart/View.cs
@@ -28,4 +28,8 @@ public View()
]
};
}
+
+#if UI_TESTING
+ public CartesianChart Chart => (CartesianChart)Content;
+#endif
}
diff --git a/samples/EtoFormsSample/Pies/AutoUpdate/View.cs b/samples/EtoFormsSample/Pies/AutoUpdate/View.cs
index e4823509e..797e4dc7f 100644
--- a/samples/EtoFormsSample/Pies/AutoUpdate/View.cs
+++ b/samples/EtoFormsSample/Pies/AutoUpdate/View.cs
@@ -10,7 +10,7 @@ namespace EtoFormsSample.Pies.AutoUpdate;
public class View : Panel
{
- private readonly PieChart piechart;
+ public readonly PieChart Chart;
private readonly Random _random = new();
public View()
@@ -21,7 +21,7 @@ public View()
new PieSeries{ Values= Fetch() },
};
- piechart = new PieChart
+ Chart = new PieChart
{
Series = seriesCollection
};
@@ -33,13 +33,13 @@ public View()
b2.Click += (sender, e) =>
{
if (seriesCollection.Count > 0)
- seriesCollection.Remove(piechart.Series.First());
+ seriesCollection.Remove(Chart.Series.First());
};
var b3 = new Button { Text = "Update all" };
b3.Click += (sender, e) =>
{
- foreach (var series in piechart.Series)
+ foreach (var series in Chart.Series)
{
if (series is PieSeries pieSeries)
{
@@ -50,7 +50,7 @@ public View()
var buttons = new StackLayout(b1, b2, b3) { Orientation = Orientation.Horizontal, Padding = 2, Spacing = 4 };
- Content = new DynamicLayout(buttons, piechart);
+ Content = new DynamicLayout(buttons, Chart);
}
private int[] Fetch()
diff --git a/samples/EtoFormsSample/Pies/Basic/View.cs b/samples/EtoFormsSample/Pies/Basic/View.cs
index 304e628f2..74df812a8 100644
--- a/samples/EtoFormsSample/Pies/Basic/View.cs
+++ b/samples/EtoFormsSample/Pies/Basic/View.cs
@@ -10,11 +10,11 @@ namespace EtoFormsSample.Pies.Basic;
public class View : Panel
{
- private readonly PieChart pieChart;
+ public readonly PieChart Chart;
public View()
{
- pieChart = new PieChart
+ Chart = new PieChart
{
Series = new[] { 2, 4, 1, 4, 3 }.AsPieSeries(),
Title = new DrawnLabelVisual(
@@ -27,6 +27,6 @@ public View()
})
};
- Content = pieChart;
+ Content = Chart;
}
}
diff --git a/samples/EtoFormsSample/Polar/Basic/View.cs b/samples/EtoFormsSample/Polar/Basic/View.cs
index 20ae28d8f..e042663ff 100644
--- a/samples/EtoFormsSample/Polar/Basic/View.cs
+++ b/samples/EtoFormsSample/Polar/Basic/View.cs
@@ -11,6 +11,8 @@ namespace EtoFormsSample.Polar.Basic;
public class View : Panel
{
+ public PolarChart Chart;
+
public View()
{
var values = new double[] { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
@@ -63,6 +65,6 @@ public View()
Title = title
};
- Content = polarChart;
+ Content = Chart = polarChart;
}
}
diff --git a/samples/EtoFormsSample/Program.cs b/samples/EtoFormsSample/Program.cs
index 84eb6affe..47f4bb008 100644
--- a/samples/EtoFormsSample/Program.cs
+++ b/samples/EtoFormsSample/Program.cs
@@ -3,6 +3,10 @@
using LiveChartsCore; // mark
using ViewModelsSamples;
+#if UI_TESTING
+using Factos.EtoForms;
+#endif
+
namespace EtoFormsSample;
static class Program
@@ -14,6 +18,14 @@ static void Main()
LiveCharts.Configure(c => c // mark
.AddLiveChartsAppSettings()); // mark
- new Application(Eto.Platform.Detect).Run(new Form1());
+ var platform = Eto.Platform.Detect;
+
+ var form = new Form1();
+
+#if UI_TESTING
+ form.UseFactosApp();
+#endif
+
+ new Application(platform).Run(form);
}
}
diff --git a/samples/MauiSample/Bars/AutoUpdate/View.xaml b/samples/MauiSample/Bars/AutoUpdate/View.xaml
index 6c1ae244f..9a2947551 100644
--- a/samples/MauiSample/Bars/AutoUpdate/View.xaml
+++ b/samples/MauiSample/Bars/AutoUpdate/View.xaml
@@ -23,7 +23,7 @@
-
+ chart;
+#endif
}
diff --git a/samples/MauiSample/General/FirstChart/View.xaml.cs b/samples/MauiSample/General/FirstChart/View.xaml.cs
index bd44cf6ef..667806c33 100644
--- a/samples/MauiSample/General/FirstChart/View.xaml.cs
+++ b/samples/MauiSample/General/FirstChart/View.xaml.cs
@@ -1,4 +1,6 @@
-namespace MauiSample.General.FirstChart;
+using LiveChartsCore.SkiaSharpView.Maui;
+
+namespace MauiSample.General.FirstChart;
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class View : ContentPage
@@ -7,4 +9,8 @@ public View()
{
InitializeComponent();
}
+
+#if UI_TESTING
+ public CartesianChart Chart => (CartesianChart)Content!;
+#endif
}
diff --git a/samples/MauiSample/MauiProgram.cs b/samples/MauiSample/MauiProgram.cs
index de37e7f49..ca0912c78 100644
--- a/samples/MauiSample/MauiProgram.cs
+++ b/samples/MauiSample/MauiProgram.cs
@@ -4,6 +4,10 @@
using LiveChartsCore;
using ViewModelsSamples;
+#if UI_TESTING
+using Factos.MAUI;
+#endif
+
namespace MauiSample;
public static class MauiProgram
@@ -16,7 +20,7 @@ public static MauiApp CreateMauiApp()
.UseLiveCharts() // mark
// .UseLiveCharts(config => config // LiveCharts configuration section // mark
// .AddLiveChartsAppSettings()) // if required, configure LiveCharts settings here // mark
- .UseMauiApp()
+ .UseMauiApp()
.ConfigureFonts(fonts =>
{
_ = fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
@@ -25,4 +29,18 @@ public static MauiApp CreateMauiApp()
return builder.Build();
}
+
+ public static MauiAppBuilder UseMauiApp(this MauiAppBuilder builder)
+ {
+ // Note: this sample is pulled from the main LiveCharts repository.
+ // in the repo this sample is used to build UI tests.
+
+#if UI_TESTING
+ builder.UseFactosApp();
+#else
+ builder.UseMauiApp();
+#endif
+
+ return builder;
+ }
}
diff --git a/samples/MauiSample/MauiSample.csproj b/samples/MauiSample/MauiSample.csproj
index c42de33f0..e3727dd0d 100644
--- a/samples/MauiSample/MauiSample.csproj
+++ b/samples/MauiSample/MauiSample.csproj
@@ -1,12 +1,17 @@
-
- enable
- $(GlobalLangVersion)
- net9.0-android;net9.0-ios;net9.0-maccatalyst
- $(TargetFrameworks);net9.0-windows10.0.19041.0
-
-
+
+
+ net10.0-android;
+
+
+ $(TargetFrameworks);
+ net10.0-ios;net10.0-maccatalyst
+
+
+ $(TargetFrameworks);
+ net10.0-windows10.0.19041.0
+
- Exe
- MauiSample
- true
- true
- enable
+ Exe
+ MauiSample
+ true
+ true
+ enable
-
- MauiSample
+
+ MauiSample
-
- com.companyname.mauisample
- e0049276-8cb3-4a16-85d6-8dd07de43eb8
+
+ com.companyname.mauisample
+ e0049276-8cb3-4a16-85d6-8dd07de43eb8
-
- 1.0
- 1
+
+ 1.0
+ 1
+
+
+ None12.215.0
@@ -38,7 +46,7 @@
10.0.17763.010.0.17763.06.5
-
+
@@ -57,12 +65,12 @@
-
-
-
-
-
-
+
+
+
+
+
+
@@ -72,4 +80,15 @@
+
+
+
+
+
+
+
+
+ $(DefineConstants);UI_TESTING;XAML_UI_TESTING;MAUI_UI_TESTING
+
+
diff --git a/samples/MauiSample/Pies/AutoUpdate/View.xaml b/samples/MauiSample/Pies/AutoUpdate/View.xaml
index 4e4d69bba..a4356233b 100644
--- a/samples/MauiSample/Pies/AutoUpdate/View.xaml
+++ b/samples/MauiSample/Pies/AutoUpdate/View.xaml
@@ -18,7 +18,7 @@
-
+ chart;
+#endif
}
diff --git a/samples/MauiSample/Pies/Basic/View.xaml.cs b/samples/MauiSample/Pies/Basic/View.xaml.cs
index 31a1c5435..99e495505 100644
--- a/samples/MauiSample/Pies/Basic/View.xaml.cs
+++ b/samples/MauiSample/Pies/Basic/View.xaml.cs
@@ -1,4 +1,6 @@
-namespace MauiSample.Pies.Basic;
+using LiveChartsCore.SkiaSharpView.Maui;
+
+namespace MauiSample.Pies.Basic;
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class View : ContentPage
@@ -7,4 +9,8 @@ public View()
{
InitializeComponent();
}
+
+#if UI_TESTING
+ public PieChart Chart => (PieChart)Content!;
+#endif
}
diff --git a/samples/MauiSample/Platforms/Android/AndroidManifest.xml b/samples/MauiSample/Platforms/Android/AndroidManifest.xml
index d635c1f38..42d2309bb 100644
--- a/samples/MauiSample/Platforms/Android/AndroidManifest.xml
+++ b/samples/MauiSample/Platforms/Android/AndroidManifest.xml
@@ -1,5 +1,6 @@
-
+
+
diff --git a/samples/MauiSample/Polar/Basic/View.xaml.cs b/samples/MauiSample/Polar/Basic/View.xaml.cs
index 51740cf22..15b503b8f 100644
--- a/samples/MauiSample/Polar/Basic/View.xaml.cs
+++ b/samples/MauiSample/Polar/Basic/View.xaml.cs
@@ -1,4 +1,6 @@
-namespace MauiSample.Polar.Basic;
+using LiveChartsCore.SkiaSharpView.Maui;
+
+namespace MauiSample.Polar.Basic;
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class View : ContentPage
@@ -7,4 +9,8 @@ public View()
{
InitializeComponent();
}
+
+#if UI_TESTING
+ public PolarChart Chart => (PolarChart)Content!;
+#endif
}
diff --git a/samples/MauiSample/Properties/launchSettings.json b/samples/MauiSample/Properties/launchSettings.json
index edf8aadcc..f979606df 100644
--- a/samples/MauiSample/Properties/launchSettings.json
+++ b/samples/MauiSample/Properties/launchSettings.json
@@ -1,8 +1,8 @@
{
- "profiles": {
- "Windows Machine": {
- "commandName": "MsixPackage",
- "nativeDebugging": false
+ "profiles": {
+ "Windows Machine": {
+ "commandName": "Project",
+ "nativeDebugging": false
+ }
}
- }
-}
\ No newline at end of file
+}
diff --git a/samples/MauiSample/VisualTest/DataTemplate/View.xaml b/samples/MauiSample/VisualTest/DataTemplate/View.xaml
index a8bb6cc0c..d98b56eda 100644
--- a/samples/MauiSample/VisualTest/DataTemplate/View.xaml
+++ b/samples/MauiSample/VisualTest/DataTemplate/View.xaml
@@ -1,28 +1,42 @@
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/MauiSample/VisualTest/DataTemplate/View.xaml.cs b/samples/MauiSample/VisualTest/DataTemplate/View.xaml.cs
index 34a7d1099..7c56bb887 100644
--- a/samples/MauiSample/VisualTest/DataTemplate/View.xaml.cs
+++ b/samples/MauiSample/VisualTest/DataTemplate/View.xaml.cs
@@ -1,4 +1,6 @@
-namespace MauiSample.VisualTest.DataTemplate;
+using LiveChartsCore.Kernel.Sketches;
+
+namespace MauiSample.VisualTest.DataTemplate;
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class View : ContentPage
@@ -7,4 +9,15 @@ public View()
{
InitializeComponent();
}
+
+ public IEnumerable FindCharts(Element? parent = null)
+ {
+ parent ??= Content!;
+
+ foreach (var child in parent.GetVisualTreeDescendants())
+ {
+ if (child is IChartView chart)
+ yield return chart;
+ }
+ }
}
diff --git a/samples/UnoPlatformSample/Directory.Packages.props b/samples/UnoPlatformSample/Directory.Packages.props
index c564e08ac..016d901bd 100644
--- a/samples/UnoPlatformSample/Directory.Packages.props
+++ b/samples/UnoPlatformSample/Directory.Packages.props
@@ -7,5 +7,6 @@
-->
+
diff --git a/samples/UnoPlatformSample/UnoPlatformSample/App.xaml.cs b/samples/UnoPlatformSample/UnoPlatformSample/App.xaml.cs
index 0e76aef10..7d0ba74f4 100644
--- a/samples/UnoPlatformSample/UnoPlatformSample/App.xaml.cs
+++ b/samples/UnoPlatformSample/UnoPlatformSample/App.xaml.cs
@@ -1,6 +1,10 @@
using LiveChartsCore; // mark
using ViewModelsSamples;
+#if UI_TESTING
+using Factos.Uno;
+#endif
+
namespace UnoPlatformSample;
public partial class App : Application
@@ -90,8 +94,13 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
// TODO: Register your services
//services.AddSingleton();
})
+#if UI_TESTING
+ .UseFactosApp()
+#else
.UseNavigation(ReactiveViewModelMappings.ViewModelMappings, RegisterRoutes)
+#endif
);
+
MainWindow = builder.Window;
#if DEBUG
diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Platforms/Android/AndroidManifest.xml b/samples/UnoPlatformSample/UnoPlatformSample/Platforms/Android/AndroidManifest.xml
index 95ae07533..90064497f 100644
--- a/samples/UnoPlatformSample/UnoPlatformSample/Platforms/Android/AndroidManifest.xml
+++ b/samples/UnoPlatformSample/UnoPlatformSample/Platforms/Android/AndroidManifest.xml
@@ -1,4 +1,6 @@
-
+
+
+
diff --git a/samples/UnoPlatformSample/UnoPlatformSample/UnoPlatformSample.csproj b/samples/UnoPlatformSample/UnoPlatformSample/UnoPlatformSample.csproj
index addcf1d01..840ca0a9d 100644
--- a/samples/UnoPlatformSample/UnoPlatformSample/UnoPlatformSample.csproj
+++ b/samples/UnoPlatformSample/UnoPlatformSample/UnoPlatformSample.csproj
@@ -1,6 +1,6 @@
-
+
- net9.0-android;net9.0-ios;net9.0-windows10.0.26100;net9.0-browserwasm;net9.0-desktop
+ net10.0-android;net10.0-ios;net10.0-windows10.0.26100;net10.0-browserwasm;net10.0-desktopExetrue
@@ -40,9 +40,9 @@
-
-
-
+
+
+
@@ -66,4 +66,21 @@
+
+
+
+
+
+ UITests\%(RecursiveDir)%(Filename).cs
+
+
+
+
+
+
+
+
+ $(DefineConstants);UI_TESTING;XAML_UI_TESTING;UNO_UI_TESTING
+
+
diff --git a/samples/UnoPlatformSample/global.json b/samples/UnoPlatformSample/global.json
deleted file mode 100644
index d10e2e167..000000000
--- a/samples/UnoPlatformSample/global.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- // To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
- "msbuild-sdks": {
- "Uno.Sdk": "6.2.36"
- },
- "sdk":{
- "allowPrerelease": false
- }
-}
diff --git a/samples/ViewModelsSamples/Bars/DelayedAnimation/ViewModel.cs b/samples/ViewModelsSamples/Bars/DelayedAnimation/ViewModel.cs
index c5afe3337..66d806aed 100644
--- a/samples/ViewModelsSamples/Bars/DelayedAnimation/ViewModel.cs
+++ b/samples/ViewModelsSamples/Bars/DelayedAnimation/ViewModel.cs
@@ -1,6 +1,4 @@
-using System;
-using System.Collections.Generic;
-using CommunityToolkit.Mvvm.Input;
+using CommunityToolkit.Mvvm.Input;
using LiveChartsCore;
using LiveChartsCore.Drawing;
using LiveChartsCore.Kernel;
@@ -39,7 +37,14 @@ private static float DelayedEase(float t, float delay)
var remappedT = (t - delay) / (1f - delay);
var baseEasing = EasingFunctions.BuildCustomElasticOut(1.5f, 0.60f);
- return baseEasing(Math.Clamp(remappedT, 0f, 1f));
+ return baseEasing(Clamp(remappedT, 0f, 1f));
+ }
+
+ public static float Clamp(float value, float min, float max)
+ {
+ if (value < min) return min;
+ if (value > max) return max;
+ return value;
}
private static float[] FetchVales(float offset)
diff --git a/samples/ViewModelsSamples/City.cs b/samples/ViewModelsSamples/City.cs
new file mode 100644
index 000000000..165320c13
--- /dev/null
+++ b/samples/ViewModelsSamples/City.cs
@@ -0,0 +1,9 @@
+namespace ViewModelsSamples;
+
+// used for documentation of mappers
+
+public class City
+{
+ public string Name { get; set; } = string.Empty;
+ public double Population { get; set; }
+}
diff --git a/samples/ViewModelsSamples/General/Scrollable/ViewModel.cs b/samples/ViewModelsSamples/General/Scrollable/ViewModel.cs
index 7495a4dad..bd94464cf 100644
--- a/samples/ViewModelsSamples/General/Scrollable/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/Scrollable/ViewModel.cs
@@ -1,6 +1,4 @@
-using System;
-using System.Linq;
-using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using LiveChartsCore;
using LiveChartsCore.Defaults;
diff --git a/samples/ViewModelsSamples/LiveChartsAppSettings.cs b/samples/ViewModelsSamples/LiveChartsAppSettings.cs
index 290ba8c83..29f7bca3e 100644
--- a/samples/ViewModelsSamples/LiveChartsAppSettings.cs
+++ b/samples/ViewModelsSamples/LiveChartsAppSettings.cs
@@ -54,6 +54,4 @@ public static LiveChartsSettings AddLiveChartsAppSettings(this LiveChartsSetting
// but you can also force the use of RTL settings by calling:
//.UseRightToLeftSettings()
;
-
- public record City(string Name, double Population);
}
diff --git a/samples/ViewModelsSamples/ViewModelsSamples.csproj b/samples/ViewModelsSamples/ViewModelsSamples.csproj
index c716e0222..884739a13 100644
--- a/samples/ViewModelsSamples/ViewModelsSamples.csproj
+++ b/samples/ViewModelsSamples/ViewModelsSamples.csproj
@@ -1,11 +1,10 @@
- net8.0
-
+
+ preview
+ net462;net8.0false
- $(GlobalLangVersion)
- Enable
@@ -23,4 +22,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/ViewModelsSamples/VisualTest/DataTemplate/ViewModel.cs b/samples/ViewModelsSamples/VisualTest/DataTemplate/ViewModel.cs
index 6e4c2b08a..844fdaee7 100644
--- a/samples/ViewModelsSamples/VisualTest/DataTemplate/ViewModel.cs
+++ b/samples/ViewModelsSamples/VisualTest/DataTemplate/ViewModel.cs
@@ -1,36 +1,38 @@
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
-using LiveChartsCore.SkiaSharpView;
+using LiveChartsCore.Defaults;
namespace ViewModelsSamples.VisualTest.DataTemplate;
+public class DepartmentInfo
+{
+ public string DepartmentName { get; set; } = string.Empty;
+ public ChartData[] Data { get; set; } = [];
+}
-public partial class ViewModel : ObservableObject
+public class ChartData(string name, ObservableValue[] points)
{
- public IEnumerable> Models { get; set; } = new List>
- {
- new ObservableCollection
- {
- new LineSeries
- {
- Values = new ObservableCollection { 2, 5, 4, -2, 4, -3, 5 }
- }
- },
- new ObservableCollection
+ public string SeriesName { get; set; } = name;
+ public ObservableValue[] Values { get; set; } = points;
+}
+
+public partial class ViewModel
+{
+ public DepartmentInfo[] Departments { get; set; } = [
+ new DepartmentInfo
{
- new LineSeries
- {
- Values = new ObservableCollection { 2, 5, 4, -2, 4, -3, 5 }
- }
+ DepartmentName = "Sales",
+ Data = [
+ new("Juana", [ new(2), new(5), new(4) ]),
+ new("Pedro", [ new(5), new(4), new(1) ])
+ ]
},
- new ObservableCollection
+ new DepartmentInfo
{
- new LineSeries
- {
- Values = new ObservableCollection { 2, 5, 4, -2, 4, -3, 5 }
- }
+ DepartmentName = "Marketing",
+ Data = [
+ new("Charles", [ new(3), new(6), new(2) ]),
+ new("Margarita", [ new(4), new(2), new(5) ]),
+ new("Ana", [ new(5), new(7), new(3) ])
+ ]
}
- };
+ ];
}
diff --git a/samples/VorticeSample/LiveChartsCore.Vortice/CartesianChart.cs b/samples/VorticeSample/LiveChartsCore.Vortice/CartesianChart.cs
index 4f9c1ccc9..32b86a514 100644
--- a/samples/VorticeSample/LiveChartsCore.Vortice/CartesianChart.cs
+++ b/samples/VorticeSample/LiveChartsCore.Vortice/CartesianChart.cs
@@ -20,9 +20,18 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
+using LiveChartsGeneratedCode;
+
namespace LiveChartsCore.Vortice;
-public class CartesianChart : LiveChartsGeneratedCode.SourceGenCartesianChart
-{
+// ==============================================================================
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
+// ==============================================================================
+public class CartesianChart : SourceGenCartesianChart
+{
}
diff --git a/samples/VorticeSample/LiveChartsCore.Vortice/Hack.cs b/samples/VorticeSample/LiveChartsCore.Vortice/Hack.cs
index e04fc030b..adac23e95 100644
--- a/samples/VorticeSample/LiveChartsCore.Vortice/Hack.cs
+++ b/samples/VorticeSample/LiveChartsCore.Vortice/Hack.cs
@@ -1,4 +1,5 @@
namespace LiveChartsCore.SkiaSharpView.TypeConverters; // hack ns to make source genetation happy.
+
internal class Hack
{
}
diff --git a/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsCore.Vortice.csproj b/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsCore.Vortice.csproj
index 326996417..57bfee05b 100644
--- a/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsCore.Vortice.csproj
+++ b/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsCore.Vortice.csproj
@@ -1,10 +1,8 @@
-
+$(GlobalLangVersion)
- net9.0-windows
- enable
- enable
+ net10.0-windows
@@ -15,6 +13,19 @@
-
+
+
+ %(Filename).cs
+ SourceGenChart.cs
+
+
+
+ %(Filename).cs
+ CartesianChart.cs
+
+
+ CartesianChart.cs
+
+
diff --git a/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsGeneratedCode/SourceGenPieChart.cs b/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsGeneratedCode/SourceGenPieChart.cs
deleted file mode 100644
index d7f4ce3f1..000000000
--- a/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsGeneratedCode/SourceGenPieChart.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// The MIT License(MIT)
-//
-// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-namespace LiveChartsGeneratedCode;
-
-public partial class SourceGenPieChart : SourceGenChart
-{
- // add vortice specific code here
-}
diff --git a/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsGeneratedCode/SourceGenPolarChart.cs b/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsGeneratedCode/SourceGenPolarChart.cs
deleted file mode 100644
index c6536dab4..000000000
--- a/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsGeneratedCode/SourceGenPolarChart.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// The MIT License(MIT)
-//
-// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-namespace LiveChartsGeneratedCode;
-
-public partial class SourceGenPolarChart : SourceGenChart
-{
- // add vortice specific code here
-}
diff --git a/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsGeneratedCode/SourceGenCartesianChart.cs b/samples/VorticeSample/LiveChartsCore.Vortice/SourceGenCartesianChart.vortice.cs
similarity index 77%
rename from samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
rename to samples/VorticeSample/LiveChartsCore.Vortice/SourceGenCartesianChart.vortice.cs
index 76bf417b7..f6c3c429b 100644
--- a/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
+++ b/samples/VorticeSample/LiveChartsCore.Vortice/SourceGenCartesianChart.vortice.cs
@@ -1,4 +1,4 @@
-// The MIT License(MIT)
+// The MIT License(MIT)
//
// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
//
@@ -20,9 +20,15 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
+using LiveChartsCore.Kernel.Sketches;
+
namespace LiveChartsGeneratedCode;
-public partial class SourceGenCartesianChart : SourceGenChart
+// ===============================================
+// this file contains the Vortice specific code
+// ===============================================
+
+///
+public partial class SourceGenCartesianChart : SourceGenChart, ICartesianChartView
{
- // add vortice specific code here
}
diff --git a/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsGeneratedCode/SourceGenChart.cs b/samples/VorticeSample/LiveChartsCore.Vortice/SourceGenChart.cs
similarity index 87%
rename from samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsGeneratedCode/SourceGenChart.cs
rename to samples/VorticeSample/LiveChartsCore.Vortice/SourceGenChart.cs
index e11872e09..7e7a16a92 100644
--- a/samples/VorticeSample/LiveChartsCore.Vortice/LiveChartsGeneratedCode/SourceGenChart.cs
+++ b/samples/VorticeSample/LiveChartsCore.Vortice/SourceGenChart.cs
@@ -28,6 +28,14 @@
namespace LiveChartsGeneratedCode;
+// ==============================================================================
+// this file is the base class for this UI framework controls, in this file we
+// define the UI framework specific code.
+// expanding this file in the solution explorer will show 2 more files:
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
+// ==============================================================================
+
public abstract partial class SourceGenChart : IMyUIFrameworkControl
{
public IMyUIFrameworkControl[] Children { get; set; }
diff --git a/samples/VorticeSample/VorticeSample/Program.cs b/samples/VorticeSample/VorticeSample/Program.cs
index d5ee6082e..ac5f3a630 100644
--- a/samples/VorticeSample/VorticeSample/Program.cs
+++ b/samples/VorticeSample/VorticeSample/Program.cs
@@ -3,6 +3,12 @@
using LiveChartsCore.Vortice;
using VorticeSample;
+// ------------------------------------------------------------------------------
+// THIS IS A PROOF OF CONCEPT DEMO
+// IT DRAWS A BASIC CARTESIAN CHART USING VORTICE DIRECT2D AS RENDERER
+// NO DEPENDENCY ON SKIASHARP AT ALL.
+// ------------------------------------------------------------------------------
+
LiveCharts.Configure(config => config
.AddDefaultMappers()
.AddVortice()
@@ -12,7 +18,11 @@
renderSettings.ShowFPS = true;
}));
-using TestApplication app = new() { PresentOptions = Vortice.Direct2D1.PresentOptions.None };
+using TestApplication app = new()
+{
+ PresentOptions = Vortice.Direct2D1.PresentOptions.Immediately
+ //PresentOptions = Vortice.Direct2D1.PresentOptions.None
+};
var data = new ObservableCollection { 3, 2, 5, 3 };
diff --git a/samples/VorticeSample/VorticeSample/VorticeSample.csproj b/samples/VorticeSample/VorticeSample/VorticeSample.csproj
index e1f457def..774e88b84 100644
--- a/samples/VorticeSample/VorticeSample/VorticeSample.csproj
+++ b/samples/VorticeSample/VorticeSample/VorticeSample.csproj
@@ -2,7 +2,7 @@
Exe
- net9.0-windows
+ net10.0-windowsenableenabletrue
diff --git a/samples/WPFSample/App.xaml.cs b/samples/WPFSample/App.xaml.cs
index 9437ba49e..9669ff7b9 100644
--- a/samples/WPFSample/App.xaml.cs
+++ b/samples/WPFSample/App.xaml.cs
@@ -1,7 +1,7 @@
using System;
using System.Windows;
using ViewModelsSamples;
-using LiveChartsCore; // mark
+using LiveChartsCore; // mark
namespace WPFSample;
@@ -17,5 +17,10 @@ protected override void OnStartup(StartupEventArgs e)
// LiveCharts configuration section: // mark
LiveCharts.Configure(c => c // mark
.AddLiveChartsAppSettings()); // mark
+
+#if UI_TESTING
+ System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof(Factos.SGTests).TypeHandle);
+ Factos.WPF.SetupExtensions.UseFactosApp(this);
+#endif
}
}
diff --git a/samples/WPFSample/Bars/AutoUpdate/View.xaml b/samples/WPFSample/Bars/AutoUpdate/View.xaml
index e3c20512f..d7f362582 100644
--- a/samples/WPFSample/Bars/AutoUpdate/View.xaml
+++ b/samples/WPFSample/Bars/AutoUpdate/View.xaml
@@ -27,7 +27,7 @@
-
+
public partial class View : UserControl
{
- private bool? _isStreaming = false;
-
public View()
{
InitializeComponent();
}
- private async void Button_Click(object sender, System.Windows.RoutedEventArgs e)
- {
- var vm = (ViewModel)DataContext;
- _isStreaming = _isStreaming is null ? true : !_isStreaming;
-
- while (_isStreaming.Value)
- {
- vm.RemoveItem();
- vm.AddItem();
- await Task.Delay(1000);
- }
- }
+#if UI_TESTING
+ public CartesianChart Chart => chart;
+#endif
}
diff --git a/samples/WPFSample/General/FirstChart/View.xaml.cs b/samples/WPFSample/General/FirstChart/View.xaml.cs
index 66c66581d..644064128 100644
--- a/samples/WPFSample/General/FirstChart/View.xaml.cs
+++ b/samples/WPFSample/General/FirstChart/View.xaml.cs
@@ -1,4 +1,5 @@
using System.Windows.Controls;
+using LiveChartsCore.SkiaSharpView.WPF;
namespace WPFSample.General.FirstChart;
@@ -11,4 +12,8 @@ public View()
{
InitializeComponent();
}
+
+#if UI_TESTING
+ public CartesianChart Chart => (CartesianChart)Content;
+#endif
}
diff --git a/samples/WPFSample/Pies/AutoUpdate/View.xaml b/samples/WPFSample/Pies/AutoUpdate/View.xaml
index cd5aa60f3..581b2b7d3 100644
--- a/samples/WPFSample/Pies/AutoUpdate/View.xaml
+++ b/samples/WPFSample/Pies/AutoUpdate/View.xaml
@@ -21,7 +21,7 @@
-
+ (PieChart)FindName("chart");
+#endif
}
diff --git a/samples/WPFSample/Pies/Basic/View.xaml.cs b/samples/WPFSample/Pies/Basic/View.xaml.cs
index 424b974cd..ebbc3e104 100644
--- a/samples/WPFSample/Pies/Basic/View.xaml.cs
+++ b/samples/WPFSample/Pies/Basic/View.xaml.cs
@@ -1,4 +1,5 @@
using System.Windows.Controls;
+using LiveChartsCore.SkiaSharpView.WPF;
namespace WPFSample.Pies.Basic;
@@ -11,4 +12,8 @@ public View()
{
InitializeComponent();
}
+
+#if UI_TESTING
+ public PieChart Chart => (PieChart)Content!;
+#endif
}
diff --git a/samples/WPFSample/Polar/Basic/View.xaml.cs b/samples/WPFSample/Polar/Basic/View.xaml.cs
index 6bb000e96..da5149d83 100644
--- a/samples/WPFSample/Polar/Basic/View.xaml.cs
+++ b/samples/WPFSample/Polar/Basic/View.xaml.cs
@@ -1,4 +1,5 @@
using System.Windows.Controls;
+using LiveChartsCore.SkiaSharpView.WPF;
namespace WPFSample.Polar.Basic;
@@ -11,4 +12,8 @@ public View()
{
InitializeComponent();
}
+
+#if UI_TESTING
+ public PolarChart Chart => (PolarChart)Content!;
+#endif
}
diff --git a/samples/WPFSample/VisualTest/DataTemplate/View.xaml b/samples/WPFSample/VisualTest/DataTemplate/View.xaml
index 725a69304..1df95dd73 100644
--- a/samples/WPFSample/VisualTest/DataTemplate/View.xaml
+++ b/samples/WPFSample/VisualTest/DataTemplate/View.xaml
@@ -1,27 +1,44 @@
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/WPFSample/VisualTest/DataTemplate/View.xaml.cs b/samples/WPFSample/VisualTest/DataTemplate/View.xaml.cs
index a4dc4a67c..007a36365 100644
--- a/samples/WPFSample/VisualTest/DataTemplate/View.xaml.cs
+++ b/samples/WPFSample/VisualTest/DataTemplate/View.xaml.cs
@@ -1,4 +1,8 @@
-using System.Windows.Controls;
+using System.Net.WebSockets;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+using LiveChartsCore.Kernel.Sketches;
namespace WPFSample.VisualTest.DataTemplate;
@@ -11,4 +15,20 @@ public View()
{
InitializeComponent();
}
+
+ public IEnumerable FindCharts(DependencyObject? parent = null)
+ {
+ parent ??= (DependencyObject)Content;
+
+ for (var i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
+ {
+ var child = VisualTreeHelper.GetChild(parent, i);
+
+ if (child is IChartView typedChild)
+ yield return typedChild;
+
+ foreach (var descendant in FindCharts(child))
+ yield return descendant;
+ }
+ }
}
diff --git a/samples/WPFSample/VisualTest/Tabs/View.xaml b/samples/WPFSample/VisualTest/Tabs/View.xaml
index 7e9339c9a..1d812b312 100644
--- a/samples/WPFSample/VisualTest/Tabs/View.xaml
+++ b/samples/WPFSample/VisualTest/Tabs/View.xaml
@@ -4,20 +4,15 @@
xmlns:bars="clr-namespace:WPFSample.Bars.AutoUpdate"
xmlns:lines="clr-namespace:WPFSample.Lines.AutoUpdate"
xmlns:scatter="clr-namespace:WPFSample.Scatter.AutoUpdate">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/WPFSample/WPFSample.csproj b/samples/WPFSample/WPFSample.csproj
index 2059624fd..ceec6cfd3 100644
--- a/samples/WPFSample/WPFSample.csproj
+++ b/samples/WPFSample/WPFSample.csproj
@@ -1,11 +1,13 @@
-
+WinExe
- net8.0-windows10.0.19041
+
+ net10.0-windows10.0.19041.0
+ $(TestBuildTargetFramework)
+
truefalse
- $(GlobalLangVersion)
@@ -29,4 +31,26 @@
+
+
+
+
+ $(DefineConstants);UI_TESTING;XAML_UI_TESTING;WPF_UI_TESTING
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/WinFormsSample/Axes/MatchScale/View.cs b/samples/WinFormsSample/Axes/MatchScale/View.cs
index c42bd42c5..b86a19b32 100644
--- a/samples/WinFormsSample/Axes/MatchScale/View.cs
+++ b/samples/WinFormsSample/Axes/MatchScale/View.cs
@@ -5,9 +5,7 @@
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.WinForms;
-
using SkiaSharp;
-using static System.Runtime.InteropServices.JavaScript.JSType;
#pragma warning disable IDE1006 // Naming Styles
diff --git a/samples/WinFormsSample/Bars/AutoUpdate/View.cs b/samples/WinFormsSample/Bars/AutoUpdate/View.cs
index 373059fc2..05016a81e 100644
--- a/samples/WinFormsSample/Bars/AutoUpdate/View.cs
+++ b/samples/WinFormsSample/Bars/AutoUpdate/View.cs
@@ -113,4 +113,6 @@ private ObservableValue[] FetchVales()
new(_random.Next(0, 10))
];
}
+
+ public CartesianChart Chart => _cartesianChart;
}
diff --git a/samples/WinFormsSample/Bars/Race/View.cs b/samples/WinFormsSample/Bars/Race/View.cs
index 2b11490bd..4fc3b5e9a 100644
--- a/samples/WinFormsSample/Bars/Race/View.cs
+++ b/samples/WinFormsSample/Bars/Race/View.cs
@@ -10,7 +10,6 @@
using LiveChartsCore.SkiaSharpView.WinForms;
using LiveChartsCore.Themes;
using SkiaSharp;
-using static System.Runtime.InteropServices.JavaScript.JSType;
namespace WinFormsSample.Bars.Race;
diff --git a/samples/WinFormsSample/General/FirstChart/View.cs b/samples/WinFormsSample/General/FirstChart/View.cs
index d6dddd4db..9ce8c883c 100644
--- a/samples/WinFormsSample/General/FirstChart/View.cs
+++ b/samples/WinFormsSample/General/FirstChart/View.cs
@@ -37,5 +37,8 @@ public View()
};
Controls.Add(cartesianChart);
+ Chart = cartesianChart;
}
+
+ public CartesianChart Chart;
}
diff --git a/samples/WinFormsSample/General/Scrollable/View.cs b/samples/WinFormsSample/General/Scrollable/View.cs
index e9de3b102..e0a72be6d 100644
--- a/samples/WinFormsSample/General/Scrollable/View.cs
+++ b/samples/WinFormsSample/General/Scrollable/View.cs
@@ -9,7 +9,6 @@
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.WinForms;
using SkiaSharp;
-using ViewModelsSamples.General.Scrollable;
namespace WinFormsSample.General.Scrollable;
diff --git a/samples/WinFormsSample/Pies/AutoUpdate/View.cs b/samples/WinFormsSample/Pies/AutoUpdate/View.cs
index ac7f674cc..c980c1a04 100644
--- a/samples/WinFormsSample/Pies/AutoUpdate/View.cs
+++ b/samples/WinFormsSample/Pies/AutoUpdate/View.cs
@@ -11,7 +11,7 @@ namespace WinFormsSample.Pies.AutoUpdate;
public partial class View : UserControl
{
- private readonly PieChart _piechart;
+ public readonly PieChart Chart;
private readonly Random _random = new();
public View()
@@ -25,7 +25,7 @@ public View()
new PieSeries{ Values= Fetch() },
};
- _piechart = new PieChart
+ Chart = new PieChart
{
Series = seriesCollection,
Location = new System.Drawing.Point(0, 50),
@@ -33,20 +33,20 @@ public View()
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom
};
- Controls.Add(_piechart);
+ Controls.Add(Chart);
var b1 = new Button { Text = "Add series", Location = new System.Drawing.Point(0, 0) };
b1.Click += (sender, e) => seriesCollection.Add(new PieSeries { Values = Fetch() });
Controls.Add(b1);
var b2 = new Button { Text = "Remove series", Location = new System.Drawing.Point(80, 0) };
- b2.Click += (sender, e) => seriesCollection.Remove(_piechart.Series.First());
+ b2.Click += (sender, e) => seriesCollection.Remove(Chart.Series.First());
Controls.Add(b2);
var b3 = new Button { Text = "Update all", Location = new System.Drawing.Point(160, 0) };
b3.Click += (sender, e) =>
{
- foreach (var series in _piechart.Series)
+ foreach (var series in Chart.Series)
{
if (series is PieSeries pieSeries)
{
diff --git a/samples/WinFormsSample/Pies/Basic/View.cs b/samples/WinFormsSample/Pies/Basic/View.cs
index 82ef2cf8a..06a934097 100644
--- a/samples/WinFormsSample/Pies/Basic/View.cs
+++ b/samples/WinFormsSample/Pies/Basic/View.cs
@@ -10,14 +10,14 @@ namespace WinFormsSample.Pies.Basic;
public partial class View : UserControl
{
- private readonly PieChart pieChart;
+ public readonly PieChart Chart;
public View()
{
InitializeComponent();
Size = new System.Drawing.Size(50, 50);
- pieChart = new PieChart
+ Chart = new PieChart
{
Series = new[] { 2, 4, 1, 4, 3 }.AsPieSeries(),
Title = new DrawnLabelVisual(
@@ -33,6 +33,6 @@ public View()
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom
};
- Controls.Add(pieChart);
+ Controls.Add(Chart);
}
}
diff --git a/samples/WinFormsSample/Pies/Icons/CustomPieSeries.cs b/samples/WinFormsSample/Pies/Icons/CustomPieSeries.cs
index b73699308..445a30df4 100644
--- a/samples/WinFormsSample/Pies/Icons/CustomPieSeries.cs
+++ b/samples/WinFormsSample/Pies/Icons/CustomPieSeries.cs
@@ -1,4 +1,3 @@
-using Microsoft.UI.Xaml;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using ViewModelsSamples.Pies.Icons;
diff --git a/samples/WinFormsSample/Polar/Basic/View.cs b/samples/WinFormsSample/Polar/Basic/View.cs
index 2c8a1db60..a9aaf3807 100644
--- a/samples/WinFormsSample/Polar/Basic/View.cs
+++ b/samples/WinFormsSample/Polar/Basic/View.cs
@@ -11,6 +11,8 @@ namespace WinFormsSample.Polar.Basic;
public partial class View : UserControl
{
+ public PolarChart Chart;
+
public View()
{
InitializeComponent();
@@ -69,6 +71,8 @@ public View()
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom
};
+ Chart = polarChart;
+
Controls.Add(polarChart);
}
}
diff --git a/samples/WinFormsSample/Program.cs b/samples/WinFormsSample/Program.cs
index 03db2b432..8770ef229 100644
--- a/samples/WinFormsSample/Program.cs
+++ b/samples/WinFormsSample/Program.cs
@@ -14,9 +14,17 @@ static void Main()
LiveCharts.Configure(c => c // mark
.AddLiveChartsAppSettings()); // mark
- _ = Application.SetHighDpiMode(HighDpiMode.SystemAware);
+ //_ = Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Form1());
+
+ var form = new Form1();
+
+#if UI_TESTING
+ System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof(Factos.SGTests).TypeHandle);
+ Factos.WinForms.SetupExtensions.UseFactosApp(form);
+#endif
+
+ Application.Run(form);
}
}
diff --git a/samples/WinFormsSample/WinFormsSample.csproj b/samples/WinFormsSample/WinFormsSample.csproj
index cca760acf..9f142e34a 100644
--- a/samples/WinFormsSample/WinFormsSample.csproj
+++ b/samples/WinFormsSample/WinFormsSample.csproj
@@ -2,10 +2,12 @@
WinExe
- net8.0-windows10.0.19041
+
+ net10.0-windows10.0.19041.0
+ $(TestBuildTargetFramework)
+
truefalse
- $(GlobalLangVersion)
@@ -20,4 +22,22 @@
+
+
+
+
+ $(DefineConstants);UI_TESTING;WINFORMS_UI_TESTING
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/WinUISample/WinUISample/App.xaml.cs b/samples/WinUISample/WinUISample/App.xaml.cs
index 43763034d..b09e0adf5 100644
--- a/samples/WinUISample/WinUISample/App.xaml.cs
+++ b/samples/WinUISample/WinUISample/App.xaml.cs
@@ -23,6 +23,10 @@ protected override void OnLaunched(LaunchActivatedEventArgs args)
m_window = new MainWindow();
m_window.Activate();
+
+#if UI_TESTING
+ Factos.WinUI.SetupExtensions.UseFactosApp(this);
+#endif
}
private Window m_window;
diff --git a/samples/WinUISample/WinUISample/Samples/Bars/AutoUpdate/View.xaml b/samples/WinUISample/WinUISample/Samples/Bars/AutoUpdate/View.xaml
index c34556079..5afe1ea95 100644
--- a/samples/WinUISample/WinUISample/Samples/Bars/AutoUpdate/View.xaml
+++ b/samples/WinUISample/WinUISample/Samples/Bars/AutoUpdate/View.xaml
@@ -24,7 +24,7 @@
-
+ chart;
+#endif
}
diff --git a/samples/WinUISample/WinUISample/Samples/General/FirstChart/View.xaml.cs b/samples/WinUISample/WinUISample/Samples/General/FirstChart/View.xaml.cs
index 9dd3ef721..d03052066 100644
--- a/samples/WinUISample/WinUISample/Samples/General/FirstChart/View.xaml.cs
+++ b/samples/WinUISample/WinUISample/Samples/General/FirstChart/View.xaml.cs
@@ -1,4 +1,5 @@
-using Microsoft.UI.Xaml.Controls;
+using LiveChartsCore.SkiaSharpView.WinUI;
+using Microsoft.UI.Xaml.Controls;
namespace WinUISample.General.FirstChart;
@@ -8,4 +9,8 @@ public View()
{
InitializeComponent();
}
+
+#if UI_TESTING
+ public CartesianChart Chart => (CartesianChart)Content!;
+#endif
}
diff --git a/samples/WinUISample/WinUISample/Samples/Pies/AutoUpdate/View.xaml b/samples/WinUISample/WinUISample/Samples/Pies/AutoUpdate/View.xaml
index d67f0d479..ff986e543 100644
--- a/samples/WinUISample/WinUISample/Samples/Pies/AutoUpdate/View.xaml
+++ b/samples/WinUISample/WinUISample/Samples/Pies/AutoUpdate/View.xaml
@@ -19,7 +19,7 @@
-
+ chart;
+#endif
}
diff --git a/samples/WinUISample/WinUISample/Samples/Pies/Basic/View.xaml.cs b/samples/WinUISample/WinUISample/Samples/Pies/Basic/View.xaml.cs
index 7004bc974..8d5a9b921 100644
--- a/samples/WinUISample/WinUISample/Samples/Pies/Basic/View.xaml.cs
+++ b/samples/WinUISample/WinUISample/Samples/Pies/Basic/View.xaml.cs
@@ -1,4 +1,5 @@
-using Microsoft.UI.Xaml.Controls;
+using LiveChartsCore.SkiaSharpView.WinUI;
+using Microsoft.UI.Xaml.Controls;
namespace WinUISample.Pies.Basic;
@@ -8,4 +9,8 @@ public View()
{
InitializeComponent();
}
+
+#if UI_TESTING
+ public PieChart Chart => (PieChart)Content!;
+#endif
}
diff --git a/samples/WinUISample/WinUISample/Samples/Polar/Basic/View.xaml.cs b/samples/WinUISample/WinUISample/Samples/Polar/Basic/View.xaml.cs
index 8c299656d..5899132fc 100644
--- a/samples/WinUISample/WinUISample/Samples/Polar/Basic/View.xaml.cs
+++ b/samples/WinUISample/WinUISample/Samples/Polar/Basic/View.xaml.cs
@@ -1,4 +1,5 @@
-using Microsoft.UI.Xaml.Controls;
+using LiveChartsCore.SkiaSharpView.WinUI;
+using Microsoft.UI.Xaml.Controls;
namespace WinUISample.Polar.Basic;
@@ -8,4 +9,8 @@ public View()
{
InitializeComponent();
}
+
+#if UI_TESTING
+ public PolarChart Chart => (PolarChart)Content!;
+#endif
}
diff --git a/samples/WinUISample/WinUISample/Samples/VisualTest/DataTemplate/View.xaml b/samples/WinUISample/WinUISample/Samples/VisualTest/DataTemplate/View.xaml
index 2ffef9849..9dd1e6349 100644
--- a/samples/WinUISample/WinUISample/Samples/VisualTest/DataTemplate/View.xaml
+++ b/samples/WinUISample/WinUISample/Samples/VisualTest/DataTemplate/View.xaml
@@ -11,14 +11,34 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/WinUISample/WinUISample/Samples/VisualTest/DataTemplate/View.xaml.cs b/samples/WinUISample/WinUISample/Samples/VisualTest/DataTemplate/View.xaml.cs
index c2719547f..827c6de68 100644
--- a/samples/WinUISample/WinUISample/Samples/VisualTest/DataTemplate/View.xaml.cs
+++ b/samples/WinUISample/WinUISample/Samples/VisualTest/DataTemplate/View.xaml.cs
@@ -1,4 +1,7 @@
-using Microsoft.UI.Xaml.Controls;
+using LiveChartsCore.Kernel.Sketches;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Media;
namespace WinUISample.VisualTest.DataTemplate;
@@ -8,4 +11,22 @@ public View()
{
InitializeComponent();
}
+
+ public IEnumerable FindCharts(DependencyObject? parent = null)
+ {
+ parent ??= (DependencyObject)Content!;
+
+ var count = VisualTreeHelper.GetChildrenCount(parent);
+
+ for (var i = 0; i < count; i++)
+ {
+ var child = VisualTreeHelper.GetChild(parent, i);
+
+ if (child is IChartView chart)
+ yield return chart;
+
+ foreach (var descendant in FindCharts(child))
+ yield return descendant;
+ }
+ }
}
diff --git a/samples/WinUISample/WinUISample/WinUISample.csproj b/samples/WinUISample/WinUISample/WinUISample.csproj
index 0c0533138..e61833a5b 100644
--- a/samples/WinUISample/WinUISample/WinUISample.csproj
+++ b/samples/WinUISample/WinUISample/WinUISample.csproj
@@ -1,15 +1,15 @@
WinExe
- net8.0-windows10.0.19041.0
+ net10.0-windows10.0.19041.010.0.17763.0WinUISampleapp.manifestx86;x64;ARM64
- win-x86;win-x64;win-arm64
- win10-x86;win10-x64;win10-arm64
+ win-x86;win-x64;win-arm64win-$(Platform).pubxmltrue
+ falsetrue
@@ -24,8 +24,8 @@
-
-
+
+
@@ -57,4 +57,21 @@
+
+
+
+
+
+ UITests\%(RecursiveDir)%(Filename).cs
+
+
+
+
+
+
+
+
+ $(DefineConstants);UI_TESTING;XAML_UI_TESTING;WINUI_UI_TESTING
+
+
diff --git a/src/LiveChartsCore/AssemblyInfo.cs b/src/LiveChartsCore/AssemblyInfo.cs
index 1d26b5243..3708e2484 100644
--- a/src/LiveChartsCore/AssemblyInfo.cs
+++ b/src/LiveChartsCore/AssemblyInfo.cs
@@ -22,16 +22,18 @@
using System.Runtime.CompilerServices;
-#if !DEBUG && NET462
+#if STRONG_NAMED_ASSEMBLIES
using System.Reflection;
[assembly: AssemblyKeyFile("./../../LiveCharts.snk")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.WinForms, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.WPF, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")]
+[assembly: InternalsVisibleTo("CoreTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")]
#else
+[assembly: InternalsVisibleTo("CoreTests")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView")]
[assembly: InternalsVisibleTo("LiveChartsCore.Behaviours")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.WinForms")]
@@ -44,8 +46,6 @@
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Eto")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Blazor")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Maui")]
-[assembly: InternalsVisibleTo("LiveChartsCore.BackersPackage")]
-[assembly: InternalsVisibleTo("LiveChartsCore.UnitTesting")]
[assembly: InternalsVisibleTo("LiveChartsCore.Vortice")]
#endif
diff --git a/src/LiveChartsCore/Chart.cs b/src/LiveChartsCore/Chart.cs
index 506b08957..6ee08a4d0 100644
--- a/src/LiveChartsCore/Chart.cs
+++ b/src/LiveChartsCore/Chart.cs
@@ -801,12 +801,9 @@ protected bool IsRendering()
// rendered the last frame, if both timestamps are different it means the canvas is rendering
// and we are safe to keep measuring, otherwise we skip measuring until the canvas renders a new frame.
-#if DEBUG
- // hack.
- // a flag to to remove this check in unit tests.
+ // hack. a flag to remove this check in unit tests.
if (CoreMotionCanvas.IsTesting)
return true;
-#endif
var canMeasure = Canvas._lastFrameTimestamp != _lastMeasureTimeStamp;
diff --git a/src/LiveChartsCore/CoreAxis.cs b/src/LiveChartsCore/CoreAxis.cs
index bbe9c89f0..3a70daca8 100644
--- a/src/LiveChartsCore/CoreAxis.cs
+++ b/src/LiveChartsCore/CoreAxis.cs
@@ -1476,10 +1476,13 @@ private string TryGetLabelOrLogError(Func labeler, double value)
{
return labeler(value);
}
+#if DEBUG
catch (Exception e)
{
-#if DEBUG
Trace.WriteLine($"[Error] LiveCharts was not able to get a label from axis {_orientation} with value {value}. {e.Message}");
+#else
+ catch
+ {
#endif
return string.Empty;
}
diff --git a/src/LiveChartsCore/Drawing/BaseLabelGeometry.cs b/src/LiveChartsCore/Drawing/BaseLabelGeometry.cs
index e784eb816..5859b1c31 100644
--- a/src/LiveChartsCore/Drawing/BaseLabelGeometry.cs
+++ b/src/LiveChartsCore/Drawing/BaseLabelGeometry.cs
@@ -194,12 +194,7 @@ bool IDrawnElement.HasSkew
///
public string Text { get; set; } = string.Empty;
-#if DEBUG
- ///
- /// This property is only available on debug mode, it indicates if the debug lines should be shown.
- ///
- public static bool ShowDebugLines { get; set; }
-#endif
+ internal static bool ShowDebugLines { get; set; }
Paint? IDrawnElement.Stroke { get; set; }
diff --git a/src/LiveChartsCore/Kernel/ActionThrottler.cs b/src/LiveChartsCore/Kernel/ActionThrottler.cs
index 5913c5e37..4a98b5eae 100644
--- a/src/LiveChartsCore/Kernel/ActionThrottler.cs
+++ b/src/LiveChartsCore/Kernel/ActionThrottler.cs
@@ -38,15 +38,13 @@ public class ActionThrottler(Func targetAction, TimeSpan time)
private readonly object _sync = new();
private bool _isWaiting = false;
-#if DEBUG
///
/// Gets the calls.
///
///
/// The calls.
///
- public int Calls { get; private set; } = 0;
-#endif
+ internal int Calls { get; private set; } = 0;
///
/// Gets or sets the throttler time span.
@@ -64,9 +62,7 @@ public async void Call()
{
lock (_sync)
{
-#if DEBUG
Calls++;
-#endif
if (_isWaiting) return;
_isWaiting = true;
diff --git a/src/LiveChartsCore/Kernel/Sketches/IChartView.cs b/src/LiveChartsCore/Kernel/Sketches/IChartView.cs
index 86185723c..bfe408258 100644
--- a/src/LiveChartsCore/Kernel/Sketches/IChartView.cs
+++ b/src/LiveChartsCore/Kernel/Sketches/IChartView.cs
@@ -59,13 +59,6 @@ public interface IChartView : IDrawnView
///
bool IsDarkMode { get; }
- ///
- /// Gets or sets whether the chart should force GPU acceleration, this property will only work
- /// while globaly is false, when is true,
- /// all charts will use GPU acceleration.
- ///
- bool ForceGPU { get; set; }
-
///
/// Gets or sets the chart theme.
///
diff --git a/src/LiveChartsCore/LiveChartsCore.csproj b/src/LiveChartsCore/LiveChartsCore.csproj
index 44d4243fa..0bf90271a 100644
--- a/src/LiveChartsCore/LiveChartsCore.csproj
+++ b/src/LiveChartsCore/LiveChartsCore.csproj
@@ -1,33 +1,25 @@
- enable
- $(GlobalLangVersion)
-
net462;
netstandard2.0;
- netstandard2.1;
net8.0;
LiveChartsCoreLiveChartsCore
- $(LiveChartsVersion)
- icon.png
- Simple, flexible, interactive and powerful data visualization for .Net, this is the core package probably you need another package also unless you are building your own backed.
- MIT
- $(LiveChartsAuthors)
- true
- snupkg
- portable
- true
- https://github.com/beto-rodriguez/LiveCharts2
+
- true
- true
- true
- true
+
+
+
+
+
+
+
+ $(Description) This package contains only the core of the library, you probably need another package that is compatible with you UI framework, unless you are building a custom package.
+
@@ -35,27 +27,24 @@
- bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml
- true
+ bin/$(Configuration)/$(TargetFramework)/$(AssemblyName).xml
-
-
-
-
-
PreserveNewest
+
+ $(DefineConstants);STRONG_NAMED_ASSEMBLIES
+
+
-
-
-
-
-
+
@@ -67,7 +56,7 @@
-
+ Analyzerfalse
diff --git a/src/LiveChartsCore/Motion/CoreMotionCanvas.cs b/src/LiveChartsCore/Motion/CoreMotionCanvas.cs
index 803316b65..f1a74177e 100644
--- a/src/LiveChartsCore/Motion/CoreMotionCanvas.cs
+++ b/src/LiveChartsCore/Motion/CoreMotionCanvas.cs
@@ -84,22 +84,13 @@ internal CanvasZone[] Zones
///
/// Gets the clock elapsed time in milliseconds.
///
- public static long ElapsedMilliseconds
- {
- get
- {
-#if DEBUG
- if (DebugElapsedMilliseconds > -1)
- return DebugElapsedMilliseconds;
-#endif
- return s_clock.ElapsedMilliseconds;
- }
- }
+ public static long ElapsedMilliseconds =>
+ DebugElapsedMilliseconds > -1
+ ? DebugElapsedMilliseconds
+ : s_clock.ElapsedMilliseconds;
-#if DEBUG
internal static long DebugElapsedMilliseconds { get; set; } = -1;
internal static bool IsTesting { get; set; }
-#endif
internal bool DisableAnimations { get; set; }
diff --git a/src/LiveChartsCore/Motion/MotionCanvasComposer.cs b/src/LiveChartsCore/Motion/MotionCanvasComposer.cs
index 218ba0b24..362e012c9 100644
--- a/src/LiveChartsCore/Motion/MotionCanvasComposer.cs
+++ b/src/LiveChartsCore/Motion/MotionCanvasComposer.cs
@@ -33,9 +33,8 @@ public class MotionCanvasComposer(IRenderMode renderMode, IFrameTicker ticker)
/// Defines the motion canvas rendering factory delegate.
///
/// The global rendering settings.
- /// Indicates whether GPU mode is forced.
/// A MotionCanvasComposer instance.
- public delegate MotionCanvasComposer MotionCanvasRenderingFactoryDelegate(RenderingSettings settings, bool forceGPU);
+ public delegate MotionCanvasComposer MotionCanvasRenderingFactoryDelegate(RenderingSettings settings);
///
/// Gets the render mode.
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/AssemblyInfo.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/AssemblyInfo.cs
deleted file mode 100644
index 74c554c92..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/AssemblyInfo.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// The MIT License(MIT)
-//
-// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo("LiveChartsCore.BackersPackage")]
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/CartesianChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/CartesianChart.cs
index 351cf23b3..8321de8d8 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/CartesianChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/CartesianChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.Avalonia;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenCartesianChart class to add avalonia specific
-// code, this class is just to expose the CartesianChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/GeoMap.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/GeoMap.cs
index 2fea3fb14..4e2d0125a 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/GeoMap.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/GeoMap.cs
@@ -23,10 +23,11 @@
using LiveChartsCore.Geo;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenMapChart class to add avalonia specific
-// code, this class is just to expose the GeoMap class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
namespace LiveChartsCore.SkiaSharpView.Avalonia;
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj
index ef406bccd..646c2ff3b 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj
@@ -1,10 +1,8 @@
-
+Library
- $(GlobalLangVersion)
- enable
- netstandard2.0;netstandard2.1;net6.0;net8.0;
+ netstandard2.0;net6.0;net8.0;LiveChartsCore.SkiaSharpView.AvaloniaLiveChartsCore.SkiaSharpView.Avalonia
@@ -28,8 +26,8 @@
embedded-->
-
-
+
+ $(DefineConstants);AVALONIA_LVC;XAML_LVC
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/PieChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/PieChart.cs
index 5b3af9483..baca22642 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/PieChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/PieChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.Avalonia;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenPieChart class to add avalonia specific
-// code, this class is just to expose the PieChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/PolarChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/PolarChart.cs
index 31166ce91..3f4c981d8 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/PolarChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/PolarChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.Avalonia;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenPolarChart class to add avalonia specific
-// code, this class is just to expose the PolarChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenCartesianChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenCartesianChart.avalonia.cs
similarity index 90%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenCartesianChart.avalonia.cs
index 4fceb4095..ca76e03cb 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenCartesianChart.avalonia.cs
@@ -29,12 +29,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the Avalonia specific code for the SourceGenCartesianChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the Avalonia specific code
+// ===============================================
///
public partial class SourceGenCartesianChart : SourceGenChart, ICartesianChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenChart.cs
similarity index 95%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenChart.cs
index ac5324a04..8f824ca9b 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenChart.cs
@@ -39,10 +39,11 @@
namespace LiveChartsGeneratedCode;
// ==============================================================================
-//
-// this file contains the Avalonia specific code for the SourceGenChart class,
-// the rest of the code can be found in the _Shared project.
-//
+// this file is the base class for this UI framework controls, in this file we
+// define the UI framework specific code.
+// expanding this file in the solution explorer will show 2 more files:
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
@@ -178,9 +179,6 @@ private ISeries InflateSeriesTemplate(object item)
return series;
}
- private static object GetSeriesSource(ISeries series) =>
- ((Control)series).DataContext!;
-
bool ICustomHitTest.HitTest(Point point) =>
new Rect(Bounds.Size).Contains(point);
}
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenMapChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenMapChart.avalonia.cs
similarity index 93%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenMapChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenMapChart.avalonia.cs
index 1078bb850..6f222823c 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenMapChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenMapChart.avalonia.cs
@@ -33,12 +33,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the Avalonia specific code for the SourceGenMapChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ==============================================================
+// this file contains the shared code between all UI frameworks
+// ==============================================================
///
public partial class SourceGenMapChart : UserControl, IGeoMapView, ICustomHitTest
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenPieChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenPieChart.avalonia.cs
similarity index 88%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenPieChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenPieChart.avalonia.cs
index c2608c398..e66cb959c 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenPieChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenPieChart.avalonia.cs
@@ -24,12 +24,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the Avalonia specific code for the SourceGenPieChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ==============================================================
+// this file contains the shared code between all UI frameworks
+// ==============================================================
///
public partial class SourceGenPieChart : SourceGenChart, IPieChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenPolarChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenPolarChart.avalonia.cs
similarity index 88%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenPolarChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenPolarChart.avalonia.cs
index 18f918dec..ac4d85a8c 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsGeneratedCode/SourceGenPolarChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenPolarChart.avalonia.cs
@@ -24,12 +24,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the Avalonia specific code for the SourceGenPolarChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ==============================================================
+// this file contains the shared code between all UI frameworks
+// ==============================================================
///
public partial class SourceGenPolarChart : SourceGenChart, IPolarChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/AssemblyInfo.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/AssemblyInfo.cs
index e88214948..bdc6c848c 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/AssemblyInfo.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/AssemblyInfo.cs
@@ -22,12 +22,9 @@
using System.Windows;
-#if !DEBUG && NET462
+#if STRONG_NAMED_ASSEMBLIES
using System.Reflection;
[assembly: AssemblyKeyFile("./../../../LiveCharts.snk")]
-#else
-using System.Runtime.CompilerServices;
-[assembly: InternalsVisibleTo("LiveChartsCore.BackersPackage")]
#endif
[assembly: ThemeInfo(
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/CartesianChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/CartesianChart.cs
index e9d269588..16afc76f7 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/CartesianChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/CartesianChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.WPF;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenCartesianChart class to add wpf specific
-// code, this class is just to expose the CartesianChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/GeoMap.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/GeoMap.cs
index be46f0159..10315292b 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/GeoMap.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/GeoMap.cs
@@ -20,15 +20,16 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
-using LiveChartsCore.Kernel.Sketches;
+using LiveChartsCore.Geo;
namespace LiveChartsCore.SkiaSharpView.WPF;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenMapChart class to add wpf specific
-// code, this class is just to expose the GeoMap class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.WPF.csproj b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.WPF.csproj
index 9eebd689a..b2f54a067 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.WPF.csproj
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.WPF.csproj
@@ -1,8 +1,6 @@
- enable
- $(GlobalLangVersion)true
@@ -29,8 +27,8 @@
true
-
-
+
+ $(DefineConstants);WPF_LVC;XAML_LVC
@@ -51,6 +49,10 @@
+
+ $(DefineConstants);STRONG_NAMED_ASSEMBLIES
+
+
all
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/MotionCanvas.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/MotionCanvas.cs
index 526234be2..2e5bf674c 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/MotionCanvas.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/MotionCanvas.cs
@@ -39,10 +39,10 @@ static MotionCanvas()
_ = LiveChartsSkiaSharp
.EnsureInitialized()
.HasRenderingFactory(
- (settings, forceGPU) =>
+ (settings) =>
{
#if NET6_0_OR_GREATER
- IRenderMode renderMode = forceGPU || settings.UseGPU
+ IRenderMode renderMode = settings.UseGPU
? new GPURenderMode()
: new CPURenderMode();
@@ -52,7 +52,7 @@ static MotionCanvas()
return new MotionCanvasComposer(renderMode, ticker);
#else
- IRenderMode renderMode = forceGPU || settings.UseGPU
+ IRenderMode renderMode = settings.UseGPU
? throw new System.Exception("LiveCharts does not support hardware acceleration in WPF .Net Framework.")
: new CPURenderMode();
@@ -68,9 +68,9 @@ static MotionCanvas()
///
/// Initializes a new instance of the class.
///
- public MotionCanvas(bool forceGPU)
+ public MotionCanvas()
{
- _composer = LiveChartsSkiaSharp.MotionCanvasRenderingFactory(LiveCharts.RenderingSettings, forceGPU);
+ _composer = LiveChartsSkiaSharp.MotionCanvasRenderingFactory(LiveCharts.RenderingSettings);
_ = Children.Add((UIElement)_composer.RenderMode);
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PieChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PieChart.cs
index 454278067..295449879 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PieChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PieChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.WPF;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenPieChart class to add wpf specific
-// code, this class is just to expose the PieChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PolarChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PolarChart.cs
index ed3f2a2e2..0f79abd6f 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PolarChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PolarChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.WPF;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenPolarChart class to add wpf specific
-// code, this class is just to expose the PolarChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenCartesianChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenCartesianChart.wpf.cs
similarity index 86%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenCartesianChart.wpf.cs
index c8c343fc2..02036aba3 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenCartesianChart.wpf.cs
@@ -28,12 +28,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the WPF specific code for the SourceGenCartesianChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the WPF specific code
+// ===============================================
///
public partial class SourceGenCartesianChart : SourceGenChart, ICartesianChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenChart.cs
similarity index 93%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenChart.cs
index 8418ff4e7..05e243e40 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenChart.cs
@@ -36,10 +36,11 @@
namespace LiveChartsGeneratedCode;
// ==============================================================================
-//
-// this file contains the WPF specific code for the SourceGenChart class,
-// the rest of the code can be found in the _Shared project.
-//
+// this file is the base class for this UI framework controls, in this file we
+// define the UI framework specific code.
+// expanding this file in the solution explorer will show 2 more files:
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
@@ -51,7 +52,7 @@ public abstract partial class SourceGenChart : UserControl, IChartView
/// Default colors are not valid
protected SourceGenChart()
{
- Content = new MotionCanvas(ForceGPU);
+ Content = new MotionCanvas();
SizeChanged += (s, e) =>
CoreChart.Update();
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenMapChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenMapChart.wpf.cs
similarity index 87%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenMapChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenMapChart.wpf.cs
index 831a94900..94df686b1 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenMapChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenMapChart.wpf.cs
@@ -24,7 +24,6 @@
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
-using LiveChartsCore;
using LiveChartsCore.Drawing;
using LiveChartsCore.Geo;
using LiveChartsCore.Kernel.Sketches;
@@ -33,12 +32,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the WPF specific code for the SourceGenMapChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the WPF specific code
+// ===============================================
///
public abstract partial class SourceGenMapChart : UserControl, IGeoMapView
@@ -49,7 +45,7 @@ public abstract partial class SourceGenMapChart : UserControl, IGeoMapView
/// Default colors are not valid
protected SourceGenMapChart()
{
- Content = new MotionCanvas(false);
+ Content = new MotionCanvas();
SizeChanged += (s, e) =>
CoreChart.Update();
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenPieChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenPieChart.wpf.cs
similarity index 81%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenPieChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenPieChart.wpf.cs
index 7b8757f54..57d3cb5e7 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenPieChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenPieChart.wpf.cs
@@ -24,12 +24,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the Eto specific code for the SourceGenPieChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the WPF specific code
+// ===============================================
///
public partial class SourceGenPieChart : SourceGenChart, IPieChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenPolarChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenPolarChart.wpf.cs
similarity index 81%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenPolarChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenPolarChart.wpf.cs
index c726e91f6..c63c737fa 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenPolarChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/SourceGenPolarChart.wpf.cs
@@ -24,12 +24,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the Eto specific code for the SourceGenPolarChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the WPF specific code
+// ===============================================
///
public partial class SourceGenPolarChart : SourceGenChart, IPolarChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/AssemblyInfo.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/AssemblyInfo.cs
index a21d8a792..b2478b6e7 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/AssemblyInfo.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/AssemblyInfo.cs
@@ -1,4 +1,4 @@
-// The MIT License(MIT)
+// The MIT License(MIT)
//
// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
//
@@ -20,11 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
-#if !DEBUG && NET462
+#if STRONG_NAMED_ASSEMBLIES
using System.Reflection;
[assembly: AssemblyKeyFile("./../../../LiveCharts.snk")]
-#else
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo("LiveChartsCore.BackersPackage")]
#endif
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/CartesianChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/CartesianChart.cs
index 9c4d8460f..94a2e4c82 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/CartesianChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/CartesianChart.cs
@@ -25,12 +25,14 @@
namespace LiveChartsCore.SkiaSharpView.WinForms;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenCartesianChart class to add winforms specific
-// code, this class is just to expose the CartesianChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
+[System.ComponentModel.DesignerCategory("")]
public partial class CartesianChart : LiveChartsGeneratedCode.SourceGenCartesianChart
{ }
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/GeoMap.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/GeoMap.cs
index 5bb28b447..59dd4e348 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/GeoMap.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/GeoMap.cs
@@ -20,17 +20,19 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
-using LiveChartsCore.Kernel.Sketches;
+using LiveChartsCore.Geo;
namespace LiveChartsCore.SkiaSharpView.WinForms;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenMapChart class to add winui/uno specific
-// code, this class is just to expose the GeoMap class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
+[System.ComponentModel.DesignerCategory("")]
public sealed partial class GeoMap : LiveChartsGeneratedCode.SourceGenMapChart
{ }
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsCore.SkiaSharpView.WinForms.csproj b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsCore.SkiaSharpView.WinForms.csproj
index 9f079c626..ab4496e53 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsCore.SkiaSharpView.WinForms.csproj
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsCore.SkiaSharpView.WinForms.csproj
@@ -1,9 +1,6 @@
- $(GlobalLangVersion)
- enable
-
WinExetrueLibrary
@@ -32,7 +29,7 @@
true
-
+ bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml
@@ -50,6 +47,10 @@
+
+ $(DefineConstants);STRONG_NAMED_ASSEMBLIES
+
+
all
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/MotionCanvas.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/MotionCanvas.cs
index aea3f6a20..3d8ac3d46 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/MotionCanvas.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/MotionCanvas.cs
@@ -20,9 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
-using System;
using System.ComponentModel;
-using System.Windows.Forms;
using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.Motion;
using LiveChartsCore.SkiaSharpView.Drawing;
@@ -35,6 +33,7 @@ namespace LiveChartsCore.SkiaSharpView.WinForms;
/// The motion canvas control for windows forms, .
///
///
+[DesignerCategory("")]
public partial class MotionCanvas : UserControl, IRenderMode
{
private IFrameTicker _ticker = null!;
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/PieChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/PieChart.cs
index 1ab69a6e2..ef5bf317c 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/PieChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/PieChart.cs
@@ -25,12 +25,14 @@
namespace LiveChartsCore.SkiaSharpView.WinForms;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenPieChart class to add winforms specific
-// code, this class is just to expose the PieChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
+[System.ComponentModel.DesignerCategory("")]
public partial class PieChart : LiveChartsGeneratedCode.SourceGenPieChart
{ }
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/PolarChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/PolarChart.cs
index 6bc199098..063ebbd74 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/PolarChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/PolarChart.cs
@@ -25,12 +25,14 @@
namespace LiveChartsCore.SkiaSharpView.WinForms;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenPolarChart class to add winforms specific
-// code, this class is just to expose the PolarChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
+[System.ComponentModel.DesignerCategory("")]
public partial class PolarChart : LiveChartsGeneratedCode.SourceGenPolarChart
{ }
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenCartesianChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenCartesianChart.winforms.cs
similarity index 86%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenCartesianChart.winforms.cs
index 4b358c960..ee57bb8bb 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenCartesianChart.winforms.cs
@@ -28,12 +28,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the WinForms specific code for the SourceGenCartesianChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the Winforms specific code
+// ===============================================
///
public partial class SourceGenCartesianChart : SourceGenChart, ICartesianChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenCartesianChart.resx b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenCartesianChart.winforms.resx
similarity index 100%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenCartesianChart.resx
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenCartesianChart.winforms.resx
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenChart.cs
similarity index 93%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenChart.cs
index edb034874..fed52ab1d 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenChart.cs
@@ -32,13 +32,15 @@
namespace LiveChartsGeneratedCode;
// ==============================================================================
-//
-// this file contains the WinForms specific code for the SourceGenChart class,
-// the rest of the code can be found in the _Shared project.
-//
+// this file is the base class for this UI framework controls, in this file we
+// define the UI framework specific code.
+// expanding this file in the solution explorer will show 2 more files:
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
+[DesignerCategory("")]
public abstract partial class SourceGenChart : UserControl, IChartView
{
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenChart.resx b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenChart.resx
similarity index 100%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenChart.resx
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenChart.resx
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenMapChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenMapChart.winforms.cs
similarity index 91%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenMapChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenMapChart.winforms.cs
index 45a8cff9f..85f3cb92c 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenMapChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenMapChart.winforms.cs
@@ -32,12 +32,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the WinForms specific code for the SourceGenMapChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the Winforms specific code
+// ===============================================
///
public abstract partial class SourceGenMapChart : UserControl, IGeoMapView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenMapChart.resx b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenMapChart.winforms.resx
similarity index 100%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenMapChart.resx
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenMapChart.winforms.resx
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenPieChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenPieChart.winforms.cs
similarity index 81%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenPieChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenPieChart.winforms.cs
index 56993e607..ce297f187 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenPieChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenPieChart.winforms.cs
@@ -24,12 +24,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the WPF specific code for the SourceGenPieChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the Winforms specific code
+// ===============================================
///
public partial class SourceGenPieChart : SourceGenChart, IPieChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenPolarChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenPolarChart.winforms.cs
similarity index 81%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenPolarChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenPolarChart.winforms.cs
index 2fae6c184..5cce119aa 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsGeneratedCode/SourceGenPolarChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenPolarChart.winforms.cs
@@ -24,12 +24,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the WPF specific code for the SourceGenPolarChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the Winforms specific code
+// ===============================================
///
public partial class SourceGenPolarChart : SourceGenChart, IPolarChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenPolarChart.resx b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenPolarChart.winforms.resx
similarity index 100%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenPolarChart.resx
rename to src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/SourceGenPolarChart.winforms.resx
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/AssemblyInfo.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/AssemblyInfo.cs
index c3798ddeb..2f8481f63 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp/AssemblyInfo.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp/AssemblyInfo.cs
@@ -22,16 +22,18 @@
using System.Runtime.CompilerServices;
-#if !DEBUG && NET462
+#if STRONG_NAMED_ASSEMBLIES
using System.Reflection;
[assembly: AssemblyKeyFile("./../../../LiveCharts.snk")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.WinForms, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.WPF, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")]
+[assembly: InternalsVisibleTo("CoreTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")]
#else
+[assembly: InternalsVisibleTo("CoreTests")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView")]
[assembly: InternalsVisibleTo("LiveChartsCore.Behaviours")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.WinForms")]
@@ -44,8 +46,6 @@
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Eto")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Blazor")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Maui")]
-[assembly: InternalsVisibleTo("LiveChartsCore.BackersPackage")]
-[assembly: InternalsVisibleTo("LiveChartsCore.UnitTesting")]
#endif
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj b/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj
index e24957d2f..de9aad95c 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj
@@ -1,37 +1,28 @@
- enable
- $(GlobalLangVersion)
-
net462;
netstandard2.0;
- netstandard2.1;
net8.0;
LiveChartsCore.SkiaSharpViewLiveChartsCore.SkiaSharpView
- $(LiveChartsVersion)
- icon.png
- Simple, flexible, interactive and powerful data visualization for .Net, this package contains the SkiaSharp backend.
- MIT
- $(LiveChartsAuthors)
- true
- snupkg
- portable
- true
- https://github.com/beto-rodriguez/LiveCharts2
-
- true
- true
- true
- true
-
+
+
+
+
+
+
+
+ $(Description) This package renders charts using SkiaSharp, this is enough if you only need to render images otherwise you probably need another package that is compatible with your UI framework.
+
+
+
@@ -44,7 +35,6 @@
bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml
- true
@@ -57,6 +47,10 @@
+
+ $(DefineConstants);STRONG_NAMED_ASSEMBLIES
+
+
all
@@ -71,8 +65,4 @@
-
-
-
-
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsSkiaSharp.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsSkiaSharp.cs
index 476baabd5..476bf8b4c 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsSkiaSharp.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsSkiaSharp.cs
@@ -20,7 +20,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
-using System;
using LiveChartsCore.Drawing;
using LiveChartsCore.Kernel;
using LiveChartsCore.Kernel.Sketches;
@@ -39,7 +38,7 @@ namespace LiveChartsCore.SkiaSharpView;
public static class LiveChartsSkiaSharp
{
internal static MotionCanvasComposer.MotionCanvasRenderingFactoryDelegate MotionCanvasRenderingFactory { get; set; } =
- (settings, chart) => throw new NotImplementedException(
+ (settings) => throw new NotImplementedException(
"No motion canvas rendering factory has been set, please use the method 'HasMotionCanvasRenderingFactory' to set one.");
internal static TextSettings DefaultTextSettings { get; set; } = new();
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/images/icon.png b/src/skiasharp/LiveChartsCore.SkiaSharp/images/icon.png
deleted file mode 100644
index d0c1c5660..000000000
Binary files a/src/skiasharp/LiveChartsCore.SkiaSharp/images/icon.png and /dev/null differ
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/AssemblyInfo.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/AssemblyInfo.cs
deleted file mode 100644
index 74c554c92..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/AssemblyInfo.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// The MIT License(MIT)
-//
-// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo("LiveChartsCore.BackersPackage")]
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/CartesianChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/CartesianChart.cs
new file mode 100644
index 000000000..e9f665a35
--- /dev/null
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/CartesianChart.cs
@@ -0,0 +1,38 @@
+// The MIT License(MIT)
+//
+// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+using LiveChartsCore.Kernel.Sketches;
+using LiveChartsGeneratedCode;
+
+namespace LiveChartsCore.SkiaSharpView.Blazor;
+
+// ==============================================================================
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
+// ==============================================================================
+
+///
+public partial class CartesianChart : SourceGenCartesianChart, ICartesianChartView
+{ }
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/CartesianChart.razor b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/CartesianChart.razor
deleted file mode 100644
index c118f7234..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/CartesianChart.razor
+++ /dev/null
@@ -1,38 +0,0 @@
-@*
- The MIT License(MIT)
-
- Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-*@
-
-@inherits LiveChartsGeneratedCode.SourceGenCartesianChart
-
-@*
-==============================================================================
-
-use the LiveChartsGeneratedCode.SourceGenCartesianChart class to add blazor specific
-code, this class is just to expose the CartesianChart class in this namespace.
-
-==============================================================================
-*@
-
-@{
- base.BuildRenderTree(__builder);
-}
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/GeoMap.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/GeoMap.cs
new file mode 100644
index 000000000..d99c789c8
--- /dev/null
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/GeoMap.cs
@@ -0,0 +1,38 @@
+// The MIT License(MIT)
+//
+// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+using LiveChartsCore.Geo;
+using LiveChartsGeneratedCode;
+
+namespace LiveChartsCore.SkiaSharpView.Blazor;
+
+// ==============================================================================
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
+// ==============================================================================
+
+///
+public partial class GeoMap : SourceGenMapChart
+{ }
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/GeoMap.razor b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/GeoMap.razor
deleted file mode 100644
index 191f55845..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/GeoMap.razor
+++ /dev/null
@@ -1,39 +0,0 @@
-@*
- The MIT License(MIT)
-
- Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-*@
-
-@inherits LiveChartsGeneratedCode.SourceGenMapChart
-
-@*
-==============================================================================
-
-use the LiveChartsGeneratedCode.SourceGenMapChart class to add blazor specific
-code, this class is just to expose the MapChart class in this namespace.
-
-==============================================================================
-*@
-
-@{
- base.BuildRenderTree(__builder);
-}
-
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenCartesianChart.razor b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenCartesianChart.razor
deleted file mode 100644
index 1df571998..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenCartesianChart.razor
+++ /dev/null
@@ -1,31 +0,0 @@
-@*
- The MIT License(MIT)
-
- Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-*@
-
-@namespace LiveChartsGeneratedCode
-
-@inherits SourceGenChart
-
-@{
- base.BuildRenderTree(__builder);
-}
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenChart.razor b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenChart.razor
deleted file mode 100644
index fb1b821ba..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenChart.razor
+++ /dev/null
@@ -1,36 +0,0 @@
-@*
- The MIT License(MIT)
-
- Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-*@
-
-@using LiveChartsCore.SkiaSharpView.Blazor
-
-@namespace LiveChartsGeneratedCode
-
-
-
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenMapChart.razor b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenMapChart.razor
deleted file mode 100644
index 048195b9a..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenMapChart.razor
+++ /dev/null
@@ -1,31 +0,0 @@
-@*
- The MIT License(MIT)
-
- Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-*@
-
-@using LiveChartsCore.SkiaSharpView.Blazor
-
-@namespace LiveChartsGeneratedCode
-
-
-
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenPieChart.razor b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenPieChart.razor
deleted file mode 100644
index 1df571998..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenPieChart.razor
+++ /dev/null
@@ -1,31 +0,0 @@
-@*
- The MIT License(MIT)
-
- Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-*@
-
-@namespace LiveChartsGeneratedCode
-
-@inherits SourceGenChart
-
-@{
- base.BuildRenderTree(__builder);
-}
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenPolarChart.razor b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenPolarChart.razor
deleted file mode 100644
index 1df571998..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenPolarChart.razor
+++ /dev/null
@@ -1,31 +0,0 @@
-@*
- The MIT License(MIT)
-
- Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-*@
-
-@namespace LiveChartsGeneratedCode
-
-@inherits SourceGenChart
-
-@{
- base.BuildRenderTree(__builder);
-}
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveChartsCore.SkiaSharpView.Blazor.csproj b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveChartsCore.SkiaSharpView.Blazor.csproj
index 6f0374a35..cd9d9304a 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveChartsCore.SkiaSharpView.Blazor.csproj
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveChartsCore.SkiaSharpView.Blazor.csproj
@@ -1,9 +1,6 @@
- $(GlobalLangVersion)
- enable
-
net6.0;net8.0enable
@@ -27,7 +24,7 @@
true
-
+ $(DefineConstants);BLAZOR_LVC
@@ -74,4 +71,5 @@
+
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/PieChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/PieChart.cs
new file mode 100644
index 000000000..909cb09f0
--- /dev/null
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/PieChart.cs
@@ -0,0 +1,39 @@
+// The MIT License(MIT)
+//
+// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+using LiveChartsCore.Kernel.Sketches;
+using LiveChartsGeneratedCode;
+
+namespace LiveChartsCore.SkiaSharpView.Blazor;
+
+// ==============================================================================
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
+// ==============================================================================
+
+///
+public partial class PieChart : SourceGenPieChart
+{ }
+
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/PieChart.razor b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/PieChart.razor
deleted file mode 100644
index 7559fca9a..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/PieChart.razor
+++ /dev/null
@@ -1,38 +0,0 @@
-@*
- The MIT License(MIT)
-
- Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-*@
-
-@inherits LiveChartsGeneratedCode.SourceGenPieChart
-
-@*
-==============================================================================
-
-use the LiveChartsGeneratedCode.SourceGenPieChart class to add blazor specific
-code, this class is just to expose the PieChart class in this namespace.
-
-==============================================================================
-*@
-
-@{
- base.BuildRenderTree(__builder);
-}
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/PolarChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/PolarChart.cs
new file mode 100644
index 000000000..213d873eb
--- /dev/null
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/PolarChart.cs
@@ -0,0 +1,39 @@
+// The MIT License(MIT)
+//
+// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+using LiveChartsCore.Kernel.Sketches;
+using LiveChartsGeneratedCode;
+
+namespace LiveChartsCore.SkiaSharpView.Blazor;
+
+// ==============================================================================
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
+// ==============================================================================
+
+///
+public partial class PolarChart : SourceGenPolarChart
+{ }
+
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/PolarChart.razor b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/PolarChart.razor
deleted file mode 100644
index fca54952c..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/PolarChart.razor
+++ /dev/null
@@ -1,38 +0,0 @@
-@*
- The MIT License(MIT)
-
- Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-*@
-
-@inherits LiveChartsGeneratedCode.SourceGenPolarChart
-
-@*
-==============================================================================
-
-use the LiveChartsGeneratedCode.SourceGenPolarChart class to add blazor specific
-code, this class is just to expose the PolarChart class in this namespace.
-
-==============================================================================
-*@
-
-@{
- base.BuildRenderTree(__builder);
-}
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenCartesianChart.razor.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenCartesianChart.blazor.cs
similarity index 82%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenCartesianChart.razor.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenCartesianChart.blazor.cs
index c99785668..5b4c9768b 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenCartesianChart.razor.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenCartesianChart.blazor.cs
@@ -24,20 +24,24 @@
using LiveChartsCore.Drawing;
using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.Measure;
+using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.AspNetCore.Components.Web;
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the Blazor specific code for the CartesianChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the Blazor specific code
+// ===============================================
///
public partial class SourceGenCartesianChart : SourceGenChart, ICartesianChartView
{
+ ///
+ /// Builds the render tree.
+ ///
+ protected override void BuildRenderTree(RenderTreeBuilder builder) =>
+ base.BuildRenderTree(builder);
+
///
protected override void OnWheel(WheelEventArgs e)
{
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenChart.razor.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenChart.cs
similarity index 77%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenChart.razor.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenChart.cs
index bfddd1a50..f0d14ef96 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenChart.razor.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenChart.cs
@@ -25,19 +25,21 @@
using LiveChartsCore.Motion;
using LiveChartsCore.SkiaSharpView.Blazor;
using Microsoft.AspNetCore.Components;
+using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.AspNetCore.Components.Web;
namespace LiveChartsGeneratedCode;
// ==============================================================================
-//
-// this file contains the Blazor specific code for the ChartControl class,
-// the rest of the code can be found in the _Shared project.
-//
+// this file is the base class for this UI framework controls, in this file we
+// define the UI framework specific code.
+// expanding this file in the solution explorer will show 2 more files:
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
-public abstract partial class SourceGenChart : IDisposable, IChartView
+public abstract partial class SourceGenChart : ComponentBase, IDisposable, IChartView
{
#pragma warning disable IDE0032 // Use auto property, blazor ref
private MotionCanvas _motionCanvas = null!;
@@ -58,6 +60,22 @@ protected SourceGenChart()
///
public CoreMotionCanvas CoreCanvas => _motionCanvas.CanvasCore;
+ ///
+ /// Builds the render tree.
+ ///
+ protected override void BuildRenderTree(RenderTreeBuilder builder)
+ {
+ base.BuildRenderTree(builder);
+ builder.OpenComponent(0);
+ builder.AddAttribute(1, "OnPointerDownCallback", EventCallback.Factory.Create(this, OnPointerDown));
+ builder.AddAttribute(2, "OnPointerMoveCallback", EventCallback.Factory.Create(this, OnPointerMove));
+ builder.AddAttribute(3, "OnPointerUpCallback", EventCallback.Factory.Create(this, OnPointerUp));
+ builder.AddAttribute(4, "OnPointerOutCallback", EventCallback.Factory.Create(this, OnPointerOut));
+ builder.AddAttribute(5, "OnWheelCallback", EventCallback.Factory.Create(this, OnWheel));
+ builder.AddComponentReferenceCapture(7, r => _motionCanvas = (MotionCanvas)r);
+ builder.CloseComponent();
+ }
+
///
protected override void OnAfterRender(bool firstRender)
{
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenMapChart.razor.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenMapChart.blazor.cs
similarity index 79%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenMapChart.razor.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenMapChart.blazor.cs
index 1e0160f1e..3dc3acc34 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenMapChart.razor.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenMapChart.blazor.cs
@@ -25,18 +25,17 @@
using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.Motion;
using LiveChartsCore.SkiaSharpView.Blazor;
+using Microsoft.AspNetCore.Components;
+using Microsoft.AspNetCore.Components.Rendering;
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the Blazor specific code for the SourceGenMapChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the Blazor specific code
+// ===============================================
///
-public abstract partial class SourceGenMapChart : IDisposable, IGeoMapView
+public abstract partial class SourceGenMapChart : ComponentBase, IDisposable, IGeoMapView
{
#pragma warning disable IDE0032 // Use auto property, blazor ref
private MotionCanvas _motionCanvas = null!;
@@ -61,6 +60,16 @@ protected SourceGenMapChart()
Height = _motionCanvas.Height
};
+ ///
+ /// Builds the render tree.
+ ///
+ protected override void BuildRenderTree(RenderTreeBuilder builder)
+ {
+ builder.OpenComponent(0);
+ builder.AddComponentReferenceCapture(1, r => _motionCanvas = (MotionCanvas)r);
+ builder.CloseComponent();
+ }
+
///
protected override void OnAfterRender(bool firstRender)
{
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenPieChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenPieChart.blazor.cs
similarity index 78%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenPieChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenPieChart.blazor.cs
index b50e1d0de..761366a51 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenPieChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenPieChart.blazor.cs
@@ -21,16 +21,20 @@
// SOFTWARE.
using LiveChartsCore.Kernel.Sketches;
+using Microsoft.AspNetCore.Components.Rendering;
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the MAUI specific code for the SourceGenPieChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the Blazor specific code
+// ===============================================
///
public partial class SourceGenPieChart : SourceGenChart, IPieChartView
-{ }
+{
+ ///
+ /// Builds the render tree.
+ ///
+ protected override void BuildRenderTree(RenderTreeBuilder builder) =>
+ base.BuildRenderTree(builder);
+}
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenPolarChart.razor.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenPolarChart.blazor.cs
similarity index 78%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenPolarChart.razor.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenPolarChart.blazor.cs
index b55f99152..030832c4f 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenPolarChart.razor.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/SourceGenPolarChart.blazor.cs
@@ -21,16 +21,20 @@
// SOFTWARE.
using LiveChartsCore.Kernel.Sketches;
+using Microsoft.AspNetCore.Components.Rendering;
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the Blazor specific code for the PolarChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the Blazor specific code
+// ===============================================
///
public partial class SourceGenPolarChart : SourceGenChart, IPolarChartView
-{ }
+{
+ ///
+ /// Builds the render tree.
+ ///
+ protected override void BuildRenderTree(RenderTreeBuilder builder) =>
+ base.BuildRenderTree(builder);
+}
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/AssemblyInfo.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/AssemblyInfo.cs
deleted file mode 100644
index 74c554c92..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/AssemblyInfo.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// The MIT License(MIT)
-//
-// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo("LiveChartsCore.BackersPackage")]
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/CartesianChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/CartesianChart.cs
index ce2815d32..91f7be668 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/CartesianChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/CartesianChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.Eto;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenCartesianChart class to add eto specific
-// code, this class is just to expose the CartesianChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/GeoMap.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/GeoMap.cs
index a75ac0a0f..a4909b644 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/GeoMap.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/GeoMap.cs
@@ -23,10 +23,11 @@
using LiveChartsCore.Geo;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenMapChart class to add eto specific
-// code, this class is just to expose the GeoMap class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
namespace LiveChartsCore.SkiaSharpView.Eto;
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsCore.SkiaSharpView.Eto.csproj b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsCore.SkiaSharpView.Eto.csproj
index a5ff4f487..86aa81602 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsCore.SkiaSharpView.Eto.csproj
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsCore.SkiaSharpView.Eto.csproj
@@ -2,9 +2,7 @@
Library
- $(GlobalLangVersion)
- enable
- netstandard2.0;netstandard2.1;
+ netstandard2.0;LiveChartsCore.SkiaSharpView.EtoLiveChartsCore.SkiaSharpView.Eto$(LiveChartsVersion)
@@ -24,7 +22,7 @@
true
-
+ true
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/PieChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/PieChart.cs
index 6f02682c9..15b60eb6c 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/PieChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/PieChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.Eto;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenPieChart class to add eto specific
-// code, this class is just to expose the PieChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/PolarChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/PolarChart.cs
index 274d8d511..c27c3203d 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/PolarChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/PolarChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.Eto;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenPolarChart class to add eto specific
-// code, this class is just to expose the PolarChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenCartesianChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenCartesianChart.eto.cs
similarity index 86%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenCartesianChart.eto.cs
index 406623b95..6e1a14f57 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenCartesianChart.eto.cs
@@ -28,12 +28,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the ETO specific code for the SourceGenCartesianChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the Eto specific code
+// ===============================================
///
public partial class SourceGenCartesianChart : SourceGenChart, ICartesianChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenChart.cs
similarity index 92%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenChart.cs
index a0e6f1590..686a0c1f7 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenChart.cs
@@ -31,10 +31,11 @@
namespace LiveChartsGeneratedCode;
// ==============================================================================
-//
-// this file contains the Eto specific code for the SourceGenChart class,
-// the rest of the code can be found in the _Shared project.
-//
+// this file is the base class for this UI framework controls, in this file we
+// define the UI framework specific code.
+// expanding this file in the solution explorer will show 2 more files:
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenMapChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenMapChart.eto.cs
similarity index 88%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenMapChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenMapChart.eto.cs
index e5bdce3c7..2b68f9c2b 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsGeneratedCode/SourceGenMapChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenMapChart.eto.cs
@@ -31,12 +31,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the Eto specific code for the SourceGenMapChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the Eto specific code
+// ===============================================
///
public abstract partial class SourceGenMapChart : Panel, IGeoMapView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenPieChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenPieChart.eto.cs
similarity index 81%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenPieChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenPieChart.eto.cs
index dc864a362..a343c50a2 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenPieChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenPieChart.eto.cs
@@ -24,12 +24,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the WinForms specific code for the SourceGenPieChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the Eto specific code
+// ===============================================
///
public partial class SourceGenPieChart : SourceGenChart, IPieChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenPolarChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenPolarChart.eto.cs
similarity index 81%
rename from src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenPolarChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenPolarChart.eto.cs
index 9178c17ec..6574e7795 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsGeneratedCode/SourceGenPolarChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenPolarChart.eto.cs
@@ -24,12 +24,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the WinForms specific code for the SourceGenPolarChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the Eto specific code
+// ===============================================
///
public partial class SourceGenPolarChart : SourceGenChart, IPolarChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/AssemblyInfo.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/AssemblyInfo.cs
deleted file mode 100644
index 74c554c92..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/AssemblyInfo.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// The MIT License(MIT)
-//
-// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo("LiveChartsCore.BackersPackage")]
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/CartesianChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/CartesianChart.cs
index c5af93463..98d3cd954 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/CartesianChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/CartesianChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.Maui;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenCartesianChart class to add maui specific
-// code, this class is just to expose the CartesianChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/GeoMap.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/GeoMap.cs
index 9c995968a..6d77a7206 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/GeoMap.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/GeoMap.cs
@@ -23,10 +23,11 @@
using LiveChartsCore.Geo;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenMapChart class to add MAUI specific
-// code, this class is just to expose the GeoMap class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
namespace LiveChartsCore.SkiaSharpView.Maui;
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj
index 501e8d825..2473b124f 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj
@@ -1,17 +1,17 @@
- enable
- $(GlobalLangVersion)
-
+ disabletrue
- net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;
+ net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst;
+ net10.0;net10.0-android;net10.0-ios;net10.0-maccatalyst;
$(TargetFrameworks);
- net8.0-windows10.0.19041.0
+ net9.0-windows10.0.19041.0;
+ net10.0-windows10.0.19041.0;
11.0
@@ -21,8 +21,6 @@
10.0.17763.06.5
- win-x86;win-x64;win-arm64
-
$(LiveChartsVersion)icon.pngSimple, flexible, interactive and powerful data visualization for Maui.
@@ -42,19 +40,42 @@
true
-
-
-
+
+
+ $(NoWarn);NETSDK1206
+
+
+
+
+ $(DefineConstants);MAUI_LVC;XAML_LVC
+
+
+
+ 9.0.120
+
+
+ 10.0.0
+
+
+
-
+
+
+
+
+
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/MotionCanvas.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/MotionCanvas.cs
index ad2a9d275..4451e4443 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/MotionCanvas.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/MotionCanvas.cs
@@ -49,9 +49,9 @@ static MotionCanvas()
_ = LiveChartsSkiaSharp
.EnsureInitialized()
.HasRenderingFactory(
- (settings, forceGPU) =>
+ (settings) =>
{
- IRenderMode renderMode = forceGPU || settings.UseGPU
+ IRenderMode renderMode = settings.UseGPU
? new GPURenderMode()
: new CPURenderMode();
@@ -66,9 +66,9 @@ static MotionCanvas()
///
/// Initializes a new instance of the class.
///
- public MotionCanvas(bool forceGPU)
+ public MotionCanvas()
{
- _composer = LiveChartsSkiaSharp.MotionCanvasRenderingFactory(LiveCharts.RenderingSettings, forceGPU);
+ _composer = LiveChartsSkiaSharp.MotionCanvasRenderingFactory(LiveCharts.RenderingSettings);
var view = (View)_composer.RenderMode;
AbsoluteLayout.SetLayoutBounds(view, new(0, 0, 1, 1));
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/PieChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/PieChart.cs
index 804fdd288..231fe703c 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/PieChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/PieChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.Maui;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenPieChart class to add maui specific
-// code, this class is just to expose the PieChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/PolarChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/PolarChart.cs
index 2e6830e84..7e0c27bf8 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/PolarChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/PolarChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.Maui;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenPolarChart class to add maui specific
-// code, this class is just to expose the PolarChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenCartesianChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenCartesianChart.maui.cs
similarity index 87%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenCartesianChart.maui.cs
index dfd1d194c..f26ea94de 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenCartesianChart.maui.cs
@@ -27,12 +27,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the MAUI specific code for the SourceGenCartesianChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the MAUI specific code
+// ===============================================
///
public partial class SourceGenCartesianChart : SourceGenChart, ICartesianChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenChart.cs
similarity index 93%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenChart.cs
index fa6b87690..fa4df7243 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenChart.cs
@@ -33,10 +33,11 @@
namespace LiveChartsGeneratedCode;
// ==============================================================================
-//
-// this file contains the MAUI specific code for the SourceGenChart class,
-// the rest of the code can be found in the _Shared project.
-//
+// this file is the base class for this UI framework controls, in this file we
+// define the UI framework specific code.
+// expanding this file in the solution explorer will show 2 more files:
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
@@ -47,7 +48,7 @@ public abstract partial class SourceGenChart : ChartView, IChartView
///
protected SourceGenChart()
{
- Content = new MotionCanvas(ForceGPU);
+ Content = new MotionCanvas();
SizeChanged += (s, e) =>
CoreChart.Update();
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenMapChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenMapChart.maui.cs
similarity index 86%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenMapChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenMapChart.maui.cs
index 9353ecb5b..359ea3fda 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenMapChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenMapChart.maui.cs
@@ -30,12 +30,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the MAUI specific code for the SourceGenMapChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the MAUI specific code
+// ===============================================
///
public abstract partial class SourceGenMapChart : ChartView, IGeoMapView
@@ -45,7 +42,7 @@ public abstract partial class SourceGenMapChart : ChartView, IGeoMapView
///
protected SourceGenMapChart()
{
- Content = new MotionCanvas(false);
+ Content = new MotionCanvas();
SizeChanged += (s, e) =>
CoreChart.Update();
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenPieChart.razor.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenPieChart.maui.cs
similarity index 81%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenPieChart.razor.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenPieChart.maui.cs
index 905002901..d3f561907 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveCharetsGeneratedCode/SourceGenPieChart.razor.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenPieChart.maui.cs
@@ -24,12 +24,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the Blazor specific code for the PieChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the MAUI specific code
+// ===============================================
///
public partial class SourceGenPieChart : SourceGenChart, IPieChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenPolarChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenPolarChart.maui.cs
similarity index 81%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenPolarChart.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenPolarChart.maui.cs
index af26e16a6..b6f4adf65 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsGeneratedCode/SourceGenPolarChart.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/SourceGenPolarChart.maui.cs
@@ -24,12 +24,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the MAUI specific code for the SourceGenPolarChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the MAUI specific code
+// ===============================================
///
public partial class SourceGenPolarChart : SourceGenChart, IPolarChartView
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/AssemblyInfo.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/AssemblyInfo.cs
deleted file mode 100644
index 74c554c92..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/AssemblyInfo.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// The MIT License(MIT)
-//
-// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo("LiveChartsCore.BackersPackage")]
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/LiveChartsCore.SkiaSharpView.Uno.WinUI.csproj b/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/LiveChartsCore.SkiaSharpView.Uno.WinUI.csproj
index 4422fc387..74edd9e12 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/LiveChartsCore.SkiaSharpView.Uno.WinUI.csproj
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/LiveChartsCore.SkiaSharpView.Uno.WinUI.csproj
@@ -1,21 +1,18 @@
-
+
- enable
- $(GlobalLangVersion)
-
trueLibrary$(LatestSkiaSharpVersion)
- net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;
- net9.0;net9.0-android;net9.0-ios;net9.0-browserwasm;net9.0-desktop
+ net9.0;net9.0-android;net9.0-ios;net9.0-browserwasm;net9.0-desktop;
+ net10.0;net10.0-android;net10.0-ios;net10.0-browserwasm;net10.0-desktop
$(TargetFrameworks);
- net8.0-windows10.0.19041.0;
- net9.0-windows10.0.26100.0;
+ net9.0-windows10.0.19041.0;
+ net10.0-windows10.0.19041.0;
true
@@ -51,10 +48,10 @@
-
-
-
-
+
+
+
+ $(DefineConstants);UNO_LVC;WINUI_LVC;XAML_LVC
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/SkiaRenderer/SkiaRenderMode.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/Rendering/SkiaRenderMode.cs
similarity index 98%
rename from src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/SkiaRenderer/SkiaRenderMode.cs
rename to src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/Rendering/SkiaRenderMode.cs
index 01ee3c901..1c6d4712d 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/SkiaRenderer/SkiaRenderMode.cs
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/Rendering/SkiaRenderMode.cs
@@ -34,7 +34,7 @@
using Uno.WinUI.Graphics2DSK;
using Windows.Foundation;
-namespace LiveChartsCore.SkiaSharpView.WinUI.SkiaRenderer;
+namespace LiveChartsCore.SkiaSharpView.WinUI.Rendering;
internal partial class SkiaRenderMode : Grid, IRenderMode
{
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/readme.txt b/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/readme.txt
deleted file mode 100644
index ff1a68d48..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/readme.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Most of the code is at the _Shared.WinUI project.
-because the code is shared between WinUI and Uno
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/AssemblyInfo.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/AssemblyInfo.cs
deleted file mode 100644
index 74c554c92..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/AssemblyInfo.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// The MIT License(MIT)
-//
-// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo("LiveChartsCore.BackersPackage")]
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.csproj b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.csproj
index 0dcb13a6f..125255461 100644
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.csproj
+++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.csproj
@@ -1,8 +1,5 @@
- $(GlobalLangVersion)
- enable
-
net6.0-windows10.0.19041.0;
net8.0-windows10.0.19041.0;
@@ -34,10 +31,10 @@
true
-
-
-
-
+
+
+
+ $(DefineConstants);WINUI_LVC;XAML_LVC
@@ -60,7 +57,6 @@
-
diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/readme.txt b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/readme.txt
deleted file mode 100644
index ff1a68d48..000000000
--- a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/readme.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Most of the code is at the _Shared.WinUI project.
-because the code is shared between WinUI and Uno
diff --git a/src/skiasharp/_Shared.WinUI/CartesianChart.cs b/src/skiasharp/_Shared.WinUI/CartesianChart.cs
index 7e61bff9c..fc7380c08 100644
--- a/src/skiasharp/_Shared.WinUI/CartesianChart.cs
+++ b/src/skiasharp/_Shared.WinUI/CartesianChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.WinUI;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenCartesianChart class to add winui/uno specific
-// code, this class is just to expose the CartesianChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/_Shared.WinUI/GeoMap.cs b/src/skiasharp/_Shared.WinUI/GeoMap.cs
index efb6e3486..c704cbd85 100644
--- a/src/skiasharp/_Shared.WinUI/GeoMap.cs
+++ b/src/skiasharp/_Shared.WinUI/GeoMap.cs
@@ -20,15 +20,16 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
-using LiveChartsCore.Kernel.Sketches;
+using LiveChartsCore.Geo;
namespace LiveChartsCore.SkiaSharpView.WinUI;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenMapChart class to add winui/uno specific
-// code, this class is just to expose the GeoMap class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/_Shared.WinUI/MotionCanvas.cs b/src/skiasharp/_Shared.WinUI/MotionCanvas.cs
index b65fbca8e..669b03ead 100644
--- a/src/skiasharp/_Shared.WinUI/MotionCanvas.cs
+++ b/src/skiasharp/_Shared.WinUI/MotionCanvas.cs
@@ -21,15 +21,10 @@
// SOFTWARE.
using LiveChartsCore.Motion;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
using LiveChartsCore.Native;
-
-#if !HAS_OS_LVC
-using LiveChartsCore.SkiaSharpView.WinUI.SkiaRenderer;
-#else
using LiveChartsCore.SkiaSharpView.WinUI.Rendering;
-#endif
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
#pragma warning disable IDE0028 // Simplify collection initialization
@@ -47,7 +42,7 @@ static MotionCanvas()
_ = LiveChartsSkiaSharp
.EnsureInitialized()
.HasRenderingFactory(
- (settings, forceGPU) =>
+ (settings) =>
{
IFrameTicker ticker;
@@ -58,7 +53,7 @@ static MotionCanvas()
? new NativeFrameTicker()
: new AsyncLoopTicker();
#else
- IRenderMode renderMode = forceGPU || settings.UseGPU
+ IRenderMode renderMode = settings.UseGPU
? new GPURenderMode()
: new CPURenderMode();
@@ -74,9 +69,9 @@ static MotionCanvas()
///
/// Initializes a new instance of the class.
///
- public MotionCanvas(bool forceGPU)
+ public MotionCanvas()
{
- _composer = LiveChartsSkiaSharp.MotionCanvasRenderingFactory(LiveCharts.RenderingSettings, forceGPU);
+ _composer = LiveChartsSkiaSharp.MotionCanvasRenderingFactory(LiveCharts.RenderingSettings);
Children.Add((UIElement)_composer.RenderMode);
diff --git a/src/skiasharp/_Shared.WinUI/PieChart.cs b/src/skiasharp/_Shared.WinUI/PieChart.cs
index a61131a92..c59b76169 100644
--- a/src/skiasharp/_Shared.WinUI/PieChart.cs
+++ b/src/skiasharp/_Shared.WinUI/PieChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.WinUI;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenPieChart class to add winui/uno specific
-// code, this class is just to expose the PieChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/_Shared.WinUI/PolarChart.cs b/src/skiasharp/_Shared.WinUI/PolarChart.cs
index b5ab3bbc2..b5ce8fb1f 100644
--- a/src/skiasharp/_Shared.WinUI/PolarChart.cs
+++ b/src/skiasharp/_Shared.WinUI/PolarChart.cs
@@ -25,10 +25,11 @@
namespace LiveChartsCore.SkiaSharpView.WinUI;
// ==============================================================================
-//
-// use the LiveChartsGeneratedCode.SourceGenPolarChart class to add winui/uno specific
-// code, this class is just to expose the PolarChart class in this namespace.
-//
+// this file exposes the control at this namespace.
+// to see the code expand this file in the solution explorer, it will include 3 files:
+// - *.uiFramework.cs: The UI framework specific code
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
diff --git a/src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenCartesianChart.cs b/src/skiasharp/_Shared.WinUI/SourceGenCartesianChart.winui.cs
similarity index 87%
rename from src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
rename to src/skiasharp/_Shared.WinUI/SourceGenCartesianChart.winui.cs
index a268709ec..6b63633ba 100644
--- a/src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenCartesianChart.cs
+++ b/src/skiasharp/_Shared.WinUI/SourceGenCartesianChart.winui.cs
@@ -28,12 +28,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the WinUI/UNO specific code for the SourceGenCartesianChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the WinUI/Uno specific code
+// ===============================================
///
public partial class SourceGenCartesianChart : SourceGenChart, ICartesianChartView
diff --git a/src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenChart.cs b/src/skiasharp/_Shared.WinUI/SourceGenChart.cs
similarity index 94%
rename from src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenChart.cs
rename to src/skiasharp/_Shared.WinUI/SourceGenChart.cs
index 9f806f65a..2a564a1e5 100644
--- a/src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenChart.cs
+++ b/src/skiasharp/_Shared.WinUI/SourceGenChart.cs
@@ -36,10 +36,11 @@
namespace LiveChartsGeneratedCode;
// ==============================================================================
-//
-// this file contains the WinUI/UNO specific code for the SourceGenChart class,
-// the rest of the code can be found in the _Shared project.
-//
+// this file is the base class for this UI framework controls, in this file we
+// define the UI framework specific code.
+// expanding this file in the solution explorer will show 2 more files:
+// - *.shared.cs: shared code between all UI frameworks
+// - *.sgp.cs: the source generated properties
// ==============================================================================
///
@@ -55,7 +56,7 @@ public abstract partial class SourceGenChart : UserControl, IChartView
///
public SourceGenChart()
{
- Content = new MotionCanvas(ForceGPU);
+ Content = new MotionCanvas();
SizeChanged += (s, e) =>
CoreChart.Update();
diff --git a/src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenMapChart.cs b/src/skiasharp/_Shared.WinUI/SourceGenMapChart.winui.cs
similarity index 88%
rename from src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenMapChart.cs
rename to src/skiasharp/_Shared.WinUI/SourceGenMapChart.winui.cs
index e51c5e7b7..686bd5a2b 100644
--- a/src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenMapChart.cs
+++ b/src/skiasharp/_Shared.WinUI/SourceGenMapChart.winui.cs
@@ -32,12 +32,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the WinUI/UNO specific code for the SourceGenMapChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the WinUI/Uno specific code
+// ===============================================
///
public abstract partial class SourceGenMapChart : UserControl, IGeoMapView
@@ -49,7 +46,7 @@ public abstract partial class SourceGenMapChart : UserControl, IGeoMapView
///
public SourceGenMapChart()
{
- Content = new MotionCanvas(false);
+ Content = new MotionCanvas();
InitializeChartControl();
diff --git a/src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenPieChart.cs b/src/skiasharp/_Shared.WinUI/SourceGenPieChart.winui.cs
similarity index 81%
rename from src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenPieChart.cs
rename to src/skiasharp/_Shared.WinUI/SourceGenPieChart.winui.cs
index dc0bf9e1b..e3e9212b5 100644
--- a/src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenPieChart.cs
+++ b/src/skiasharp/_Shared.WinUI/SourceGenPieChart.winui.cs
@@ -24,12 +24,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the WinUI/UNO specific code for the SourceGenPieChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the WinUI/Uno specific code
+// ===============================================
///
public partial class SourceGenPieChart : SourceGenChart, IPieChartView
diff --git a/src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenPolarChart.cs b/src/skiasharp/_Shared.WinUI/SourceGenPolarChart.winui.cs
similarity index 81%
rename from src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenPolarChart.cs
rename to src/skiasharp/_Shared.WinUI/SourceGenPolarChart.winui.cs
index 9905999a5..bda351d7e 100644
--- a/src/skiasharp/_Shared.WinUI/LiveChartsGeneratedCode/SourceGenPolarChart.cs
+++ b/src/skiasharp/_Shared.WinUI/SourceGenPolarChart.winui.cs
@@ -24,12 +24,9 @@
namespace LiveChartsGeneratedCode;
-// ==============================================================================
-//
-// this file contains the WinUI/UNO specific code for the SourceGenPolarChart class,
-// the rest of the code can be found in the _Shared project.
-//
-// ==============================================================================
+// ===============================================
+// this file contains the WinUI/Uno specific code
+// ===============================================
///
public partial class SourceGenPolarChart : SourceGenChart, IPolarChartView
diff --git a/src/skiasharp/_Shared.WinUI/_Shared.WinUI.projitems b/src/skiasharp/_Shared.WinUI/_Shared.WinUI.projitems
index 8e7910781..4a225d1c5 100644
--- a/src/skiasharp/_Shared.WinUI/_Shared.WinUI.projitems
+++ b/src/skiasharp/_Shared.WinUI/_Shared.WinUI.projitems
@@ -11,16 +11,16 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/src/skiasharp/_Shared/SourceGenCartesianChart.cs b/src/skiasharp/_Shared/SourceGenCartesianChart.shared.cs
similarity index 95%
rename from src/skiasharp/_Shared/SourceGenCartesianChart.cs
rename to src/skiasharp/_Shared/SourceGenCartesianChart.shared.cs
index e3d9bc5ee..11e7686b0 100644
--- a/src/skiasharp/_Shared/SourceGenCartesianChart.cs
+++ b/src/skiasharp/_Shared/SourceGenCartesianChart.shared.cs
@@ -35,6 +35,10 @@
namespace LiveChartsGeneratedCode;
+// ==============================================================
+// this file contains the shared code between all UI frameworks
+// ==============================================================
+
///
#if SKIA_IMAGE_LVC
public partial class SourceGenSKCartesianChart : SGChart, ICartesianChartView
diff --git a/src/skiasharp/_Shared/SourceGenChartControl.sgp.cs b/src/skiasharp/_Shared/SourceGenChart.sgp.cs
similarity index 100%
rename from src/skiasharp/_Shared/SourceGenChartControl.sgp.cs
rename to src/skiasharp/_Shared/SourceGenChart.sgp.cs
diff --git a/src/skiasharp/_Shared/SourceGenChartControl.cs b/src/skiasharp/_Shared/SourceGenChart.shared.cs
similarity index 97%
rename from src/skiasharp/_Shared/SourceGenChartControl.cs
rename to src/skiasharp/_Shared/SourceGenChart.shared.cs
index 323b41eee..a36ef0674 100644
--- a/src/skiasharp/_Shared/SourceGenChartControl.cs
+++ b/src/skiasharp/_Shared/SourceGenChart.shared.cs
@@ -38,6 +38,10 @@
namespace LiveChartsGeneratedCode;
+// ==============================================================
+// this file contains the shared code between all UI frameworks
+// ==============================================================
+
///
#if SKIA_IMAGE_LVC
public partial class SourceGenSKChart : IChartView
@@ -52,9 +56,6 @@ public partial class SourceGenChart : IChartView
///
public Chart CoreChart { get; private set; } = null!;
- ///
- public bool ForceGPU { get; set; }
-
///
public IChartTooltip? Tooltip { get; set; }
diff --git a/src/skiasharp/_Shared/SourceGenMapChart.sgp.cs b/src/skiasharp/_Shared/SourceGenMapChart.sgp.cs
index 3550d73d9..33f915d60 100644
--- a/src/skiasharp/_Shared/SourceGenMapChart.sgp.cs
+++ b/src/skiasharp/_Shared/SourceGenMapChart.sgp.cs
@@ -30,7 +30,6 @@
using System;
using LiveChartsCore.Painting;
using System.Collections.Generic;
-using SkiaSharp;
using LiveChartsCore.Drawing;
#if SKIA_IMAGE_LVC
diff --git a/src/skiasharp/_Shared/SourceGenMapChart.cs b/src/skiasharp/_Shared/SourceGenMapChart.shared.cs
similarity index 91%
rename from src/skiasharp/_Shared/SourceGenMapChart.cs
rename to src/skiasharp/_Shared/SourceGenMapChart.shared.cs
index ec0454c4f..f1c902b41 100644
--- a/src/skiasharp/_Shared/SourceGenMapChart.cs
+++ b/src/skiasharp/_Shared/SourceGenMapChart.shared.cs
@@ -26,6 +26,10 @@
namespace LiveChartsGeneratedCode;
+// ==============================================================
+// this file contains the shared code between all UI frameworks
+// ==============================================================
+
///
#if SKIA_IMAGE_LVC
public partial class SourceGenSKMapChart : IGeoMapView
diff --git a/src/skiasharp/_Shared/SourceGenPieChart.cs b/src/skiasharp/_Shared/SourceGenPieChart.shared.cs
similarity index 91%
rename from src/skiasharp/_Shared/SourceGenPieChart.cs
rename to src/skiasharp/_Shared/SourceGenPieChart.shared.cs
index e1424966c..646c18486 100644
--- a/src/skiasharp/_Shared/SourceGenPieChart.cs
+++ b/src/skiasharp/_Shared/SourceGenPieChart.shared.cs
@@ -33,6 +33,10 @@
namespace LiveChartsGeneratedCode;
+// ==============================================================
+// this file contains the shared code between all UI frameworks
+// ==============================================================
+
///
#if SKIA_IMAGE_LVC
public partial class SourceGenSKPieChart : SGChart, IPieChartView
diff --git a/src/skiasharp/_Shared/SourceGenPolarChart.cs b/src/skiasharp/_Shared/SourceGenPolarChart.shared.cs
similarity index 94%
rename from src/skiasharp/_Shared/SourceGenPolarChart.cs
rename to src/skiasharp/_Shared/SourceGenPolarChart.shared.cs
index 1f83576e4..c07318745 100644
--- a/src/skiasharp/_Shared/SourceGenPolarChart.cs
+++ b/src/skiasharp/_Shared/SourceGenPolarChart.shared.cs
@@ -35,6 +35,10 @@
namespace LiveChartsGeneratedCode;
+// ==============================================================
+// this file contains the shared code between all UI frameworks
+// ==============================================================
+
///
#if SKIA_IMAGE_LVC
public partial class SourceGenSKPolarChart : SGChart, IPolarChartView
diff --git a/src/skiasharp/_Shared/_Shared.projitems b/src/skiasharp/_Shared/_Shared.projitems
index cb8ecdb34..e1f24ec65 100644
--- a/src/skiasharp/_Shared/_Shared.projitems
+++ b/src/skiasharp/_Shared/_Shared.projitems
@@ -6,15 +6,15 @@
2ad18dd8-c567-4bcf-a4fa-42519466d6a3
-
+
-
-
-
+
+
+
-
+
-
+
\ No newline at end of file
diff --git a/tests/CoreTests/AssemblyInfo.cs b/tests/CoreTests/AssemblyInfo.cs
new file mode 100644
index 000000000..a7432a783
--- /dev/null
+++ b/tests/CoreTests/AssemblyInfo.cs
@@ -0,0 +1,6 @@
+#if STRONG_NAMED_ASSEMBLIES
+using System.Reflection;
+
+[assembly: AssemblyKeyFile("./../../LiveCharts.snk")]
+
+#endif
diff --git a/tests/LiveChartsCore.UnitTesting/ChartTests/ChartTests.cs b/tests/CoreTests/ChartTests/ChartTests.cs
similarity index 97%
rename from tests/LiveChartsCore.UnitTesting/ChartTests/ChartTests.cs
rename to tests/CoreTests/ChartTests/ChartTests.cs
index df42af977..7d13e3eeb 100644
--- a/tests/LiveChartsCore.UnitTesting/ChartTests/ChartTests.cs
+++ b/tests/CoreTests/ChartTests/ChartTests.cs
@@ -1,7 +1,7 @@
using LiveChartsCore.SkiaSharpView.SKCharts;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-namespace LiveChartsCore.UnitTesting.ChartTests;
+namespace CoreTests.ChartTests;
[TestClass]
public class ChartTests
diff --git a/tests/LiveChartsCore.UnitTesting/CoreObjectsTests/ActionThrottler.cs b/tests/CoreTests/CoreObjectsTests/ActionThrottler.cs
similarity index 96%
rename from tests/LiveChartsCore.UnitTesting/CoreObjectsTests/ActionThrottler.cs
rename to tests/CoreTests/CoreObjectsTests/ActionThrottler.cs
index a2881afc3..0fa99ad86 100644
--- a/tests/LiveChartsCore.UnitTesting/CoreObjectsTests/ActionThrottler.cs
+++ b/tests/CoreTests/CoreObjectsTests/ActionThrottler.cs
@@ -4,7 +4,7 @@
using LiveChartsCore.Kernel;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-namespace LiveChartsCore.UnitTesting.CoreObjectsTests;
+namespace CoreTests.CoreObjectsTests;
[TestClass]
public class ActionThrottlerTester
diff --git a/tests/LiveChartsCore.UnitTesting/CoreObjectsTests/ChangingPaintTasks.cs b/tests/CoreTests/CoreObjectsTests/ChangingPaintTasks.cs
similarity index 99%
rename from tests/LiveChartsCore.UnitTesting/CoreObjectsTests/ChangingPaintTasks.cs
rename to tests/CoreTests/CoreObjectsTests/ChangingPaintTasks.cs
index be9f1d76b..62be44de0 100644
--- a/tests/LiveChartsCore.UnitTesting/CoreObjectsTests/ChangingPaintTasks.cs
+++ b/tests/CoreTests/CoreObjectsTests/ChangingPaintTasks.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
+using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Drawing;
using LiveChartsCore.SkiaSharpView.Painting;
@@ -9,7 +10,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.CoreObjectsTests;
+namespace CoreTests.CoreObjectsTests;
[TestClass]
public class ChangingPaintTasks
diff --git a/tests/LiveChartsCore.UnitTesting/CoreObjectsTests/CollectionDeepObservererTesting.cs b/tests/CoreTests/CoreObjectsTests/CollectionDeepObservererTesting.cs
similarity index 97%
rename from tests/LiveChartsCore.UnitTesting/CoreObjectsTests/CollectionDeepObservererTesting.cs
rename to tests/CoreTests/CoreObjectsTests/CollectionDeepObservererTesting.cs
index 5e1a37baa..d409ff26d 100644
--- a/tests/LiveChartsCore.UnitTesting/CoreObjectsTests/CollectionDeepObservererTesting.cs
+++ b/tests/CoreTests/CoreObjectsTests/CollectionDeepObservererTesting.cs
@@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
-using LiveChartsCore.UnitTesting.MockedObjects;
+using CoreTests.MockedObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-namespace LiveChartsCore.UnitTesting.CoreObjectsTests;
+namespace CoreTests.CoreObjectsTests;
[TestClass]
public class CollectionDeepObservererTesting
diff --git a/tests/LiveChartsCore.UnitTesting/CoreObjectsTests/ColorTesting.cs b/tests/CoreTests/CoreObjectsTests/ColorTesting.cs
similarity index 91%
rename from tests/LiveChartsCore.UnitTesting/CoreObjectsTests/ColorTesting.cs
rename to tests/CoreTests/CoreObjectsTests/ColorTesting.cs
index 121b04fd3..6190740eb 100644
--- a/tests/LiveChartsCore.UnitTesting/CoreObjectsTests/ColorTesting.cs
+++ b/tests/CoreTests/CoreObjectsTests/ColorTesting.cs
@@ -1,7 +1,7 @@
using LiveChartsCore.Drawing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-namespace LiveChartsCore.UnitTesting.CoreObjectsTests;
+namespace CoreTests.CoreObjectsTests;
[TestClass]
public class ColorTesting
diff --git a/tests/LiveChartsCore.UnitTesting/CoreObjectsTests/LabelerTesting.cs b/tests/CoreTests/CoreObjectsTests/LabelerTesting.cs
similarity index 98%
rename from tests/LiveChartsCore.UnitTesting/CoreObjectsTests/LabelerTesting.cs
rename to tests/CoreTests/CoreObjectsTests/LabelerTesting.cs
index cfb541f0e..a73d7b6e9 100644
--- a/tests/LiveChartsCore.UnitTesting/CoreObjectsTests/LabelerTesting.cs
+++ b/tests/CoreTests/CoreObjectsTests/LabelerTesting.cs
@@ -1,7 +1,8 @@
using System.Globalization;
+using LiveChartsCore;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-namespace LiveChartsCore.UnitTesting.CoreObjectsTests;
+namespace CoreTests.CoreObjectsTests;
[TestClass]
public class LabelerTesting
diff --git a/tests/LiveChartsCore.UnitTesting/CoreObjectsTests/TransitionsTesting.cs b/tests/CoreTests/CoreObjectsTests/TransitionsTesting.cs
similarity index 99%
rename from tests/LiveChartsCore.UnitTesting/CoreObjectsTests/TransitionsTesting.cs
rename to tests/CoreTests/CoreObjectsTests/TransitionsTesting.cs
index e36e218e8..fb8cb440c 100644
--- a/tests/LiveChartsCore.UnitTesting/CoreObjectsTests/TransitionsTesting.cs
+++ b/tests/CoreTests/CoreObjectsTests/TransitionsTesting.cs
@@ -1,10 +1,11 @@
using System;
+using LiveChartsCore;
using LiveChartsCore.Drawing;
using LiveChartsCore.Motion;
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-namespace LiveChartsCore.UnitTesting.CoreObjectsTests;
+namespace CoreTests.CoreObjectsTests;
[TestClass]
public class TransitionsTesting
diff --git a/tests/CoreTests/CoreTests.csproj b/tests/CoreTests/CoreTests.csproj
new file mode 100644
index 000000000..c5082922f
--- /dev/null
+++ b/tests/CoreTests/CoreTests.csproj
@@ -0,0 +1,29 @@
+
+
+
+ Exe
+ net462;net8.0
+ false
+
+
+
+ $(NoWarn);MSTEST0037;MSTEST0023;CS0618
+
+
+
+
+
+
+
+ $(DefineConstants);STRONG_NAMED_ASSEMBLIES
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/LiveChartsCore.UnitTesting/LayoutTests/StackLayoutTest.cs b/tests/CoreTests/LayoutTests/StackLayoutTest.cs
similarity index 93%
rename from tests/LiveChartsCore.UnitTesting/LayoutTests/StackLayoutTest.cs
rename to tests/CoreTests/LayoutTests/StackLayoutTest.cs
index 08280d5c7..99c1f3f99 100644
--- a/tests/LiveChartsCore.UnitTesting/LayoutTests/StackLayoutTest.cs
+++ b/tests/CoreTests/LayoutTests/StackLayoutTest.cs
@@ -1,4 +1,6 @@
-using LiveChartsCore.SkiaSharpView;
+using LiveChartsCore;
+using LiveChartsCore.Drawing;
+using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.Drawing.Layouts;
using LiveChartsCore.SkiaSharpView.Painting;
@@ -6,7 +8,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.LayoutTests;
+namespace CoreTests.LayoutTests;
[TestClass]
public class StackLayoutTest
@@ -16,11 +18,11 @@ public void StackLayoutHorizontalStart()
{
var stackPanel = new StackLayout
{
- Padding = new Drawing.Padding(10, 20),
+ Padding = new Padding(10, 20),
X = 100,
Y = 200,
- VerticalAlignment = Drawing.Align.Start,
- Orientation = Drawing.ContainerOrientation.Horizontal
+ VerticalAlignment = Align.Start,
+ Orientation = ContainerOrientation.Horizontal
};
RectangleGeometry g1, g2;
@@ -81,12 +83,12 @@ public void StackLayoutHorizontalMiddle()
{
var stackLayout = new StackLayout
{
- Padding = new Drawing.Padding(10, 20),
+ Padding = new Padding(10, 20),
X = 100,
Y = 200,
// also default should be middle...
//VerticalAlignment = Drawing.Align.Middle,
- Orientation = Drawing.ContainerOrientation.Horizontal
+ Orientation = ContainerOrientation.Horizontal
};
RectangleGeometry g1, g2;
@@ -140,11 +142,11 @@ public void StackLayoutHorizontalEnd()
{
var stackLayout = new StackLayout
{
- Padding = new Drawing.Padding(10, 20),
+ Padding = new Padding(10, 20),
X = 100,
Y = 200,
- VerticalAlignment = Drawing.Align.End,
- Orientation = Drawing.ContainerOrientation.Horizontal
+ VerticalAlignment = Align.End,
+ Orientation = ContainerOrientation.Horizontal
};
RectangleGeometry g1, g2;
@@ -199,11 +201,11 @@ public void StackLayoutVerticalStart()
{
var stackPanel = new StackLayout
{
- Padding = new Drawing.Padding(10, 20),
+ Padding = new Padding(10, 20),
X = 100,
Y = 200,
- HorizontalAlignment = Drawing.Align.Start,
- Orientation = Drawing.ContainerOrientation.Vertical
+ HorizontalAlignment = Align.Start,
+ Orientation = ContainerOrientation.Vertical
};
RectangleGeometry g1, g2;
@@ -263,12 +265,12 @@ public void StackLayoutVerticalMiddle()
{
var stackPanel = new StackLayout
{
- Padding = new Drawing.Padding(10, 20),
+ Padding = new Padding(10, 20),
X = 100,
Y = 200,
// also default should be middle...
//HorizontalAlignment = Drawing.Align.Middle,
- Orientation = Drawing.ContainerOrientation.Vertical
+ Orientation = ContainerOrientation.Vertical
};
RectangleGeometry g1, g2;
@@ -323,11 +325,11 @@ public void StackLayoutVerticalEnd()
{
var stackPanel = new StackLayout
{
- Padding = new Drawing.Padding(10, 20),
+ Padding = new Padding(10, 20),
X = 100,
Y = 200,
- HorizontalAlignment = Drawing.Align.End,
- Orientation = Drawing.ContainerOrientation.Vertical
+ HorizontalAlignment = Align.End,
+ Orientation = ContainerOrientation.Vertical
};
RectangleGeometry g1, g2;
@@ -382,12 +384,12 @@ public void StackLayoutHorizontalStartWrap()
{
var stackPanel = new StackLayout
{
- Padding = new Drawing.Padding(0),
+ Padding = new Padding(0),
X = 100,
Y = 200,
MaxWidth = 12 * 3,
- VerticalAlignment = Drawing.Align.Start,
- Orientation = Drawing.ContainerOrientation.Horizontal
+ VerticalAlignment = Align.Start,
+ Orientation = ContainerOrientation.Horizontal
};
RectangleGeometry g0, g1, g2;
@@ -501,12 +503,12 @@ public void StackPanelLayoutMiddleWrap()
{
var stackPanel = new StackLayout
{
- Padding = new Drawing.Padding(0),
+ Padding = new Padding(0),
X = 100,
Y = 200,
MaxWidth = 12 * 3,
- VerticalAlignment = Drawing.Align.Middle,
- Orientation = Drawing.ContainerOrientation.Horizontal
+ VerticalAlignment = Align.Middle,
+ Orientation = ContainerOrientation.Horizontal
};
RectangleGeometry g0, g1, g2;
@@ -620,12 +622,12 @@ public void StackLayoutHorizontalEndWrap()
{
var stackPanel = new StackLayout
{
- Padding = new Drawing.Padding(0),
+ Padding = new Padding(0),
X = 100,
Y = 200,
MaxWidth = 12 * 3,
- VerticalAlignment = Drawing.Align.End,
- Orientation = Drawing.ContainerOrientation.Horizontal
+ VerticalAlignment = Align.End,
+ Orientation = ContainerOrientation.Horizontal
};
RectangleGeometry g0, g1, g2;
@@ -739,12 +741,12 @@ public void StackPanelLayoutStartWrap()
{
var stackPanel = new StackLayout
{
- Padding = new Drawing.Padding(0),
+ Padding = new Padding(0),
X = 200,
Y = 100,
MaxHeight = 12 * 3,
- HorizontalAlignment = Drawing.Align.Start,
- Orientation = Drawing.ContainerOrientation.Vertical
+ HorizontalAlignment = Align.Start,
+ Orientation = ContainerOrientation.Vertical
};
RectangleGeometry g0, g1, g2;
@@ -858,12 +860,12 @@ public void StackLayoutVerticalMiddleWrap()
{
var stackPanel = new StackLayout
{
- Padding = new Drawing.Padding(0),
+ Padding = new Padding(0),
X = 200,
Y = 100,
MaxHeight = 12 * 3,
- HorizontalAlignment = Drawing.Align.Middle,
- Orientation = Drawing.ContainerOrientation.Vertical
+ HorizontalAlignment = Align.Middle,
+ Orientation = ContainerOrientation.Vertical
};
RectangleGeometry g0, g1, g2;
@@ -977,12 +979,12 @@ public void StackPanelLayoutEndWrap()
{
var stackPanel = new StackLayout
{
- Padding = new Drawing.Padding(0),
+ Padding = new Padding(0),
X = 200,
Y = 100,
MaxHeight = 12 * 3,
- HorizontalAlignment = Drawing.Align.End,
- Orientation = Drawing.ContainerOrientation.Vertical
+ HorizontalAlignment = Align.End,
+ Orientation = ContainerOrientation.Vertical
};
RectangleGeometry g0, g1, g2;
diff --git a/tests/LiveChartsCore.UnitTesting/LayoutTests/TableLayoutTest.cs b/tests/CoreTests/LayoutTests/TableLayoutTest.cs
similarity index 92%
rename from tests/LiveChartsCore.UnitTesting/LayoutTests/TableLayoutTest.cs
rename to tests/CoreTests/LayoutTests/TableLayoutTest.cs
index 70e9c220a..daeefcda9 100644
--- a/tests/LiveChartsCore.UnitTesting/LayoutTests/TableLayoutTest.cs
+++ b/tests/CoreTests/LayoutTests/TableLayoutTest.cs
@@ -1,4 +1,6 @@
-using LiveChartsCore.SkiaSharpView;
+using LiveChartsCore;
+using LiveChartsCore.Drawing;
+using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.Drawing.Layouts;
using LiveChartsCore.SkiaSharpView.Painting;
@@ -6,7 +8,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.LayoutTests;
+namespace CoreTests.LayoutTests;
[TestClass]
public class TableLayoutTest
@@ -19,11 +21,11 @@ public void TableStart()
var table = new TableLayout
{
- Padding = new Drawing.Padding(px, py),
+ Padding = new Padding(px, py),
X = 100,
Y = 200,
- VerticalAlignment = Drawing.Align.Start,
- HorizontalAlignment = Drawing.Align.Start
+ VerticalAlignment = Align.Start,
+ HorizontalAlignment = Align.Start
};
RectangleGeometry g1, g2;
@@ -102,11 +104,11 @@ public void TableStartFirstEmpty()
var table = new TableLayout
{
- Padding = new Drawing.Padding(px, py),
+ Padding = new Padding(px, py),
X = 100,
Y = 200,
- VerticalAlignment = Drawing.Align.Start,
- HorizontalAlignment = Drawing.Align.Start
+ VerticalAlignment = Align.Start,
+ HorizontalAlignment = Align.Start
};
RectangleGeometry g1, g2;
@@ -185,11 +187,11 @@ public void TableStartSomeEmpty()
var table = new TableLayout
{
- Padding = new Drawing.Padding(px, py),
+ Padding = new Padding(px, py),
X = 100,
Y = 200,
- VerticalAlignment = Drawing.Align.Start,
- HorizontalAlignment = Drawing.Align.Start
+ VerticalAlignment = Align.Start,
+ HorizontalAlignment = Align.Start
};
RectangleGeometry g1, g2;
@@ -279,11 +281,11 @@ public void TableMiddle()
var table = new TableLayout
{
- Padding = new Drawing.Padding(px, py),
+ Padding = new Padding(px, py),
X = 100,
Y = 200,
- VerticalAlignment = Drawing.Align.Middle,
- HorizontalAlignment = Drawing.Align.Middle
+ VerticalAlignment = Align.Middle,
+ HorizontalAlignment = Align.Middle
};
RectangleGeometry g1, g2;
@@ -361,11 +363,11 @@ public void TableEnd()
var table = new TableLayout
{
- Padding = new Drawing.Padding(px, py),
+ Padding = new Padding(px, py),
X = 100,
Y = 200,
- VerticalAlignment = Drawing.Align.End,
- HorizontalAlignment = Drawing.Align.End
+ VerticalAlignment = Align.End,
+ HorizontalAlignment = Align.End
};
RectangleGeometry g1, g2;
@@ -443,11 +445,11 @@ public void UnevenColumns()
var table = new TableLayout
{
- Padding = new Drawing.Padding(px, py),
+ Padding = new Padding(px, py),
X = 100,
Y = 200,
- VerticalAlignment = Drawing.Align.Start,
- HorizontalAlignment = Drawing.Align.Start
+ VerticalAlignment = Align.Start,
+ HorizontalAlignment = Align.Start
};
LabelGeometry g00, g01, g10, g11;
diff --git a/tests/LiveChartsCore.UnitTesting/MockedObjects/PropertyChangedObject.cs b/tests/CoreTests/MockedObjects/PropertyChangedObject.cs
similarity index 89%
rename from tests/LiveChartsCore.UnitTesting/MockedObjects/PropertyChangedObject.cs
rename to tests/CoreTests/MockedObjects/PropertyChangedObject.cs
index 9e378e799..96e8a87aa 100644
--- a/tests/LiveChartsCore.UnitTesting/MockedObjects/PropertyChangedObject.cs
+++ b/tests/CoreTests/MockedObjects/PropertyChangedObject.cs
@@ -1,6 +1,6 @@
using System.ComponentModel;
-namespace LiveChartsCore.UnitTesting.MockedObjects;
+namespace CoreTests.MockedObjects;
public class PropertyChangedObject : INotifyPropertyChanged
{
diff --git a/tests/CoreTests/MockedObjects/TestLabel.cs b/tests/CoreTests/MockedObjects/TestLabel.cs
new file mode 100644
index 000000000..6b2125250
--- /dev/null
+++ b/tests/CoreTests/MockedObjects/TestLabel.cs
@@ -0,0 +1,12 @@
+using LiveChartsCore.Drawing;
+using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
+
+namespace CoreTests.MockedObjects;
+
+public class TestLabel : LabelGeometry
+{
+ public TestLabel()
+ {
+ Background = new LvcColor(200, 200, 200, 50);
+ }
+}
diff --git a/tests/LiveChartsCore.UnitTesting/MockedObjects/TestObserver.cs b/tests/CoreTests/MockedObjects/TestObserver.cs
similarity index 92%
rename from tests/LiveChartsCore.UnitTesting/MockedObjects/TestObserver.cs
rename to tests/CoreTests/MockedObjects/TestObserver.cs
index 3c43149f0..5dc2427ec 100644
--- a/tests/LiveChartsCore.UnitTesting/MockedObjects/TestObserver.cs
+++ b/tests/CoreTests/MockedObjects/TestObserver.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using LiveChartsCore.Kernel.Observers;
-namespace LiveChartsCore.UnitTesting.MockedObjects;
+namespace CoreTests.MockedObjects;
public class TestObserver : IDisposable
{
diff --git a/tests/LiveChartsCore.UnitTesting/OtherTests/AxisTesting.cs b/tests/CoreTests/OtherTests/AxisTesting.cs
similarity index 99%
rename from tests/LiveChartsCore.UnitTesting/OtherTests/AxisTesting.cs
rename to tests/CoreTests/OtherTests/AxisTesting.cs
index 0e2e598df..3fd0169f6 100644
--- a/tests/LiveChartsCore.UnitTesting/OtherTests/AxisTesting.cs
+++ b/tests/CoreTests/OtherTests/AxisTesting.cs
@@ -7,10 +7,10 @@
using SkiaSharp;
using LiveChartsCore.Defaults;
using System.Diagnostics;
-using LiveChartsCore.UnitTesting.CoreObjectsTests;
using LiveChartsCore.Measure;
+using CoreTests.CoreObjectsTests;
-namespace LiveChartsCore.UnitTesting.OtherTests;
+namespace CoreTests.OtherTests;
[TestClass]
public class AxisTesting
diff --git a/tests/LiveChartsCore.UnitTesting/OtherTests/DataProviderTest.cs b/tests/CoreTests/OtherTests/DataProviderTest.cs
similarity index 98%
rename from tests/LiveChartsCore.UnitTesting/OtherTests/DataProviderTest.cs
rename to tests/CoreTests/OtherTests/DataProviderTest.cs
index 99a33adb3..78acbe9f7 100644
--- a/tests/LiveChartsCore.UnitTesting/OtherTests/DataProviderTest.cs
+++ b/tests/CoreTests/OtherTests/DataProviderTest.cs
@@ -6,7 +6,7 @@
using LiveChartsCore.SkiaSharpView.SKCharts;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-namespace LiveChartsCore.UnitTesting.OtherTests;
+namespace CoreTests.OtherTests;
[TestClass]
public class DataProviderTest
@@ -299,7 +299,7 @@ public void FetchReturnEqualityOnValueTypes()
{
Width = 100,
Height = 100,
- FindingStrategy = Measure.FindingStrategy.ExactMatch,
+ FindingStrategy = LiveChartsCore.Measure.FindingStrategy.ExactMatch,
Series = [sutSeries]
};
diff --git a/tests/LiveChartsCore.UnitTesting/OtherTests/DrawMarginAndLegendsTests.cs b/tests/CoreTests/OtherTests/DrawMarginAndLegendsTests.cs
similarity index 99%
rename from tests/LiveChartsCore.UnitTesting/OtherTests/DrawMarginAndLegendsTests.cs
rename to tests/CoreTests/OtherTests/DrawMarginAndLegendsTests.cs
index ade4016fd..f10793e27 100644
--- a/tests/LiveChartsCore.UnitTesting/OtherTests/DrawMarginAndLegendsTests.cs
+++ b/tests/CoreTests/OtherTests/DrawMarginAndLegendsTests.cs
@@ -9,7 +9,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.OtherTests;
+namespace CoreTests.OtherTests;
[TestClass]
public class DrawMarginAndLegendsTests
diff --git a/tests/LiveChartsCore.UnitTesting/OtherTests/EventsTests.cs b/tests/CoreTests/OtherTests/EventsTests.cs
similarity index 88%
rename from tests/LiveChartsCore.UnitTesting/OtherTests/EventsTests.cs
rename to tests/CoreTests/OtherTests/EventsTests.cs
index 8c9227951..3916c53d3 100644
--- a/tests/LiveChartsCore.UnitTesting/OtherTests/EventsTests.cs
+++ b/tests/CoreTests/OtherTests/EventsTests.cs
@@ -11,7 +11,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.OtherTests;
+namespace CoreTests.OtherTests;
[TestClass]
public class EventsTests
@@ -28,7 +28,7 @@ public void CartesianBasicCase()
new ScatterSeries
{
Values = new double[] { 0, 1, 2 },
- DataPadding = new Drawing.LvcPoint(0, 0)
+ DataPadding = new LvcPoint(0, 0)
}
},
XAxes = new[] { new Axis { IsVisible = false, } },
@@ -42,7 +42,7 @@ public void CartesianBasicCase()
Text = "Hello world",
TextSize = 20,
Paint = new SolidColorPaint(SKColors.Red),
- LocationUnit = Measure.MeasureUnit.ChartValues
+ LocationUnit = MeasureUnit.ChartValues
},
new GeometryVisual
{
@@ -51,8 +51,8 @@ public void CartesianBasicCase()
Width = 0.5,
Height = 0.5,
Fill = new SolidColorPaint(SKColors.Blue),
- LocationUnit = Measure.MeasureUnit.ChartValues,
- SizeUnit = Measure.MeasureUnit.ChartValues
+ LocationUnit = MeasureUnit.ChartValues,
+ SizeUnit = MeasureUnit.ChartValues
}
}
};
diff --git a/tests/LiveChartsCore.UnitTesting/OtherTests/LabelsMeasureTest.cs b/tests/CoreTests/OtherTests/LabelsMeasureTest.cs
similarity index 93%
rename from tests/LiveChartsCore.UnitTesting/OtherTests/LabelsMeasureTest.cs
rename to tests/CoreTests/OtherTests/LabelsMeasureTest.cs
index baee116b6..6db4d5721 100644
--- a/tests/LiveChartsCore.UnitTesting/OtherTests/LabelsMeasureTest.cs
+++ b/tests/CoreTests/OtherTests/LabelsMeasureTest.cs
@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
-using System.Linq;
+using LiveChartsCore;
+using LiveChartsCore.Drawing;
using LiveChartsCore.Kernel;
+using LiveChartsCore.Measure;
using LiveChartsCore.Motion;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Drawing;
@@ -12,7 +14,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.OtherTests;
+namespace CoreTests.OtherTests;
[TestClass]
public class LabelsMeasureTest
@@ -30,13 +32,13 @@ public void BasicCase()
{
X = 10,
Y = y,
- LocationUnit = Measure.MeasureUnit.Pixels,
- VerticalAlignment = Drawing.Align.Start,
- HorizontalAlignment = Drawing.Align.Start,
+ LocationUnit = MeasureUnit.Pixels,
+ VerticalAlignment = Align.Start,
+ HorizontalAlignment = Align.Start,
TextSize = h,
Text = "X-█-X",
Paint = new SolidColorPaint(SKColors.Black),
- BackgroundColor = new Drawing.LvcColor(0, 0, 0, 50)
+ BackgroundColor = new LvcColor(0, 0, 0, 50)
});
y += h + 10;
@@ -79,13 +81,13 @@ public void MultiLine()
{
X = 10,
Y = y,
- LocationUnit = Measure.MeasureUnit.Pixels,
- VerticalAlignment = Drawing.Align.Start,
- HorizontalAlignment = Drawing.Align.Start,
+ LocationUnit = MeasureUnit.Pixels,
+ VerticalAlignment = Align.Start,
+ HorizontalAlignment = Align.Start,
TextSize = 25,
Text = t,
Paint = new SolidColorPaint(SKColors.Black),
- BackgroundColor = new Drawing.LvcColor(0, 0, 0, 50)
+ BackgroundColor = new LvcColor(0, 0, 0, 50)
});
y += th * lineHeight + 10;
diff --git a/tests/LiveChartsCore.UnitTesting/OtherTests/ScaleFunctionsTests.cs b/tests/CoreTests/OtherTests/ScaleFunctionsTests.cs
similarity index 99%
rename from tests/LiveChartsCore.UnitTesting/OtherTests/ScaleFunctionsTests.cs
rename to tests/CoreTests/OtherTests/ScaleFunctionsTests.cs
index b8e84ebe3..abac41f64 100644
--- a/tests/LiveChartsCore.UnitTesting/OtherTests/ScaleFunctionsTests.cs
+++ b/tests/CoreTests/OtherTests/ScaleFunctionsTests.cs
@@ -8,7 +8,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.OtherTests;
+namespace CoreTests.OtherTests;
[TestClass]
public class ScaleFunctionsTests
diff --git a/tests/LiveChartsCore.UnitTesting/OtherTests/VisualElementsTests.cs b/tests/CoreTests/OtherTests/VisualElementsTests.cs
similarity index 98%
rename from tests/LiveChartsCore.UnitTesting/OtherTests/VisualElementsTests.cs
rename to tests/CoreTests/OtherTests/VisualElementsTests.cs
index a34b69cee..04ed38b41 100644
--- a/tests/LiveChartsCore.UnitTesting/OtherTests/VisualElementsTests.cs
+++ b/tests/CoreTests/OtherTests/VisualElementsTests.cs
@@ -9,7 +9,7 @@
using SkiaSharp;
using LiveChartsCore.Kernel;
-namespace LiveChartsCore.UnitTesting.OtherTests;
+namespace CoreTests.OtherTests;
[TestClass]
public class VisualElementsTests
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/BoxSeriesTests.cs b/tests/CoreTests/SeriesTests/BoxSeriesTests.cs
similarity index 98%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/BoxSeriesTests.cs
rename to tests/CoreTests/SeriesTests/BoxSeriesTests.cs
index d3664d653..d0fb9b23c 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/BoxSeriesTests.cs
+++ b/tests/CoreTests/SeriesTests/BoxSeriesTests.cs
@@ -1,5 +1,6 @@
using System;
using System.Linq;
+using CoreTests.MockedObjects;
using LiveChartsCore.Defaults;
using LiveChartsCore.Drawing;
using LiveChartsCore.Measure;
@@ -7,11 +8,10 @@
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.SKCharts;
-using LiveChartsCore.UnitTesting.MockedObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class BoxSeriesTest
@@ -100,7 +100,7 @@ public void ShouldPlaceToolTips()
Name = "A",
MaxBarWidth = 1000,
YToolTipLabelFormatter = x => $"{x.Coordinate.PrimaryValue}{Environment.NewLine}{x.Coordinate.PrimaryValue}{Environment.NewLine}{x.Coordinate.PrimaryValue}{Environment.NewLine}",
- DataPadding = new Drawing.LvcPoint(0, 0)
+ DataPadding = new LvcPoint(0, 0)
};
var tooltip = new SKDefaultTooltip { Easing = null };
@@ -217,7 +217,7 @@ public void ShouldPlaceDataLabel()
new(1, .75, 0.25, 0, 0.5),
new(10, 9.75, 9.25, 9, 9.5)
},
- DataPadding = new Drawing.LvcPoint(0, 0),
+ DataPadding = new LvcPoint(0, 0),
};
var chart = new SKCartesianChart
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/ColumnSeriesTest.cs b/tests/CoreTests/SeriesTests/ColumnSeriesTest.cs
similarity index 98%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/ColumnSeriesTest.cs
rename to tests/CoreTests/SeriesTests/ColumnSeriesTest.cs
index 3204b666e..147dde5d4 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/ColumnSeriesTest.cs
+++ b/tests/CoreTests/SeriesTests/ColumnSeriesTest.cs
@@ -1,16 +1,16 @@
using System;
using System.Linq;
+using CoreTests.MockedObjects;
using LiveChartsCore.Drawing;
using LiveChartsCore.Measure;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.SKCharts;
-using LiveChartsCore.UnitTesting.MockedObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class ColumnSeriesTest
@@ -86,7 +86,7 @@ public void ShouldPlaceToolTips()
{
Values = new double[] { 1, 2, 3, 4, 5 },
Name = "Series #1",
- DataPadding = new Drawing.LvcPoint(0, 0)
+ DataPadding = new LvcPoint(0, 0)
};
var tooltip = new SKDefaultTooltip { Easing = null };
@@ -199,7 +199,7 @@ public void ShouldPlaceDataLabel()
var sutSeries = new ColumnSeries
{
Values = new double[] { -10, -5, -1, 0, 1, 5, 10 },
- DataPadding = new Drawing.LvcPoint(0, 0),
+ DataPadding = new LvcPoint(0, 0),
};
var chart = new SKCartesianChart
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/FinancialSeriesTest.cs b/tests/CoreTests/SeriesTests/FinancialSeriesTest.cs
similarity index 98%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/FinancialSeriesTest.cs
rename to tests/CoreTests/SeriesTests/FinancialSeriesTest.cs
index 0cd775aa2..cdf375292 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/FinancialSeriesTest.cs
+++ b/tests/CoreTests/SeriesTests/FinancialSeriesTest.cs
@@ -1,5 +1,6 @@
using System;
using System.Linq;
+using CoreTests.MockedObjects;
using LiveChartsCore.Defaults;
using LiveChartsCore.Drawing;
using LiveChartsCore.Kernel;
@@ -8,11 +9,10 @@
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.SKCharts;
-using LiveChartsCore.UnitTesting.MockedObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class FinancialSeriesTest
@@ -123,7 +123,7 @@ public void ShouldPlaceToolTips()
Name = "Aaaa",
MaxBarWidth = 1000,
YToolTipLabelFormatter = x => $"{x.Coordinate.PrimaryValue}{Environment.NewLine}{x.Coordinate.PrimaryValue}{Environment.NewLine}{x.Coordinate.PrimaryValue}{Environment.NewLine}",
- DataPadding = new Drawing.LvcPoint(0, 0)
+ DataPadding = new LvcPoint(0, 0)
};
var tooltip = new SKDefaultTooltip { Easing = null };
@@ -240,7 +240,7 @@ public void ShouldPlaceDataLabel()
new(1, .75, 0.25, 0),
new(10, 9.75, 9.25, 9)
},
- DataPadding = new Drawing.LvcPoint(0, 0),
+ DataPadding = new LvcPoint(0, 0),
};
var chart = new SKCartesianChart
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/GeneralSeriesTests.cs b/tests/CoreTests/SeriesTests/GeneralSeriesTests.cs
similarity index 99%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/GeneralSeriesTests.cs
rename to tests/CoreTests/SeriesTests/GeneralSeriesTests.cs
index 3bdf120e7..66f061363 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/GeneralSeriesTests.cs
+++ b/tests/CoreTests/SeriesTests/GeneralSeriesTests.cs
@@ -1,13 +1,14 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
+using LiveChartsCore;
using LiveChartsCore.Drawing;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Extensions;
using LiveChartsCore.SkiaSharpView.SKCharts;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class GeneralSeriesTests
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/HeatSeriesTest.cs b/tests/CoreTests/SeriesTests/HeatSeriesTest.cs
similarity index 99%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/HeatSeriesTest.cs
rename to tests/CoreTests/SeriesTests/HeatSeriesTest.cs
index f6c0924a6..8794351b9 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/HeatSeriesTest.cs
+++ b/tests/CoreTests/SeriesTests/HeatSeriesTest.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
+using CoreTests.MockedObjects;
using LiveChartsCore.Defaults;
using LiveChartsCore.Drawing;
using LiveChartsCore.Measure;
@@ -8,11 +9,10 @@
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.SKCharts;
-using LiveChartsCore.UnitTesting.MockedObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class HeatSeriesTest
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/LineSeriesTest.cs b/tests/CoreTests/SeriesTests/LineSeriesTest.cs
similarity index 99%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/LineSeriesTest.cs
rename to tests/CoreTests/SeriesTests/LineSeriesTest.cs
index 03df97a4a..2eb52a831 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/LineSeriesTest.cs
+++ b/tests/CoreTests/SeriesTests/LineSeriesTest.cs
@@ -1,5 +1,6 @@
using System;
using System.Linq;
+using CoreTests.MockedObjects;
using LiveChartsCore.Drawing;
using LiveChartsCore.Drawing.Segments;
using LiveChartsCore.Measure;
@@ -7,11 +8,10 @@
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.SKCharts;
-using LiveChartsCore.UnitTesting.MockedObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class LineSeriesTest
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/PieSeriesTest.cs b/tests/CoreTests/SeriesTests/PieSeriesTest.cs
similarity index 99%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/PieSeriesTest.cs
rename to tests/CoreTests/SeriesTests/PieSeriesTest.cs
index 1fb30c224..a0932bc1f 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/PieSeriesTest.cs
+++ b/tests/CoreTests/SeriesTests/PieSeriesTest.cs
@@ -1,5 +1,6 @@
using System;
using System.Linq;
+using CoreTests.MockedObjects;
using LiveChartsCore.Drawing;
using LiveChartsCore.Measure;
using LiveChartsCore.SkiaSharpView;
@@ -7,11 +8,10 @@
using LiveChartsCore.SkiaSharpView.Extensions;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.SKCharts;
-using LiveChartsCore.UnitTesting.MockedObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class PieSeriesTest
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/PolarLineSeriesTest.cs b/tests/CoreTests/SeriesTests/PolarLineSeriesTest.cs
similarity index 99%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/PolarLineSeriesTest.cs
rename to tests/CoreTests/SeriesTests/PolarLineSeriesTest.cs
index ebbb44205..b62ed7d9f 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/PolarLineSeriesTest.cs
+++ b/tests/CoreTests/SeriesTests/PolarLineSeriesTest.cs
@@ -7,7 +7,7 @@
using LiveChartsCore.SkiaSharpView.SKCharts;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class PolarLineSeriesTest
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/RowSeriesTest.cs b/tests/CoreTests/SeriesTests/RowSeriesTest.cs
similarity index 98%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/RowSeriesTest.cs
rename to tests/CoreTests/SeriesTests/RowSeriesTest.cs
index 802fa34b8..cdbeab120 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/RowSeriesTest.cs
+++ b/tests/CoreTests/SeriesTests/RowSeriesTest.cs
@@ -4,7 +4,7 @@
using LiveChartsCore.SkiaSharpView.SKCharts;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class RowSeriesTest
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/ScatterSeriesTest.cs b/tests/CoreTests/SeriesTests/ScatterSeriesTest.cs
similarity index 98%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/ScatterSeriesTest.cs
rename to tests/CoreTests/SeriesTests/ScatterSeriesTest.cs
index 7466dec98..237481991 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/ScatterSeriesTest.cs
+++ b/tests/CoreTests/SeriesTests/ScatterSeriesTest.cs
@@ -1,5 +1,6 @@
using System;
using System.Linq;
+using CoreTests.MockedObjects;
using LiveChartsCore.Defaults;
using LiveChartsCore.Drawing;
using LiveChartsCore.Measure;
@@ -7,11 +8,10 @@
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.SKCharts;
-using LiveChartsCore.UnitTesting.MockedObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class ScatterSeriesTest
@@ -105,7 +105,7 @@ public void ShouldPlaceToolTips()
var sutSeries = new ScatterSeries
{
Values = new double[] { 1, 2, 3, 4, 5 },
- DataPadding = new Drawing.LvcPoint(0, 0),
+ DataPadding = new LvcPoint(0, 0),
YToolTipLabelFormatter = x =>
$"{x.Coordinate.PrimaryValue}" +
$"{Environment.NewLine}{x.Coordinate.PrimaryValue}" +
@@ -222,7 +222,7 @@ public void ShouldPlaceDataLabel()
var sutSeries = new ScatterSeries
{
Values = new double[] { -10, -5, -1, 0, 1, 5, 10 },
- DataPadding = new Drawing.LvcPoint(0, 0),
+ DataPadding = new LvcPoint(0, 0),
};
var chart = new SKCartesianChart
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/StackedAreaSeriesTest.cs b/tests/CoreTests/SeriesTests/StackedAreaSeriesTest.cs
similarity index 99%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/StackedAreaSeriesTest.cs
rename to tests/CoreTests/SeriesTests/StackedAreaSeriesTest.cs
index 9a0356e9e..5abcfe5cd 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/StackedAreaSeriesTest.cs
+++ b/tests/CoreTests/SeriesTests/StackedAreaSeriesTest.cs
@@ -1,5 +1,6 @@
using System;
using System.Linq;
+using CoreTests.MockedObjects;
using LiveChartsCore.Drawing;
using LiveChartsCore.Drawing.Segments;
using LiveChartsCore.Measure;
@@ -7,11 +8,10 @@
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.SKCharts;
-using LiveChartsCore.UnitTesting.MockedObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class StackedAreaSeriesTest
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/StackedColumnSeriesTest.cs b/tests/CoreTests/SeriesTests/StackedColumnSeriesTest.cs
similarity index 98%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/StackedColumnSeriesTest.cs
rename to tests/CoreTests/SeriesTests/StackedColumnSeriesTest.cs
index 95859c2a7..bffa504c8 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/StackedColumnSeriesTest.cs
+++ b/tests/CoreTests/SeriesTests/StackedColumnSeriesTest.cs
@@ -1,15 +1,16 @@
using System;
using System.Linq;
+using CoreTests.MockedObjects;
+using LiveChartsCore.Drawing;
using LiveChartsCore.Measure;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.SKCharts;
-using LiveChartsCore.UnitTesting.MockedObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class StackedColumnSeriesTest
@@ -128,7 +129,7 @@ public void ShouldPlaceDataLabel()
var sutSeries = new StackedColumnSeries
{
Values = new double[] { -10, -5, -1, 0, 1, 5, 10 },
- DataPadding = new Drawing.LvcPoint(0, 0),
+ DataPadding = new LvcPoint(0, 0),
DataLabelsPosition = DataLabelsPosition.End
};
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/StackedRowSeriesTest.cs b/tests/CoreTests/SeriesTests/StackedRowSeriesTest.cs
similarity index 98%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/StackedRowSeriesTest.cs
rename to tests/CoreTests/SeriesTests/StackedRowSeriesTest.cs
index 7fb433f44..83a86bdc9 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/StackedRowSeriesTest.cs
+++ b/tests/CoreTests/SeriesTests/StackedRowSeriesTest.cs
@@ -4,7 +4,7 @@
using LiveChartsCore.SkiaSharpView.SKCharts;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class StackedRowSeriesTest
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/StackedStepAreaSeriesTest.cs b/tests/CoreTests/SeriesTests/StackedStepAreaSeriesTest.cs
similarity index 99%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/StackedStepAreaSeriesTest.cs
rename to tests/CoreTests/SeriesTests/StackedStepAreaSeriesTest.cs
index 844dc4f68..8acb7d413 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/StackedStepAreaSeriesTest.cs
+++ b/tests/CoreTests/SeriesTests/StackedStepAreaSeriesTest.cs
@@ -1,5 +1,6 @@
using System;
using System.Linq;
+using CoreTests.MockedObjects;
using LiveChartsCore.Drawing;
using LiveChartsCore.Drawing.Segments;
using LiveChartsCore.Measure;
@@ -7,11 +8,10 @@
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.SKCharts;
-using LiveChartsCore.UnitTesting.MockedObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class StackedStepAreaSeriesTest
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/StepLineSeriesTest.cs b/tests/CoreTests/SeriesTests/StepLineSeriesTest.cs
similarity index 99%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/StepLineSeriesTest.cs
rename to tests/CoreTests/SeriesTests/StepLineSeriesTest.cs
index 8c1dec6fc..5279cde60 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/StepLineSeriesTest.cs
+++ b/tests/CoreTests/SeriesTests/StepLineSeriesTest.cs
@@ -1,5 +1,6 @@
using System;
using System.Linq;
+using CoreTests.MockedObjects;
using LiveChartsCore.Drawing;
using LiveChartsCore.Drawing.Segments;
using LiveChartsCore.Measure;
@@ -7,11 +8,10 @@
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.SKCharts;
-using LiveChartsCore.UnitTesting.MockedObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class StepLineSeriesTest
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/VisibilityTests.cs b/tests/CoreTests/SeriesTests/VisibilityTests.cs
similarity index 97%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/VisibilityTests.cs
rename to tests/CoreTests/SeriesTests/VisibilityTests.cs
index 7817e570c..5232e326e 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/VisibilityTests.cs
+++ b/tests/CoreTests/SeriesTests/VisibilityTests.cs
@@ -1,15 +1,16 @@
using System;
using System.Collections;
using System.Linq;
+using CoreTests.CoreObjectsTests;
+using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.SKCharts;
-using LiveChartsCore.UnitTesting.CoreObjectsTests;
using LiveChartsGeneratedCode;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SkiaSharp;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
[TestClass]
public class VisibilityTests
diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/_MemoryTests.cs b/tests/CoreTests/SeriesTests/_MemoryTests.cs
similarity index 98%
rename from tests/LiveChartsCore.UnitTesting/SeriesTests/_MemoryTests.cs
rename to tests/CoreTests/SeriesTests/_MemoryTests.cs
index 34a9e8f1b..c77ef69d6 100644
--- a/tests/LiveChartsCore.UnitTesting/SeriesTests/_MemoryTests.cs
+++ b/tests/CoreTests/SeriesTests/_MemoryTests.cs
@@ -1,16 +1,17 @@
using System;
using System.Collections;
using System.Collections.ObjectModel;
+using CoreTests.CoreObjectsTests;
+using LiveChartsCore;
using LiveChartsCore.Defaults;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.SKCharts;
-using LiveChartsCore.UnitTesting.CoreObjectsTests;
using LiveChartsGeneratedCode;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-namespace LiveChartsCore.UnitTesting.SeriesTests;
+namespace CoreTests.SeriesTests;
-//[TestClass]
+[TestClass]
public class _MemoryTests
{
private static readonly int s_repeatCount;
@@ -18,7 +19,7 @@ public class _MemoryTests
static _MemoryTests()
{
- s_repeatCount = 5000;
+ s_repeatCount = 1500; // originally 5000, reduced for faster test runs
var threshold = 2 * 1024 * 1024 * (s_repeatCount / 5000d); // 2MB each 5000 repeats
s_treshold = threshold < 1 * 1024 * 1024
? 1 * 1024 * 1024
diff --git a/tests/LiveChartsCore.UnitTesting/TestsInitializer.cs b/tests/CoreTests/TestsInitializer.cs
similarity index 88%
rename from tests/LiveChartsCore.UnitTesting/TestsInitializer.cs
rename to tests/CoreTests/TestsInitializer.cs
index 638e9048f..6ade4ecf6 100644
--- a/tests/LiveChartsCore.UnitTesting/TestsInitializer.cs
+++ b/tests/CoreTests/TestsInitializer.cs
@@ -1,8 +1,9 @@
-using LiveChartsCore.Motion;
+using LiveChartsCore;
+using LiveChartsCore.Motion;
using LiveChartsCore.SkiaSharpView;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-namespace LiveChartsCore.UnitTesting;
+namespace CoreTests;
[TestClass]
public class TestsInitializer
diff --git a/tests/LiveChartsCore.UnitTesting/LiveChartsCore.UnitTesting.csproj b/tests/LiveChartsCore.UnitTesting/LiveChartsCore.UnitTesting.csproj
deleted file mode 100644
index 09114723e..000000000
--- a/tests/LiveChartsCore.UnitTesting/LiveChartsCore.UnitTesting.csproj
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- $(GlobalLangVersion)
- net462;net6.0;net8.0
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/LiveChartsCore.UnitTesting/MockedObjects/TestLabel.cs b/tests/LiveChartsCore.UnitTesting/MockedObjects/TestLabel.cs
deleted file mode 100644
index 2004e4924..000000000
--- a/tests/LiveChartsCore.UnitTesting/MockedObjects/TestLabel.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
-
-namespace LiveChartsCore.UnitTesting.MockedObjects;
-
-public class TestLabel : LabelGeometry
-{
- public TestLabel()
- {
- Background = new Drawing.LvcColor(200, 200, 200, 50);
- }
-}
diff --git a/tests/SharedUITests/CartesianChartTests.cs b/tests/SharedUITests/CartesianChartTests.cs
new file mode 100644
index 000000000..0640cb1c6
--- /dev/null
+++ b/tests/SharedUITests/CartesianChartTests.cs
@@ -0,0 +1,60 @@
+using Factos;
+using SharedUITests.Helpers;
+using Xunit;
+
+// to run these tests, see the UITests project, specially the program.cs file.
+// to enable IDE intellisense for these tests, go to Directory.Build.props and set UITesting to true.
+
+namespace SharedUITests;
+
+public class CartesianChartTests
+{
+ public AppController App => AppController.Current;
+
+ [AppTestMethod]
+ public async Task ShouldLoad()
+ {
+ var sut = await App.NavigateTo();
+ await sut.Chart.WaitUntilChartRenders();
+
+ Assert.ChartIsLoaded(sut.Chart);
+ }
+
+#if XAML_UI_TESTING
+ [AppTestMethod]
+ public async Task ShouldLoadTemplatedChart()
+ {
+ var sut = await App.NavigateTo();
+
+ // to make it simple, wait for some time for the template to load
+ await Task.Delay(2000);
+
+ // now lets find the templated charts
+ foreach (var chart in sut.FindCharts())
+ {
+ await chart.WaitUntilChartRenders();
+ Assert.ChartIsLoaded(chart);
+ }
+ }
+#endif
+
+#if !BLAZOR_UI_TESTING
+ // this test makes no sense in blazor.
+
+ [AppTestMethod]
+ public async Task ShouldUnloadAndReload()
+ {
+ var sut = new Samples.Bars.AutoUpdate.View();
+
+ await App.NavigateToView(sut);
+ await sut.Chart.WaitUntilChartRenders();
+ Assert.ChartIsLoaded(sut.Chart);
+
+ await App.PopNavigation();
+
+ await App.NavigateToView(sut);
+ await sut.Chart.WaitUntilChartRenders();
+ Assert.ChartIsLoaded(sut.Chart);
+ }
+#endif
+}
diff --git a/tests/SharedUITests/GlobalUsings.cs b/tests/SharedUITests/GlobalUsings.cs
new file mode 100644
index 000000000..d355267b5
--- /dev/null
+++ b/tests/SharedUITests/GlobalUsings.cs
@@ -0,0 +1,27 @@
+#if AVALONIA_UI_TESTING
+global using Samples = AvaloniaSample;
+#endif
+
+#if BLAZOR_UI_TESTING
+global using Samples = BlazorSample.Pages;
+#endif
+
+#if ETO_UI_TESTING
+global using Samples = EtoFormsSample;
+#endif
+
+#if MAUI_UI_TESTING
+global using Samples = MauiSample;
+#endif
+
+#if UNO_UI_TESTING || WINUI_UI_TESTING
+global using Samples = WinUISample;
+#endif
+
+#if WINFORMS_UI_TESTING
+global using Samples = WinFormsSample;
+#endif
+
+#if WPF_UI_TESTING
+global using Samples = WPFSample;
+#endif
diff --git a/tests/SharedUITests/Helpers/UIHelpersExtensions.cs b/tests/SharedUITests/Helpers/UIHelpersExtensions.cs
new file mode 100644
index 000000000..52cebe9e7
--- /dev/null
+++ b/tests/SharedUITests/Helpers/UIHelpersExtensions.cs
@@ -0,0 +1,103 @@
+// The MIT License(MIT)
+//
+// Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+using Factos;
+using LiveChartsCore.Kernel.Sketches;
+using Xunit;
+
+namespace SharedUITests.Helpers;
+
+public static class UIHelpersExtensions
+{
+ extension(AppController controller)
+ {
+ public async Task NavigateTo()
+ where T : class, new()
+ {
+#if BLAZOR_UI_TESTING
+ var blazorController = (Factos.Blazor.BlazorAppController)controller;
+ return await blazorController.NavigateToView();
+#else
+ var view = new T();
+ await controller.NavigateToView(view);
+ return view;
+#endif
+ }
+
+ }
+
+ extension(IChartView chartView)
+ {
+ public Task WaitUntilChartRenders()
+ {
+ var tcs = new TaskCompletionSource