diff --git a/LiveCharts.sln b/LiveCharts.sln index b6f0c81f7..8e25960fe 100644 --- a/LiveCharts.sln +++ b/LiveCharts.sln @@ -83,18 +83,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QuestPDFSample", "samples\QuestPDFSample\QuestPDFSample.csproj", "{763F1951-D833-4579-A592-1FFD960FD634}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UnoPlatform", "UnoPlatform", "{5E27972E-DFEA-4825-8037-D26041333C5B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample.Mobile", "samples\UnoPlatformSample\UnoPlatformSample.Mobile\UnoPlatformSample.Mobile.csproj", "{E712427B-F9BC-4113-9044-400E04016DEC}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Platforms", "Platforms", "{C9A1646F-FABA-48C3-A48B-B4A359D66105}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample.Skia.Gtk", "samples\UnoPlatformSample\UnoPlatformSample.Skia.Gtk\UnoPlatformSample.Skia.Gtk.csproj", "{3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample.Windows", "samples\UnoPlatformSample\UnoPlatformSample.Windows\UnoPlatformSample.Windows.csproj", "{A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample.Wasm", "samples\UnoPlatformSample\UnoPlatformSample.Wasm\UnoPlatformSample.Wasm.csproj", "{4E510B0F-67A7-45BB-8478-901D0703632E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample", "samples\UnoPlatformSample\UnoPlatformSample\UnoPlatformSample.csproj", "{5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}" + ProjectSection(SolutionItems) = preProject + readme.txt = readme.txt + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MappersSamples", "samples\MappersSamples\MappersSamples.csproj", "{B479EDB0-9DE2-4F74-87DF-E5B97E89D4CC}" EndProject @@ -104,8 +95,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaSample", "samples\A EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiveChartsCore.SkiaSharpView.Avalonia", "src\skiasharp\LiveChartsCore.SkiaSharp.Avalonia\LiveChartsCore.SkiaSharpView.Avalonia.csproj", "{97C09F18-5A69-4A1F-B73D-514AD5F421FC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample.DataContracts", "samples\UnoPlatformSample\UnoPlatformSample.DataContracts\UnoPlatformSample.DataContracts.csproj", "{03BDCD7C-5428-450B-A757-531AFD36C37E}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiveChartsCore.Behaviours", "src\LiveChartsCore.Behaviours\LiveChartsCore.Behaviours.csproj", "{F7B300BA-687D-4420-B658-0D1FA7F981EB}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiveChartsCore.SkiaSharpView.Uno.WinUI", "src\skiasharp\LiveChartsCore.SkiaSharpView.Uno.WinUI\LiveChartsCore.SkiaSharpView.Uno.WinUI.csproj", "{407D2FDF-11A1-44B7-91AE-D48D37C0A65E}" @@ -1654,314 +1643,6 @@ Global {763F1951-D833-4579-A592-1FFD960FD634}.Release|x64.Build.0 = Release|Any CPU {763F1951-D833-4579-A592-1FFD960FD634}.Release|x86.ActiveCfg = Release|Any CPU {763F1951-D833-4579-A592-1FFD960FD634}.Release|x86.Build.0 = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|ARM64.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|ARM64.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|x64.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Ad-Hoc|x86.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|Any CPU.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|ARM.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|ARM.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|ARM64.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|ARM64.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|iPhone.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|x64.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|x64.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|x86.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.AppStore|x86.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|ARM.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|ARM.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|ARM64.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|iPhone.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|x64.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|x64.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|x86.ActiveCfg = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Debug|x86.Build.0 = Debug|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|Any CPU.Build.0 = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|ARM.ActiveCfg = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|ARM.Build.0 = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|ARM64.ActiveCfg = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|ARM64.Build.0 = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|iPhone.ActiveCfg = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|iPhone.Build.0 = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|x64.ActiveCfg = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|x64.Build.0 = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|x86.ActiveCfg = Release|Any CPU - {E712427B-F9BC-4113-9044-400E04016DEC}.Release|x86.Build.0 = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|ARM64.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|ARM64.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|x64.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Ad-Hoc|x86.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|Any CPU.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|ARM.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|ARM.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|ARM64.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|ARM64.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|iPhone.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|x64.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|x64.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|x86.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.AppStore|x86.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|ARM.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|ARM.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|ARM64.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|iPhone.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|x64.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|x64.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|x86.ActiveCfg = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Debug|x86.Build.0 = Debug|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|Any CPU.Build.0 = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|ARM.ActiveCfg = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|ARM.Build.0 = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|ARM64.ActiveCfg = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|ARM64.Build.0 = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|iPhone.ActiveCfg = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|iPhone.Build.0 = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|x64.ActiveCfg = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|x64.Build.0 = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|x86.ActiveCfg = Release|Any CPU - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E}.Release|x86.Build.0 = Release|Any CPU - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|Any CPU.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|Any CPU.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|Any CPU.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|ARM.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|ARM.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|ARM.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|ARM64.ActiveCfg = Debug|arm64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|ARM64.Build.0 = Debug|arm64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|ARM64.Deploy.0 = Debug|arm64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|iPhone.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|iPhone.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|iPhone.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|x64.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|x64.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|x64.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|x86.ActiveCfg = Debug|x86 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|x86.Build.0 = Debug|x86 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Ad-Hoc|x86.Deploy.0 = Debug|x86 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|Any CPU.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|Any CPU.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|Any CPU.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|ARM.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|ARM.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|ARM.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|ARM64.ActiveCfg = Debug|arm64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|ARM64.Build.0 = Debug|arm64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|ARM64.Deploy.0 = Debug|arm64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|iPhone.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|iPhone.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|iPhone.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|iPhoneSimulator.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|iPhoneSimulator.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|iPhoneSimulator.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|x64.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|x64.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|x64.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|x86.ActiveCfg = Debug|x86 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|x86.Build.0 = Debug|x86 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.AppStore|x86.Deploy.0 = Debug|x86 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|Any CPU.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|Any CPU.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|Any CPU.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|ARM.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|ARM.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|ARM.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|ARM64.ActiveCfg = Debug|arm64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|ARM64.Build.0 = Debug|arm64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|ARM64.Deploy.0 = Debug|arm64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|iPhone.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|iPhone.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|iPhone.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|iPhoneSimulator.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|iPhoneSimulator.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|iPhoneSimulator.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|x64.ActiveCfg = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|x64.Build.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|x64.Deploy.0 = Debug|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|x86.ActiveCfg = Debug|x86 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|x86.Build.0 = Debug|x86 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Debug|x86.Deploy.0 = Debug|x86 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|Any CPU.ActiveCfg = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|Any CPU.Build.0 = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|Any CPU.Deploy.0 = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|ARM.ActiveCfg = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|ARM.Build.0 = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|ARM.Deploy.0 = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|ARM64.ActiveCfg = Release|arm64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|ARM64.Build.0 = Release|arm64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|ARM64.Deploy.0 = Release|arm64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|iPhone.ActiveCfg = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|iPhone.Build.0 = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|iPhone.Deploy.0 = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|iPhoneSimulator.ActiveCfg = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|iPhoneSimulator.Build.0 = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|iPhoneSimulator.Deploy.0 = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|x64.ActiveCfg = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|x64.Build.0 = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|x64.Deploy.0 = Release|x64 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|x86.ActiveCfg = Release|x86 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|x86.Build.0 = Release|x86 - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80}.Release|x86.Deploy.0 = Release|x86 - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|ARM64.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|ARM64.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|x64.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Ad-Hoc|x86.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|Any CPU.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|ARM.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|ARM.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|ARM64.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|ARM64.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|iPhone.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|x64.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|x64.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|x86.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.AppStore|x86.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|ARM.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|ARM.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|ARM64.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|iPhone.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|x64.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|x64.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|x86.ActiveCfg = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Debug|x86.Build.0 = Debug|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|Any CPU.Build.0 = Release|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|ARM.ActiveCfg = Release|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|ARM.Build.0 = Release|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|ARM64.ActiveCfg = Release|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|ARM64.Build.0 = Release|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|iPhone.ActiveCfg = Release|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|iPhone.Build.0 = Release|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|x64.ActiveCfg = Release|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|x64.Build.0 = Release|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|x86.ActiveCfg = Release|Any CPU - {4E510B0F-67A7-45BB-8478-901D0703632E}.Release|x86.Build.0 = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|ARM64.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|ARM64.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|x64.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Ad-Hoc|x86.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|Any CPU.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|ARM.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|ARM.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|ARM64.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|ARM64.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|iPhone.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|x64.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|x64.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|x86.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.AppStore|x86.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|ARM.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|ARM.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|ARM64.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|iPhone.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|x64.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|x64.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|x86.ActiveCfg = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Debug|x86.Build.0 = Debug|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|Any CPU.Build.0 = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|ARM.ActiveCfg = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|ARM.Build.0 = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|ARM64.ActiveCfg = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|ARM64.Build.0 = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|iPhone.ActiveCfg = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|iPhone.Build.0 = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|x64.ActiveCfg = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|x64.Build.0 = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|x86.ActiveCfg = Release|Any CPU - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF}.Release|x86.Build.0 = Release|Any CPU {B479EDB0-9DE2-4F74-87DF-E5B97E89D4CC}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU {B479EDB0-9DE2-4F74-87DF-E5B97E89D4CC}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU {B479EDB0-9DE2-4F74-87DF-E5B97E89D4CC}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU @@ -2186,62 +1867,6 @@ Global {97C09F18-5A69-4A1F-B73D-514AD5F421FC}.Release|x64.Build.0 = Release|Any CPU {97C09F18-5A69-4A1F-B73D-514AD5F421FC}.Release|x86.ActiveCfg = Release|Any CPU {97C09F18-5A69-4A1F-B73D-514AD5F421FC}.Release|x86.Build.0 = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|ARM64.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|ARM64.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|x64.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Ad-Hoc|x86.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|Any CPU.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|ARM.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|ARM.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|ARM64.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|ARM64.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|iPhone.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|x64.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|x64.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|x86.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.AppStore|x86.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|ARM.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|ARM.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|ARM64.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|iPhone.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|x64.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|x64.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|x86.ActiveCfg = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Debug|x86.Build.0 = Debug|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|Any CPU.Build.0 = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|ARM.ActiveCfg = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|ARM.Build.0 = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|ARM64.ActiveCfg = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|ARM64.Build.0 = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|iPhone.ActiveCfg = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|iPhone.Build.0 = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|x64.ActiveCfg = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|x64.Build.0 = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|x86.ActiveCfg = Release|Any CPU - {03BDCD7C-5428-450B-A757-531AFD36C37E}.Release|x86.Build.0 = Release|Any CPU {F7B300BA-687D-4420-B658-0D1FA7F981EB}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU {F7B300BA-687D-4420-B658-0D1FA7F981EB}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU {F7B300BA-687D-4420-B658-0D1FA7F981EB}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU @@ -2498,16 +2123,9 @@ Global {BACC7B19-20AB-41B1-AF7C-AB0682E64184} = {39D52D6D-70BC-40D3-84E3-CF8CD0D73D10} {763F1951-D833-4579-A592-1FFD960FD634} = {E8C464D7-B1F8-4331-9DCD-3A6E87503A0E} {5E27972E-DFEA-4825-8037-D26041333C5B} = {2E9ED2C0-0C15-4890-8070-4A3B8A5C7704} - {E712427B-F9BC-4113-9044-400E04016DEC} = {C9A1646F-FABA-48C3-A48B-B4A359D66105} - {C9A1646F-FABA-48C3-A48B-B4A359D66105} = {5E27972E-DFEA-4825-8037-D26041333C5B} - {3A38DC0A-2B4C-49EA-86C4-8BA3D8F4107E} = {C9A1646F-FABA-48C3-A48B-B4A359D66105} - {A8994AAE-F567-4A4B-BC03-AE5C7FE50F80} = {C9A1646F-FABA-48C3-A48B-B4A359D66105} - {4E510B0F-67A7-45BB-8478-901D0703632E} = {C9A1646F-FABA-48C3-A48B-B4A359D66105} - {5CA51ACF-B1C3-4B51-A41D-3586C0AE57EF} = {5E27972E-DFEA-4825-8037-D26041333C5B} {B479EDB0-9DE2-4F74-87DF-E5B97E89D4CC} = {E8C464D7-B1F8-4331-9DCD-3A6E87503A0E} {28F4B811-A3DB-44A9-BB38-F072EE3E20F5} = {E8C464D7-B1F8-4331-9DCD-3A6E87503A0E} {CEFD8CA2-64E7-4DF3-AC4D-601A88FC0F1E} = {2F6A1323-9B22-4AFC-9199-A705B72B7885} - {03BDCD7C-5428-450B-A757-531AFD36C37E} = {C9A1646F-FABA-48C3-A48B-B4A359D66105} {9FE9808D-0ADD-4D30-968D-573E229781CA} = {275DDC84-8855-4AE4-8C91-423030EA6368} {275DDC84-8855-4AE4-8C91-423030EA6368} = {2F6A1323-9B22-4AFC-9199-A705B72B7885} {6D29698D-7225-4BCE-A3FF-EBB1CB08AADA} = {275DDC84-8855-4AE4-8C91-423030EA6368} diff --git a/build/pack.ps1 b/build/pack.ps1 index 0563d782d..5b89a3513 100644 --- a/build/pack.ps1 +++ b/build/pack.ps1 @@ -9,15 +9,15 @@ param([string]$configuration = "Debug", [string]$nupkgOutputPath = "./nupkg") [Project]::new("./src/skiasharp/LiveChartsCore.SkiaSharp.Xamarin.Forms/LiveChartsCore.SkiaSharpView.Xamarin.Forms.csproj") [Project]::new("./src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveChartsCore.SkiaSharpView.Blazor.csproj") [Project]::new("./src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsCore.SkiaSharpView.Eto.csproj") - [Project]::new("./src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.csproj", $true) [Project]::new("./src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj", $true) [Project]::new("./src/skiasharp/LiveChartsCore.SkiaSharpView.Uno/LiveChartsCore.SkiaSharpView.Uno.csproj", $true) - [Project]::new("./src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/LiveChartsCore.SkiaSharpView.Uno.WinUI.csproj", $true) + [Project]::new("./src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/LiveChartsCore.SkiaSharpView.Uno.WinUI.csproj", $true), [Project]::new( - "./src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.csproj", - $true, - "nuget", - "./src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.nuspec" + "./src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.csproj", $true, + "nuget", "./src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.nuspec") + [Project]::new( + "./src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.csproj", $true, + "nuget", "./src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.nuspec" ) ) diff --git a/docs/overview/1.5.mappers.md b/docs/overview/1.5.mappers.md index e1d874bda..ef391604b 100644 --- a/docs/overview/1.5.mappers.md +++ b/docs/overview/1.5.mappers.md @@ -68,9 +68,9 @@ the `TempSample` class by setting a Mapper or implementing `IChartEntity` in our ## Mappers -Mappers are the easiest way but has a performance cost, a mapper is a method that takes both the `instance` -(each `TempSample` in our data collection) and the `point` (that LiveCharts assigned) as parameters, inside this function we must -specify the X and Y coordinates in our chart. +Mappers are the easiest way but has a performance cost, a mapper is a function that takes both: the `instance` +(each `TempSample` in our data collection) and the `index` of the instance in the collection as parameters, +and returns a `Coordinate` in the chart. ```c# using var streamReader = new StreamReader("data.json"); @@ -86,15 +86,9 @@ var chart = new SKCartesianChart new LineSeries { Values = samples, - Mapping = (sample, chartPoint) => // mark - { // mark - // use the Temperature property in the Y axis // mark - // and the Time property in the X axis // mark - chartPoint.Coordinate = new(sample.Time, sample.Temperature); - - // sometimes it is useful to use the index of the instance in the array as the X coordinate: // mark - // chartPoint.SecondaryValue = chartPoint.Index; // mark - } // mark + // use the Temperature property in the Y axis // mark + // and the Time property in the X axis // mark + Mapping = (sample, index) => new(sample.Time, sample.Temperature) // mark } }, XAxes = new[] { new Axis { Labeler = value => $"{value} seconds" } }, @@ -108,19 +102,14 @@ Now it works! You can also register the mapper globally, this means that every t chart all over our application, the library will use the mapper we indicated. ``` c# -// ideally this code must be placed where your application or view starts +// ideally this code must be placed where your application starts LiveCharts.Configure(config => - config - .HasMap( - (sample, chartPoint) => - { - chartPoint.PrimaryValue = sample.Temperature; - chartPoint.SecondaryValue = sample.Time; - })); + config.HasMap( + (sample, index) => new(sample.Time, sample.Temperature)); ``` Global mappers are unique for a type, this means that every time a `TempSample` instance is in a chart, LiveCharts will use this mapper, -if You register again a global mapper for the `TempSample` class, then the previous will be replaced by the new one. +if you register again a global mapper for the `TempSample` class, then the previous will be replaced by the new one. If the series specifies the `Mapping` property, then the global mapper will be ignored and instead it will use the series instance mapper. @@ -129,8 +118,9 @@ If the series specifies the `Mapping` property, then the global mapper will be i ## IChartEntity -The `IChartEntity` interface force our points to have a [Coordinate](https://lvcharts.com/api/2.0.0-beta.710/LiveChartsCore.Kernel.Coordinate), LiveCharts will use this property to build the plot, when the interface is implemented correctly, you will notice a considerable -performance improvement, specially in large data sets. +The `IChartEntity` interface forces our points to have a [Coordinate](https://lvcharts.com/api/2.0.0-beta.710/LiveChartsCore.Kernel.Coordinate), +LiveCharts will use this property to build the plot, when the interface is implemented correctly, you will notice a considerable +performance improvement, specially on large data sets. Imagine the same case we used in the previous sample where we have a json file that contains the temperature of a CPU at a given time, we want to build a chart with that data. diff --git a/readme.txt b/readme.txt new file mode 100644 index 000000000..3fbbd5d72 --- /dev/null +++ b/readme.txt @@ -0,0 +1 @@ +For Uno, open ./samples/UnoPlatform_v5/UnoPlatform_v5.sln diff --git a/samples/AvaloniaSample/App.axaml.cs b/samples/AvaloniaSample/App.axaml.cs index 4ea53cff0..0532bec5d 100644 --- a/samples/AvaloniaSample/App.axaml.cs +++ b/samples/AvaloniaSample/App.axaml.cs @@ -31,11 +31,9 @@ public override void Initialize() // finally register your own mappers // you can learn more about mappers at: // https://livecharts.dev/docs/{{ platform }}/{{ version }}/Overview.Mappers - .HasMap((city, point) => // mark - { // mark - // here we use the index as X, and the population as Y // mark - point.Coordinate = new(point.Index, city.Population); // mark - }) // mark + + // here we use the index as X, and the population as Y // mark + .HasMap((city, index) => new(index, city.Population)) // mark // .HasMap( .... ) // mark // .HasMap( .... ) // mark ); // mark diff --git a/samples/AvaloniaSample/General/DrawOnCanvas/View.axaml b/samples/AvaloniaSample/General/DrawOnCanvas/View.axaml new file mode 100644 index 000000000..a4b7f8572 --- /dev/null +++ b/samples/AvaloniaSample/General/DrawOnCanvas/View.axaml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/samples/AvaloniaSample/General/DrawOnCanvas/View.axaml.cs b/samples/AvaloniaSample/General/DrawOnCanvas/View.axaml.cs new file mode 100644 index 000000000..79131afbe --- /dev/null +++ b/samples/AvaloniaSample/General/DrawOnCanvas/View.axaml.cs @@ -0,0 +1,17 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace AvaloniaSample.General.DrawOnCanvas; + +public partial class View : UserControl +{ + public View() + { + InitializeComponent(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } +} diff --git a/samples/BlazorSample/App.razor b/samples/BlazorSample/App.razor index d1ffbbe83..a813740ad 100644 --- a/samples/BlazorSample/App.razor +++ b/samples/BlazorSample/App.razor @@ -28,11 +28,9 @@ // finally register your own mappers // you can learn more about mappers at: // https://livecharts.dev/docs/{{ platform }}/{{ version }}/Overview.Mappers - .HasMap((city, point) => // mark - { // mark - // here we use the index as X, and the population as Y // mark - point.Coordinate = new(point.Index, city.Population); // mark - }) // mark + + // here we use the index as X, and the population as Y // mark + .HasMap((city, index) => new(index, city.Population)) // mark // .HasMap( .... ) // mark // .HasMap( .... ) // mark ); // mark diff --git a/samples/BlazorSample/Pages/General/DrawOnCanvas.razor b/samples/BlazorSample/Pages/General/DrawOnCanvas.razor new file mode 100644 index 000000000..c4832d540 --- /dev/null +++ b/samples/BlazorSample/Pages/General/DrawOnCanvas.razor @@ -0,0 +1,22 @@ +@page "/General/DrawOnCanvas" +@using LiveChartsCore.SkiaSharpView.Blazor +@using ViewModelsSamples.General.DrawOnCanvas + + + + +@code { + public CartesianChart chart = null!; + public ViewModel ViewModel { get; set; } = new(); + + protected override void OnAfterRender(bool firstRender) + { + base.OnAfterRender(firstRender); + + chart.UpdateStarted += chart => + { + ViewModel.ChartUpdated(new(chart)); + }; + } +} diff --git a/samples/BlazorSample/Pages/Hello.razor b/samples/BlazorSample/Pages/Hello.razor index 0df18c247..ee6647868 100644 --- a/samples/BlazorSample/Pages/Hello.razor +++ b/samples/BlazorSample/Pages/Hello.razor @@ -60,8 +60,7 @@

LiveCharts provides controls for any UI framework (console and server-side is also supported).
- The minimum requirement for .Net framework is .Net 4.6.2 and is compatible with is compatible - with .NET standard 2.0. + The minimum requirement for .Net framework is .Net 4.6.2 and is compatible with .NET standard 2.0.

diff --git a/samples/EtoFormsSample/General/DrawOnCanvas/View.cs b/samples/EtoFormsSample/General/DrawOnCanvas/View.cs new file mode 100644 index 000000000..fa186ae0f --- /dev/null +++ b/samples/EtoFormsSample/General/DrawOnCanvas/View.cs @@ -0,0 +1,23 @@ +using Eto.Forms; +using LiveChartsCore.SkiaSharpView.Eto; +using ViewModelsSamples.General.DrawOnCanvas; + +namespace EtoFormsSample.General.DrawOnCanvas; + +public class View : Panel +{ + private readonly CartesianChart cartesianChart; + + public View() + { + var viewModel = new ViewModel(); + + cartesianChart = new CartesianChart(); + cartesianChart.UpdateStarted += chart => + { + viewModel.ChartUpdated(new(chart)); + }; + + Content = cartesianChart; + } +} diff --git a/samples/EtoFormsSample/Program.cs b/samples/EtoFormsSample/Program.cs index 91c1fcc9b..fc44c4653 100644 --- a/samples/EtoFormsSample/Program.cs +++ b/samples/EtoFormsSample/Program.cs @@ -31,13 +31,11 @@ static void Main() // finally register your own mappers // you can learn more about mappers at: // https://livecharts.dev/docs/{{ platform }}/{{ version }}/Overview.Mappers - .HasMap((city, point) => // mark - { // mark - // here we use the index as X, and the population as Y // mark - point.Coordinate = new(point.Index, city.Population); // mark - }) // mark - // .HasMap( .... ) // mark - // .HasMap( .... ) // mark + + // here we use the index as X, and the population as Y // mark + .HasMap((city, index) => new(index, city.Population)) // mark + // .HasMap( .... ) // mark + // .HasMap( .... ) // mark ); // mark new Application(Eto.Platform.Detect).Run(new Form1()); diff --git a/samples/MappersSamples/Program.cs b/samples/MappersSamples/Program.cs index 0e107f290..79f643b4f 100644 --- a/samples/MappersSamples/Program.cs +++ b/samples/MappersSamples/Program.cs @@ -23,12 +23,9 @@ { new LineSeries { - Mapping = (tempSample, chartPoint) => - { - // we set the X coordinate to the Time property - // and the Y coordinate to the Temperature property - chartPoint.Coordinate = new(tempSample.Time, tempSample.Temperature); - }, + // we set the X coordinate to the Time property + // and the Y coordinate to the Temperature property + Mapping = (tempSample, index) => new(tempSample.Time, tempSample.Temperature), Values = samples } }, @@ -68,12 +65,9 @@ { new ColumnSeries { - Mapping = (city, chartPoint) => - { - // we set the X coordinate to the index of the item in the array - // and the Y coordinate to the Population property - chartPoint.Coordinate = new(chartPoint.Index, city.Population); - }, + // we set the X coordinate to the index of the item in the array + // and the Y coordinate to the Population property + Mapping = (city, index) => new(index, city.Population), Values = cities } }, @@ -100,14 +94,8 @@ // this is useful when you have a lot of series and you don't want to repeat the mapping for each series. LiveCharts.Configure(config => config - .HasMap((tempSample, chartPoint) => - { - chartPoint.Coordinate = new(tempSample.Time, tempSample.Temperature); - }) - .HasMap((city, chartPoint) => - { - chartPoint.Coordinate = new(chartPoint.Index, city.Population); - })); + .HasMap((tempSample, index) => new(tempSample.Time, tempSample.Temperature)) + .HasMap((city, index) => new(index, city.Population))); Console.WriteLine("chart saved"); diff --git a/samples/MauiSample/App.xaml.cs b/samples/MauiSample/App.xaml.cs index c996923de..66353eba1 100644 --- a/samples/MauiSample/App.xaml.cs +++ b/samples/MauiSample/App.xaml.cs @@ -20,8 +20,8 @@ protected override void OnStart() LiveCharts.Configure(config => // mark config // mark - // you can override the theme - //.AddDarkTheme() // mark + // you can override the theme + //.AddDarkTheme() // mark // In case you need a non-Latin based font, you must register a typeface for SkiaSharp //.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark @@ -35,11 +35,9 @@ protected override void OnStart() // finally register your own mappers // you can learn more about mappers at: // https://livecharts.dev/docs/{{ platform }}/{{ version }}/Overview.Mappers - .HasMap((city, point) => // mark - { // mark - // here we use the index as X, and the population as Y // mark - point.Coordinate = new(point.Index, city.Population); // mark - }) // mark + + // here we use the index as X, and the population as Y // mark + .HasMap((city, index) => new(index, city.Population)) // mark // .HasMap( .... ) // mark // .HasMap( .... ) // mark ); // mark diff --git a/samples/MauiSample/Axes/Crosshairs/View.xaml b/samples/MauiSample/Axes/Crosshairs/View.xaml index 7a2d9ec72..8428754a8 100644 --- a/samples/MauiSample/Axes/Crosshairs/View.xaml +++ b/samples/MauiSample/Axes/Crosshairs/View.xaml @@ -15,7 +15,9 @@ + Series="{Binding Series}" + XAxes="{Binding XAxes}" + YAxes="{Binding YAxes}"> diff --git a/samples/MauiSample/General/DrawOnCanvas/View.xaml b/samples/MauiSample/General/DrawOnCanvas/View.xaml new file mode 100644 index 000000000..e8dbd3cda --- /dev/null +++ b/samples/MauiSample/General/DrawOnCanvas/View.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + diff --git a/samples/MauiSample/General/DrawOnCanvas/View.xaml.cs b/samples/MauiSample/General/DrawOnCanvas/View.xaml.cs new file mode 100644 index 000000000..511a56a98 --- /dev/null +++ b/samples/MauiSample/General/DrawOnCanvas/View.xaml.cs @@ -0,0 +1,10 @@ +namespace MauiSample.General.DrawOnCanvas; + +[XamlCompilation(XamlCompilationOptions.Compile)] +public partial class View : ContentPage +{ + public View() + { + InitializeComponent(); + } +} diff --git a/samples/UWPSample/General/DrawOnCanvas/View.xaml b/samples/UWPSample/General/DrawOnCanvas/View.xaml new file mode 100644 index 000000000..2dcc40312 --- /dev/null +++ b/samples/UWPSample/General/DrawOnCanvas/View.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + diff --git a/samples/UWPSample/General/DrawOnCanvas/View.xaml.cs b/samples/UWPSample/General/DrawOnCanvas/View.xaml.cs new file mode 100644 index 000000000..44b3ab187 --- /dev/null +++ b/samples/UWPSample/General/DrawOnCanvas/View.xaml.cs @@ -0,0 +1,12 @@ +using Windows.UI.Xaml.Controls; + +namespace UWPSample.General.DrawOnCanvas +{ + public sealed partial class View : UserControl + { + public View() + { + InitializeComponent(); + } + } +} diff --git a/samples/UWPSample/UWPSample.csproj b/samples/UWPSample/UWPSample.csproj index 69a922a11..8b6c35ba7 100644 --- a/samples/UWPSample/UWPSample.csproj +++ b/samples/UWPSample/UWPSample.csproj @@ -226,6 +226,9 @@ View.xaml + + View.xaml + View.xaml @@ -577,6 +580,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer diff --git a/samples/UnoPlatformSample/Directory.Build.props b/samples/UnoPlatformSample/Directory.Build.props deleted file mode 100644 index 8c8dc7544..000000000 --- a/samples/UnoPlatformSample/Directory.Build.props +++ /dev/null @@ -1,55 +0,0 @@ - - - enable - enable - - portable - True - - true - - $(NoWarn);CA1416;NU1507 - - en - - false - false - false - false - false - - - - - - true - 21.0 - - - - - true - 14.2 - - - - - true - 10.14 - - - - - true - 14.0 - - - - - true - 10.0.18362.0 - 10.0.18362.0 - - - - diff --git a/samples/UnoPlatformSample/Directory.Build.targets b/samples/UnoPlatformSample/Directory.Build.targets deleted file mode 100644 index 30332cf7d..000000000 --- a/samples/UnoPlatformSample/Directory.Build.targets +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Base/AppHead.xaml b/samples/UnoPlatformSample/UnoPlatformSample.Base/AppHead.xaml deleted file mode 100644 index 4edcdc464..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Base/AppHead.xaml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Base/AppHead.xaml.cs b/samples/UnoPlatformSample/UnoPlatformSample.Base/AppHead.xaml.cs deleted file mode 100644 index 9a97712e4..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Base/AppHead.xaml.cs +++ /dev/null @@ -1,49 +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 Microsoft.UI.Xaml; -using Uno.Resizetizer; - -namespace UnoPlatformSample; -public sealed partial class AppHead : App -{ - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public AppHead() - { - this.InitializeComponent(); - } - - /// - /// Invoked when the application is launched normally by the end user. Other entry points - /// will be used such as when the application is launched to open a specific file. - /// - /// Details about the launch request and process. - protected override void OnLaunched(LaunchActivatedEventArgs args) - { - base.OnLaunched(args); - - MainWindow.SetWindowIcon(); - } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Base/base.props b/samples/UnoPlatformSample/UnoPlatformSample.Base/base.props deleted file mode 100644 index 6c37f9c20..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Base/base.props +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.DataContracts/Serialization/WeatherForecastContext.cs b/samples/UnoPlatformSample/UnoPlatformSample.DataContracts/Serialization/WeatherForecastContext.cs deleted file mode 100644 index 240177a1e..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.DataContracts/Serialization/WeatherForecastContext.cs +++ /dev/null @@ -1,45 +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.Collections.Immutable; -using System.Text.Json.Serialization; - -namespace UnoPlatformSample.DataContracts.Serialization; -/// -/// Generated class for System.Text.Json Serialization -/// -/// -/// When using the JsonSerializerContext you must add the JsonSerializableAttribute -/// for each type that you may need to serialize / deserialize including both the -/// concrete type and any interface that the concrete type implements. -/// For more information on the JsonSerializerContext see: -/// https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/source-generation?WT.mc_id=DT-MVP-5002924 -/// -[JsonSerializable(typeof(WeatherForecast))] -[JsonSerializable(typeof(WeatherForecast[]))] -[JsonSerializable(typeof(IEnumerable))] -[JsonSerializable(typeof(IImmutableList))] -[JsonSerializable(typeof(ImmutableList))] -[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)] -public partial class WeatherForecastContext : JsonSerializerContext -{ -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample.DataContracts/UnoPlatformSample.DataContracts.csproj b/samples/UnoPlatformSample/UnoPlatformSample.DataContracts/UnoPlatformSample.DataContracts.csproj deleted file mode 100644 index 47df750e1..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.DataContracts/UnoPlatformSample.DataContracts.csproj +++ /dev/null @@ -1,6 +0,0 @@ - - - net7.0 - true - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/Main.Android.cs b/samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/Main.Android.cs deleted file mode 100644 index dde1359a7..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/Main.Android.cs +++ /dev/null @@ -1,64 +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; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Android.App; -using Android.Content; -using Android.OS; -using Android.Runtime; -using Android.Views; -using Android.Widget; -using Com.Nostra13.Universalimageloader.Core; -using Microsoft.UI.Xaml.Media; - -namespace UnoPlatformSample.Droid; -[global::Android.App.ApplicationAttribute( - Label = "@string/ApplicationName", - Icon = "@mipmap/iconapp", - LargeHeap = true, - HardwareAccelerated = true, - Theme = "@style/AppTheme" -)] -public class Application : Microsoft.UI.Xaml.NativeApplication -{ - public Application(IntPtr javaReference, JniHandleOwnership transfer) - : base(() => new AppHead(), javaReference, transfer) - { - ConfigureUniversalImageLoader(); - } - - private static void ConfigureUniversalImageLoader() - { - // Create global configuration and initialize ImageLoader with this config - ImageLoaderConfiguration config = new ImageLoaderConfiguration - .Builder(Context) - .Build(); - - ImageLoader.Instance.Init(config); - - ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync; - } -} - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/MainActivity.Android.cs b/samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/MainActivity.Android.cs deleted file mode 100644 index 346cf8462..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/MainActivity.Android.cs +++ /dev/null @@ -1,37 +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 Android.App; -using Android.Content.PM; -using Android.OS; -using Android.Views; -using Android.Widget; - -namespace UnoPlatformSample.Droid; -[Activity( - MainLauncher = true, - ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges, - WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden -)] -public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity -{ -} \ No newline at end of file diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/MacCatalyst/Main.maccatalyst.cs b/samples/UnoPlatformSample/UnoPlatformSample.Mobile/MacCatalyst/Main.maccatalyst.cs deleted file mode 100644 index b1f31e7b7..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/MacCatalyst/Main.maccatalyst.cs +++ /dev/null @@ -1,35 +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 UIKit; - -namespace UnoPlatformSample.MacCatalyst; -public class EntryPoint -{ - // This is the main entry point of the application. - public static void Main(string[] args) - { - // if you want to use a different Application Delegate class from "AppDelegate" - // you can specify it here. - UIApplication.Main(args, null, typeof(AppHead)); - } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/UnoPlatformSample.Mobile.csproj b/samples/UnoPlatformSample/UnoPlatformSample.Mobile/UnoPlatformSample.Mobile.csproj deleted file mode 100644 index 6433c7c59..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/UnoPlatformSample.Mobile.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - net7.0-ios;net7.0-android;net7.0-maccatalyst - true - Exe - - UnoPlatformSample - - com.companyname.UnoPlatformSample - 6A5D2EB4-48BB-4C7D-A232-1FB6EA4B61BA - - 1.0 - 1 - - Android\AndroidManifest.xml - - - - - True - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep - - $(MtouchExtraArgs) --registrar:static - iossimulator-x64 - - - - $(MtouchExtraArgs) --marshal-objectivec-exceptions:disable - - - - - - $(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep - - $(MtouchExtraArgs) --registrar:static - - false - maccatalyst-x64 - - - - $(MtouchExtraArgs) --marshal-objectivec-exceptions:disable - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/iOS/Main.iOS.cs b/samples/UnoPlatformSample/UnoPlatformSample.Mobile/iOS/Main.iOS.cs deleted file mode 100644 index 6549466b2..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/iOS/Main.iOS.cs +++ /dev/null @@ -1,35 +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 UIKit; - -namespace UnoPlatformSample.iOS; -public class EntryPoint -{ - // This is the main entry point of the application. - public static void Main(string[] args) - { - // if you want to use a different Application Delegate class from "AppDelegate" - // you can specify it here. - UIApplication.Main(args, null, typeof(AppHead)); - } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Server/Apis/WeatherForecastApi.cs b/samples/UnoPlatformSample/UnoPlatformSample.Server/Apis/WeatherForecastApi.cs deleted file mode 100644 index b27297308..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Server/Apis/WeatherForecastApi.cs +++ /dev/null @@ -1,69 +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 UnoPlatformSample.Server.Apis; - -internal static class WeatherForecastApi -{ - private const string Tag = "Weather"; - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - internal static WebApplication MapWeatherApi(this WebApplication app) - { - app.MapGet("/api/weatherforecast", GetForecast) - .WithTags(Tag) - .WithName(nameof(GetForecast)); - return app; - } - - /// - /// Creates a make believe weather forecast for the next 5 days. - /// - /// - /// A fake 5 day forecast - /// A 5 Day Forecast - /// Weather Forecast returned - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - private static IEnumerable GetForecast(ILoggerFactory loggerFactory) - { - var logger = loggerFactory.CreateLogger(nameof(WeatherForecastApi)); - logger.LogDebug("Getting Weather Forecast."); - - return Enumerable.Range(1, 5).Select(index => - new WeatherForecast( - DateOnly.FromDateTime(DateTime.Now.AddDays(index)), - Random.Shared.Next(-20, 55), - Summaries[Random.Shared.Next(Summaries.Length)] - ) - ) - .Select(x => - { - logger.LogInformation("Weather forecast for {Date} is a {Summary} {TemperatureC}°C", x.Date, x.Summary, x.TemperatureC); - return x; - }) - .ToArray(); - } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Server/GlobalUsings.cs b/samples/UnoPlatformSample/UnoPlatformSample.Server/GlobalUsings.cs deleted file mode 100644 index e57e9b3a4..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Server/GlobalUsings.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. - -global using Microsoft.AspNetCore.Mvc; -global using UnoPlatformSample.DataContracts; -global using UnoPlatformSample.Server.Apis; diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Server/UnoPlatformSample.Server.csproj b/samples/UnoPlatformSample/UnoPlatformSample.Server/UnoPlatformSample.Server.csproj deleted file mode 100644 index ceae9e1ee..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Server/UnoPlatformSample.Server.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net7.0 - true - - - - - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Skia.Gtk/Package.appxmanifest b/samples/UnoPlatformSample/UnoPlatformSample.Skia.Gtk/Package.appxmanifest deleted file mode 100644 index 8eaafe69a..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Skia.Gtk/Package.appxmanifest +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - UnoPlatformSample - UnoPlatformSample - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Skia.Gtk/Program.cs b/samples/UnoPlatformSample/UnoPlatformSample.Skia.Gtk/Program.cs deleted file mode 100644 index 6a527fc20..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Skia.Gtk/Program.cs +++ /dev/null @@ -1,42 +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; -using GLib; -using Uno.UI.Runtime.Skia; - -namespace UnoPlatformSample.Skia.Gtk; -public class Program -{ - public static void Main(string[] args) - { - ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs) - { - Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString()); - expArgs.ExitApplication = true; - }; - - var host = new GtkHost(() => new AppHead(), args); - - host.Run(); - } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Skia.Gtk/UnoPlatformSample.Skia.Gtk.csproj b/samples/UnoPlatformSample/UnoPlatformSample.Skia.Gtk/UnoPlatformSample.Skia.Gtk.csproj deleted file mode 100644 index 402055bf7..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Skia.Gtk/UnoPlatformSample.Skia.Gtk.csproj +++ /dev/null @@ -1,41 +0,0 @@ - - - WinExe - Exe - net7.0 - app.manifest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Tests/AppInfoTests.cs b/samples/UnoPlatformSample/UnoPlatformSample.Tests/AppInfoTests.cs deleted file mode 100644 index fbc37ab36..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Tests/AppInfoTests.cs +++ /dev/null @@ -1,40 +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 UnoPlatformSample.Tests; - -public class AppInfoTests -{ - [SetUp] - public void Setup() - { - } - - [Test] - public void AppInfoCreation() - { - var appInfo = new AppConfig { Environment = "Test" }; - - appInfo.Should().NotBeNull(); - appInfo.Environment.Should().Be("Test"); - } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Tests/GlobalUsings.cs b/samples/UnoPlatformSample/UnoPlatformSample.Tests/GlobalUsings.cs deleted file mode 100644 index dcb9f8b4d..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Tests/GlobalUsings.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. - -global using FluentAssertions; -global using NUnit.Framework; -global using UnoPlatformSample.Business.Models; diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Tests/UnoPlatformSample.Tests.csproj b/samples/UnoPlatformSample/UnoPlatformSample.Tests/UnoPlatformSample.Tests.csproj deleted file mode 100644 index 7e9224e78..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Tests/UnoPlatformSample.Tests.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net7.0 - false - - - - - - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.UITests/Constants.cs b/samples/UnoPlatformSample/UnoPlatformSample.UITests/Constants.cs deleted file mode 100644 index 1eacfc437..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.UITests/Constants.cs +++ /dev/null @@ -1,33 +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 UnoPlatformSample.UITests; - -public class Constants -{ - public readonly static string WebAssemblyDefaultUri = "http://localhost:5000/"; - public readonly static string iOSAppName = "com.companyname.UnoPlatformSample"; - public readonly static string AndroidAppName = "com.companyname.UnoPlatformSample"; - public readonly static string iOSDeviceNameOrId = "iPad Pro (12.9-inch) (3rd generation)"; - - public readonly static Platform CurrentPlatform = Platform.Browser; -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample.UITests/Given_MainPage.cs b/samples/UnoPlatformSample/UnoPlatformSample.UITests/Given_MainPage.cs deleted file mode 100644 index b5f9c57c7..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.UITests/Given_MainPage.cs +++ /dev/null @@ -1,47 +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 UnoPlatformSample.UITests; - -public class Given_MainPage : TestBase -{ - [Test] - public async Task When_SmokeTest() - { - // NOTICE - // To run UITests, Run the WASM target without debugger. Note - // the port that is being used and update the Constants.cs file - // in the UITests project with the correct port number. - - // Add delay to allow for the splash screen to disappear - await Task.Delay(5000); - - - // Query for the SecondPageButton and then tap it - Query xamlButton = q => q.All().Marked("SecondPageButton"); - App.WaitForElement(xamlButton); - App.Tap(xamlButton); - - // Take a screenshot and add it to the test results - TakeScreenshot("After tapped"); - } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample.UITests/GlobalUsings.cs b/samples/UnoPlatformSample/UnoPlatformSample.UITests/GlobalUsings.cs deleted file mode 100644 index 5c7c2a93a..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.UITests/GlobalUsings.cs +++ /dev/null @@ -1,27 +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. - -global using NUnit.Framework; -global using Uno.UITest; -global using Uno.UITest.Helpers.Queries; -global using Uno.UITests.Helpers; -global using Query = System.Func; diff --git a/samples/UnoPlatformSample/UnoPlatformSample.UITests/TestBase.cs b/samples/UnoPlatformSample/UnoPlatformSample.UITests/TestBase.cs deleted file mode 100644 index e5dbe3270..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.UITests/TestBase.cs +++ /dev/null @@ -1,102 +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 UnoPlatformSample.UITests; - -public class TestBase -{ - private IApp? _app; - - static TestBase() - { - AppInitializer.TestEnvironment.AndroidAppName = Constants.AndroidAppName; - AppInitializer.TestEnvironment.WebAssemblyDefaultUri = Constants.WebAssemblyDefaultUri; - AppInitializer.TestEnvironment.iOSAppName = Constants.iOSAppName; - AppInitializer.TestEnvironment.AndroidAppName = Constants.AndroidAppName; - AppInitializer.TestEnvironment.iOSDeviceNameOrId = Constants.iOSDeviceNameOrId; - AppInitializer.TestEnvironment.CurrentPlatform = Constants.CurrentPlatform; - -#if DEBUG - AppInitializer.TestEnvironment.WebAssemblyHeadless = false; -#endif - - // Start the app only once, so the tests runs don't restart it - // and gain some time for the tests. - AppInitializer.ColdStartApp(); - } - - protected IApp App - { - get => _app!; - private set - { - _app = value; - Uno.UITest.Helpers.Queries.Helpers.App = value; - } - } - - [SetUp] - public void SetUpTest() - { - App = AppInitializer.AttachToApp(); - } - - [TearDown] - public void TearDownTest() - { - TakeScreenshot("teardown"); - } - - public FileInfo TakeScreenshot(string stepName) - { - var title = $"{TestContext.CurrentContext.Test.Name}_{stepName}" - .Replace(" ", "_") - .Replace(".", "_"); - - var fileInfo = App.Screenshot(title); - - var fileNameWithoutExt = Path.GetFileNameWithoutExtension(fileInfo.Name); - if (fileNameWithoutExt != title && fileInfo.DirectoryName != null) - { - var destFileName = Path - .Combine(fileInfo.DirectoryName, title + Path.GetExtension(fileInfo.Name)); - - if (File.Exists(destFileName)) - { - File.Delete(destFileName); - } - - File.Move(fileInfo.FullName, destFileName); - - TestContext.AddTestAttachment(destFileName, stepName); - - fileInfo = new FileInfo(destFileName); - } - else - { - TestContext.AddTestAttachment(fileInfo.FullName, stepName); - } - - return fileInfo; - } - -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample.UITests/UnoPlatformSample.UITests.csproj b/samples/UnoPlatformSample/UnoPlatformSample.UITests/UnoPlatformSample.UITests.csproj deleted file mode 100644 index 6ad4a57a2..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.UITests/UnoPlatformSample.UITests.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - net7.0 - - - - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Wasm/LinkerConfig.xml b/samples/UnoPlatformSample/UnoPlatformSample.Wasm/LinkerConfig.xml deleted file mode 100644 index df91b15b8..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Wasm/LinkerConfig.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Wasm/Program.cs b/samples/UnoPlatformSample/UnoPlatformSample.Wasm/Program.cs deleted file mode 100644 index b99a57482..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Wasm/Program.cs +++ /dev/null @@ -1,35 +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 UnoPlatformSample.Wasm; - -public class Program -{ - private static App? _app; - - public static int Main(string[] args) - { - Microsoft.UI.Xaml.Application.Start(_ => _app = new AppHead()); - - return 0; - } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Wasm/UnoPlatformSample.Wasm.csproj b/samples/UnoPlatformSample/UnoPlatformSample.Wasm/UnoPlatformSample.Wasm.csproj deleted file mode 100644 index d0fa69fb0..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Wasm/UnoPlatformSample.Wasm.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - Exe - net7.0 - $(NoWarn);NU1504;NU1505;NU1701 - - disable - manifest.webmanifest - Properties - - / - - - true - $(DefineConstants);TRACE;DEBUG - portable - true - - false - - - - - - - - - - - True - $(DefineConstants);USE_UITESTS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Wasm/WasmScripts/AppManifest.js b/samples/UnoPlatformSample/UnoPlatformSample.Wasm/WasmScripts/AppManifest.js deleted file mode 100644 index df845f84a..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Wasm/WasmScripts/AppManifest.js +++ /dev/null @@ -1,3 +0,0 @@ -var UnoAppManifest = { - displayName: "UnoPlatformSample" -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Windows/Package.appxmanifest b/samples/UnoPlatformSample/UnoPlatformSample.Windows/Package.appxmanifest deleted file mode 100644 index 8eaafe69a..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Windows/Package.appxmanifest +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - UnoPlatformSample - UnoPlatformSample - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Windows/Properties/launchsettings.json b/samples/UnoPlatformSample/UnoPlatformSample.Windows/Properties/launchsettings.json deleted file mode 100644 index edd66b1e1..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Windows/Properties/launchsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "profiles": { - "UnoPlatformSample.Windows (Package)": { - "commandName": "MsixPackage" - }, - "UnoPlatformSample.Windows (Unpackaged)": { - "commandName": "Project" - } - } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Windows/UnoPlatformSample.Windows.csproj b/samples/UnoPlatformSample/UnoPlatformSample.Windows/UnoPlatformSample.Windows.csproj deleted file mode 100644 index 0da388803..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Windows/UnoPlatformSample.Windows.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - WinExe - net7.0-windows10.0.19041.0 - 10.0.18362.0 - UnoPlatformSample.Windows - app.manifest - x86;x64;arm64 - win10-x86;win10-x64;win10-arm64 - win10-$(Platform).pubxml - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Windows/app.manifest b/samples/UnoPlatformSample/UnoPlatformSample.Windows/app.manifest deleted file mode 100644 index bf8c29ac0..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.Windows/app.manifest +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - true/PM - PerMonitorV2, PerMonitor - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample.sln b/samples/UnoPlatformSample/UnoPlatformSample.sln deleted file mode 100644 index f8baa416b..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample.sln +++ /dev/null @@ -1,321 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34024.191 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{B9B91410-6F69-4DB0-A917-646B729F2467}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Backend", "Backend", "{F075631F-6FB6-476C-8007-491F72A70B15}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Platforms", "Platforms", "{9852BF4B-DB31-4279-94C1-95343B48AD74}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{E58CD4B4-2B35-4D47-9AAD-34016C194D3F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample.DataContracts", "UnoPlatformSample.DataContracts\UnoPlatformSample.DataContracts.csproj", "{B6C4869B-599D-441C-8AE2-83AA0BFB2107}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample", "UnoPlatformSample\UnoPlatformSample.csproj", "{5C5CC19E-F676-4440-82E3-B95B2761AFCF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample.Tests", "UnoPlatformSample.Tests\UnoPlatformSample.Tests.csproj", "{02579EDA-3AF9-42FE-9074-A8F45C51B1D4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample.UITests", "UnoPlatformSample.UITests\UnoPlatformSample.UITests.csproj", "{CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample.Mobile", "UnoPlatformSample.Mobile\UnoPlatformSample.Mobile.csproj", "{84726BD4-BB63-476E-9BD5-8FEC6F773DF5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample.Windows", "UnoPlatformSample.Windows\UnoPlatformSample.Windows.csproj", "{0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample.Wasm", "UnoPlatformSample.Wasm\UnoPlatformSample.Wasm.csproj", "{8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample.Skia.Gtk", "UnoPlatformSample.Skia.Gtk\UnoPlatformSample.Skia.Gtk.csproj", "{420D448C-C768-4844-BD49-485B9CD3116D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoPlatformSample.Server", "UnoPlatformSample.Server\UnoPlatformSample.Server.csproj", "{0DDD817E-0368-4477-AEA0-7760F8B22C70}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LiveChartsSource", "LiveChartsSource", "{98754DD8-C793-49EF-A506-F120FEBA666A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiveChartsCore", "..\..\src\LiveChartsCore\LiveChartsCore.csproj", "{BB328359-ECAC-4B7F-A2FE-972CC2C4944F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiveChartsCore.SkiaSharpView", "..\..\src\skiasharp\LiveChartsCore.SkiaSharp\LiveChartsCore.SkiaSharpView.csproj", "{C3C321D8-3CA3-4714-AFF3-B71A3B819E08}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ViewModelsSamples", "..\ViewModelsSamples\ViewModelsSamples.csproj", "{EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiveChartsCore.SkiaSharpView.Uno.WinUI", "..\..\src\skiasharp\LiveChartsCore.SkiaSharpView.Uno.WinUI\LiveChartsCore.SkiaSharpView.Uno.WinUI.csproj", "{2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiveChartsCore.Behaviours", "..\..\src\LiveChartsCore.Behaviours\LiveChartsCore.Behaviours.csproj", "{55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|arm64 = Debug|arm64 - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|arm64 = Release|arm64 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Debug|arm64.ActiveCfg = Debug|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Debug|arm64.Build.0 = Debug|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Debug|x64.ActiveCfg = Debug|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Debug|x64.Build.0 = Debug|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Debug|x86.ActiveCfg = Debug|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Debug|x86.Build.0 = Debug|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Release|Any CPU.Build.0 = Release|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Release|arm64.ActiveCfg = Release|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Release|arm64.Build.0 = Release|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Release|x64.ActiveCfg = Release|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Release|x64.Build.0 = Release|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Release|x86.ActiveCfg = Release|Any CPU - {B6C4869B-599D-441C-8AE2-83AA0BFB2107}.Release|x86.Build.0 = Release|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Debug|arm64.ActiveCfg = Debug|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Debug|arm64.Build.0 = Debug|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Debug|x64.ActiveCfg = Debug|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Debug|x64.Build.0 = Debug|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Debug|x86.ActiveCfg = Debug|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Debug|x86.Build.0 = Debug|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Release|Any CPU.Build.0 = Release|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Release|arm64.ActiveCfg = Release|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Release|arm64.Build.0 = Release|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Release|x64.ActiveCfg = Release|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Release|x64.Build.0 = Release|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Release|x86.ActiveCfg = Release|Any CPU - {5C5CC19E-F676-4440-82E3-B95B2761AFCF}.Release|x86.Build.0 = Release|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Debug|arm64.ActiveCfg = Debug|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Debug|arm64.Build.0 = Debug|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Debug|x64.ActiveCfg = Debug|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Debug|x64.Build.0 = Debug|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Debug|x86.ActiveCfg = Debug|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Debug|x86.Build.0 = Debug|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Release|Any CPU.Build.0 = Release|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Release|arm64.ActiveCfg = Release|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Release|arm64.Build.0 = Release|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Release|x64.ActiveCfg = Release|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Release|x64.Build.0 = Release|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Release|x86.ActiveCfg = Release|Any CPU - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4}.Release|x86.Build.0 = Release|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Debug|arm64.ActiveCfg = Debug|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Debug|arm64.Build.0 = Debug|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Debug|x64.ActiveCfg = Debug|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Debug|x64.Build.0 = Debug|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Debug|x86.ActiveCfg = Debug|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Debug|x86.Build.0 = Debug|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Release|Any CPU.Build.0 = Release|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Release|arm64.ActiveCfg = Release|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Release|arm64.Build.0 = Release|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Release|x64.ActiveCfg = Release|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Release|x64.Build.0 = Release|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Release|x86.ActiveCfg = Release|Any CPU - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028}.Release|x86.Build.0 = Release|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Debug|arm64.ActiveCfg = Debug|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Debug|arm64.Build.0 = Debug|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Debug|arm64.Deploy.0 = Debug|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Debug|x64.ActiveCfg = Debug|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Debug|x64.Build.0 = Debug|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Debug|x64.Deploy.0 = Debug|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Debug|x86.ActiveCfg = Debug|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Debug|x86.Build.0 = Debug|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Debug|x86.Deploy.0 = Debug|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Release|Any CPU.Build.0 = Release|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Release|Any CPU.Deploy.0 = Release|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Release|arm64.ActiveCfg = Release|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Release|arm64.Build.0 = Release|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Release|arm64.Deploy.0 = Release|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Release|x64.ActiveCfg = Release|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Release|x64.Build.0 = Release|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Release|x64.Deploy.0 = Release|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Release|x86.ActiveCfg = Release|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Release|x86.Build.0 = Release|Any CPU - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5}.Release|x86.Deploy.0 = Release|Any CPU - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Debug|Any CPU.ActiveCfg = Debug|x64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Debug|Any CPU.Build.0 = Debug|x64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Debug|Any CPU.Deploy.0 = Debug|x64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Debug|arm64.ActiveCfg = Debug|arm64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Debug|arm64.Build.0 = Debug|arm64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Debug|arm64.Deploy.0 = Debug|arm64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Debug|x64.ActiveCfg = Debug|x64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Debug|x64.Build.0 = Debug|x64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Debug|x64.Deploy.0 = Debug|x64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Debug|x86.ActiveCfg = Debug|x86 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Debug|x86.Build.0 = Debug|x86 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Debug|x86.Deploy.0 = Debug|x86 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Release|Any CPU.ActiveCfg = Release|x64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Release|Any CPU.Build.0 = Release|x64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Release|Any CPU.Deploy.0 = Release|x64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Release|arm64.ActiveCfg = Release|arm64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Release|arm64.Build.0 = Release|arm64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Release|arm64.Deploy.0 = Release|arm64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Release|x64.ActiveCfg = Release|x64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Release|x64.Build.0 = Release|x64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Release|x64.Deploy.0 = Release|x64 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Release|x86.ActiveCfg = Release|x86 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Release|x86.Build.0 = Release|x86 - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA}.Release|x86.Deploy.0 = Release|x86 - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Debug|arm64.ActiveCfg = Debug|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Debug|arm64.Build.0 = Debug|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Debug|x64.ActiveCfg = Debug|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Debug|x64.Build.0 = Debug|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Debug|x86.ActiveCfg = Debug|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Debug|x86.Build.0 = Debug|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Release|Any CPU.Build.0 = Release|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Release|arm64.ActiveCfg = Release|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Release|arm64.Build.0 = Release|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Release|x64.ActiveCfg = Release|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Release|x64.Build.0 = Release|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Release|x86.ActiveCfg = Release|Any CPU - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64}.Release|x86.Build.0 = Release|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Debug|arm64.ActiveCfg = Debug|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Debug|arm64.Build.0 = Debug|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Debug|x64.ActiveCfg = Debug|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Debug|x64.Build.0 = Debug|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Debug|x86.ActiveCfg = Debug|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Debug|x86.Build.0 = Debug|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Release|Any CPU.Build.0 = Release|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Release|arm64.ActiveCfg = Release|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Release|arm64.Build.0 = Release|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Release|x64.ActiveCfg = Release|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Release|x64.Build.0 = Release|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Release|x86.ActiveCfg = Release|Any CPU - {420D448C-C768-4844-BD49-485B9CD3116D}.Release|x86.Build.0 = Release|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Debug|arm64.ActiveCfg = Debug|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Debug|arm64.Build.0 = Debug|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Debug|x64.ActiveCfg = Debug|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Debug|x64.Build.0 = Debug|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Debug|x86.ActiveCfg = Debug|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Debug|x86.Build.0 = Debug|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Release|Any CPU.Build.0 = Release|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Release|arm64.ActiveCfg = Release|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Release|arm64.Build.0 = Release|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Release|x64.ActiveCfg = Release|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Release|x64.Build.0 = Release|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Release|x86.ActiveCfg = Release|Any CPU - {0DDD817E-0368-4477-AEA0-7760F8B22C70}.Release|x86.Build.0 = Release|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Debug|arm64.ActiveCfg = Debug|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Debug|arm64.Build.0 = Debug|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Debug|x64.ActiveCfg = Debug|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Debug|x64.Build.0 = Debug|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Debug|x86.ActiveCfg = Debug|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Debug|x86.Build.0 = Debug|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Release|Any CPU.Build.0 = Release|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Release|arm64.ActiveCfg = Release|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Release|arm64.Build.0 = Release|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Release|x64.ActiveCfg = Release|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Release|x64.Build.0 = Release|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Release|x86.ActiveCfg = Release|Any CPU - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F}.Release|x86.Build.0 = Release|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Debug|arm64.ActiveCfg = Debug|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Debug|arm64.Build.0 = Debug|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Debug|x64.ActiveCfg = Debug|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Debug|x64.Build.0 = Debug|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Debug|x86.ActiveCfg = Debug|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Debug|x86.Build.0 = Debug|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Release|Any CPU.Build.0 = Release|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Release|arm64.ActiveCfg = Release|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Release|arm64.Build.0 = Release|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Release|x64.ActiveCfg = Release|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Release|x64.Build.0 = Release|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Release|x86.ActiveCfg = Release|Any CPU - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08}.Release|x86.Build.0 = Release|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Debug|arm64.ActiveCfg = Debug|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Debug|arm64.Build.0 = Debug|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Debug|x64.ActiveCfg = Debug|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Debug|x64.Build.0 = Debug|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Debug|x86.ActiveCfg = Debug|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Debug|x86.Build.0 = Debug|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Release|Any CPU.Build.0 = Release|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Release|arm64.ActiveCfg = Release|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Release|arm64.Build.0 = Release|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Release|x64.ActiveCfg = Release|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Release|x64.Build.0 = Release|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Release|x86.ActiveCfg = Release|Any CPU - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669}.Release|x86.Build.0 = Release|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Debug|arm64.ActiveCfg = Debug|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Debug|arm64.Build.0 = Debug|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Debug|x64.ActiveCfg = Debug|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Debug|x64.Build.0 = Debug|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Debug|x86.ActiveCfg = Debug|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Debug|x86.Build.0 = Debug|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Release|Any CPU.Build.0 = Release|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Release|arm64.ActiveCfg = Release|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Release|arm64.Build.0 = Release|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Release|x64.ActiveCfg = Release|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Release|x64.Build.0 = Release|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Release|x86.ActiveCfg = Release|Any CPU - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A}.Release|x86.Build.0 = Release|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Debug|arm64.ActiveCfg = Debug|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Debug|arm64.Build.0 = Debug|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Debug|x64.ActiveCfg = Debug|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Debug|x64.Build.0 = Debug|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Debug|x86.ActiveCfg = Debug|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Debug|x86.Build.0 = Debug|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Release|Any CPU.Build.0 = Release|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Release|arm64.ActiveCfg = Release|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Release|arm64.Build.0 = Release|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Release|x64.ActiveCfg = Release|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Release|x64.Build.0 = Release|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Release|x86.ActiveCfg = Release|Any CPU - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {F075631F-6FB6-476C-8007-491F72A70B15} = {B9B91410-6F69-4DB0-A917-646B729F2467} - {9852BF4B-DB31-4279-94C1-95343B48AD74} = {B9B91410-6F69-4DB0-A917-646B729F2467} - {B6C4869B-599D-441C-8AE2-83AA0BFB2107} = {B9B91410-6F69-4DB0-A917-646B729F2467} - {5C5CC19E-F676-4440-82E3-B95B2761AFCF} = {B9B91410-6F69-4DB0-A917-646B729F2467} - {02579EDA-3AF9-42FE-9074-A8F45C51B1D4} = {E58CD4B4-2B35-4D47-9AAD-34016C194D3F} - {CD652080-C1B8-4A5F-B97B-7E8C6B9D5028} = {E58CD4B4-2B35-4D47-9AAD-34016C194D3F} - {84726BD4-BB63-476E-9BD5-8FEC6F773DF5} = {9852BF4B-DB31-4279-94C1-95343B48AD74} - {0DDEDE21-68A8-4DE4-A001-68AB730EF7EA} = {9852BF4B-DB31-4279-94C1-95343B48AD74} - {8DF1ECC6-36DC-45FE-8A5E-10A9E1123F64} = {9852BF4B-DB31-4279-94C1-95343B48AD74} - {420D448C-C768-4844-BD49-485B9CD3116D} = {9852BF4B-DB31-4279-94C1-95343B48AD74} - {0DDD817E-0368-4477-AEA0-7760F8B22C70} = {F075631F-6FB6-476C-8007-491F72A70B15} - {BB328359-ECAC-4B7F-A2FE-972CC2C4944F} = {98754DD8-C793-49EF-A506-F120FEBA666A} - {C3C321D8-3CA3-4714-AFF3-B71A3B819E08} = {98754DD8-C793-49EF-A506-F120FEBA666A} - {EE2EB14F-01BB-4A01-89F4-0CF88CBD0669} = {B9B91410-6F69-4DB0-A917-646B729F2467} - {2D5903B0-DBD3-4F49-A94C-AF44D2193C8A} = {98754DD8-C793-49EF-A506-F120FEBA666A} - {55278FF8-FED3-4A60-8AC2-0AB5BA6F84B9} = {98754DD8-C793-49EF-A506-F120FEBA666A} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {4C6F8CF1-CF97-4BED-9F5B-F97F15C166EC} - EndGlobalSection -EndGlobal diff --git a/samples/UnoPlatformSample/UnoPlatformSample/AppResources.xaml b/samples/UnoPlatformSample/UnoPlatformSample/AppResources.xaml deleted file mode 100644 index 4e8f2bad1..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/AppResources.xaml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Assets/SharedAssets.md b/samples/UnoPlatformSample/UnoPlatformSample/Assets/SharedAssets.md deleted file mode 100644 index 6d84997f1..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Assets/SharedAssets.md +++ /dev/null @@ -1,34 +0,0 @@ -See documentation about assets here : https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md - -# Here is a cheat sheet: - -1. Add the image file to the `Assets` directory of a shared project. -2. Set the build action to `Content`. -3. (Recommended) Provide an asset for various scales/dpi - -## Examples - -``` -\Assets\Images\logo.scale-100.png -\Assets\Images\logo.scale-200.png -\Assets\Images\logo.scale-400.png - -\Assets\Images\scale-100\logo.png -\Assets\Images\scale-200\logo.png -\Assets\Images\scale-400\logo.png -``` - -## Table of scales - -| Scale | UWP | iOS | Android | -|-------|:-----------:|:--------:|:-------:| -| `100` | scale-100 | @1x | mdpi | -| `125` | scale-125 | N/A | N/A | -| `150` | scale-150 | N/A | hdpi | -| `200` | scale-200 | @2x | xhdpi | -| `300` | scale-300 | @3x | xxhdpi | -| `400` | scale-400 | N/A | xxxhdpi | - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Business/Models/AppConfig.cs b/samples/UnoPlatformSample/UnoPlatformSample/Business/Models/AppConfig.cs deleted file mode 100644 index 2106e7560..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Business/Models/AppConfig.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 UnoPlatformSample.Business.Models; - -public record AppConfig -{ - public string? Environment { get; init; } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Business/Models/Entity.cs b/samples/UnoPlatformSample/UnoPlatformSample/Business/Models/Entity.cs deleted file mode 100644 index 661c4f5ae..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Business/Models/Entity.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. - -namespace UnoPlatformSample.Business.Models; - -public record Entity(string Name); diff --git a/samples/UnoPlatformSample/UnoPlatformSample/GlobalUsings.cs b/samples/UnoPlatformSample/UnoPlatformSample/GlobalUsings.cs deleted file mode 100644 index 457ebaade..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/GlobalUsings.cs +++ /dev/null @@ -1,54 +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. - -global using System.Collections.Immutable; -global using System.Windows.Input; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Hosting; -global using Microsoft.Extensions.Localization; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using Microsoft.UI.Xaml; -global using Microsoft.UI.Xaml.Controls; -global using Microsoft.UI.Xaml.Media; -global using Microsoft.UI.Xaml.Navigation; -global using Refit; -global using Uno.Extensions; -global using Uno.Extensions.Configuration; -global using Uno.Extensions.Hosting; -global using Uno.Extensions.Http; -global using Uno.Extensions.Localization; -global using Uno.Extensions.Logging; -global using Uno.Extensions.Navigation; -global using Uno.Extensions.Reactive; -global using Uno.Extensions.Serialization; -global using UnoPlatformSample.Business.Models; -global using UnoPlatformSample.DataContracts; -global using UnoPlatformSample.DataContracts.Serialization; -global using UnoPlatformSample.Infrastructure; -global using UnoPlatformSample.Presentation; -global using UnoPlatformSample.Services.Caching; -global using UnoPlatformSample.Services.Endpoints; -global using Windows.ApplicationModel; -global using Windows.Networking.Connectivity; -global using Windows.Storage; -global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState; diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Infrastructure/DebugHandler.cs b/samples/UnoPlatformSample/UnoPlatformSample/Infrastructure/DebugHandler.cs deleted file mode 100644 index 1cd7130f1..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Infrastructure/DebugHandler.cs +++ /dev/null @@ -1,63 +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 UnoPlatformSample.Infrastructure; - -internal class DebugHttpHandler : DelegatingHandler -{ - private readonly ILogger _logger; - - public DebugHttpHandler(ILogger logger, HttpMessageHandler? innerHandler = null) - : base(innerHandler ?? new HttpClientHandler()) - { - _logger = logger; - } - - protected async override Task SendAsync( - HttpRequestMessage request, - CancellationToken cancellationToken) - { - var response = await base.SendAsync(request, cancellationToken); -#if DEBUG - if(!response.IsSuccessStatusCode) - { - _logger.LogDebugMessage("Unsuccessful API Call"); - if(request.RequestUri is not null) - _logger.LogDebugMessage($"{request.RequestUri} ({request.Method})"); - foreach((var key, var values) in request.Headers.ToDictionary(x => x.Key, x => string.Join(", ", x.Value))) - { - _logger.LogDebugMessage($"{key}: {values}"); - } - - var content = request.Content is not null ? await request.Content.ReadAsStringAsync() : null; - if(!string.IsNullOrEmpty(content)) - { - _logger.LogDebugMessage(content); - } - - // Uncomment to automatically break when an API call fails while debugging - // System.Diagnostics.Debugger.Break(); - } -#endif - return response; - } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/MainModel.cs b/samples/UnoPlatformSample/UnoPlatformSample/Presentation/MainModel.cs deleted file mode 100644 index 6faf3fcdd..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/MainModel.cs +++ /dev/null @@ -1,28 +0,0 @@ -using LiveChartsCore; -using LiveChartsCore.SkiaSharpView; -using Uno.Extensions.Reactive; - -namespace UnoPlatformSample.Presentation; -public partial record MainModel -{ - public string? Title { get; } - - public IState Name { get; } - - public MainModel( - INavigator navigator, - IStringLocalizer localizer) - { - _navigator = navigator; - Title = $"Main - {localizer["ApplicationName"]}"; - Name = State.Value(this, () => string.Empty); - } - - public async Task GoToSecond() - { - var name = await Name; - await _navigator.NavigateViewModelAsync(this, data: new Entity(name!)); - } - - private INavigator _navigator; -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/MainPage.xaml b/samples/UnoPlatformSample/UnoPlatformSample/Presentation/MainPage.xaml deleted file mode 100644 index 47ba83084..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/MainPage.xaml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/MainPage.xaml.cs b/samples/UnoPlatformSample/UnoPlatformSample/Presentation/MainPage.xaml.cs deleted file mode 100644 index 5f17eb590..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/MainPage.xaml.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.UI.Xaml.Input; - -namespace UnoPlatformSample.Presentation; - -public sealed partial class MainPage : Page -{ - private bool _isMenuOpen = false; - - public MainPage() - { - this.InitializeComponent(); - - Samples = ViewModelsSamples.Index.Samples; - grid.DataContext = this; - - LoadSample("Design/LinearGradients"); - - } - - public string[] Samples { get; set; } - - private void LoadSample(string route) - { - route = route.Replace('/', '.'); - var t = Type.GetType($"UnoWinUISample.{route}.View") ?? throw new FileNotFoundException($"{route} not found!"); - content.Content = Activator.CreateInstance(t); - } - - private void Button_Click(object sender, RoutedEventArgs e) - { - grid.ColumnDefinitions[0].Width = _isMenuOpen ? new GridLength(0) : new GridLength(250); - _isMenuOpen = !_isMenuOpen; - } - - private void Button_Click_1(object sender, RoutedEventArgs e) - { - grid.ColumnDefinitions[0].Width = new GridLength(0); - - var ctx = (string)((FrameworkElement)sender).DataContext; - LoadSample(ctx); - } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/SecondModel.cs b/samples/UnoPlatformSample/UnoPlatformSample/Presentation/SecondModel.cs deleted file mode 100644 index 4c7be2989..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/SecondModel.cs +++ /dev/null @@ -1,27 +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 UnoPlatformSample.Presentation; - -public partial record SecondModel(Entity Entity) -{ -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/SecondPage.xaml b/samples/UnoPlatformSample/UnoPlatformSample/Presentation/SecondPage.xaml deleted file mode 100644 index 6ef332e50..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/SecondPage.xaml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/SecondPage.xaml.cs b/samples/UnoPlatformSample/UnoPlatformSample/Presentation/SecondPage.xaml.cs deleted file mode 100644 index 8200ed04b..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/SecondPage.xaml.cs +++ /dev/null @@ -1,32 +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 UnoPlatformSample.Presentation; - -public sealed partial class SecondPage : Page -{ - public SecondPage() - { - this.InitializeComponent(); - } -} - diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/Shell.xaml b/samples/UnoPlatformSample/UnoPlatformSample/Presentation/Shell.xaml deleted file mode 100644 index 78781677c..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/Shell.xaml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/Shell.xaml.cs b/samples/UnoPlatformSample/UnoPlatformSample/Presentation/Shell.xaml.cs deleted file mode 100644 index 55b273f4f..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/Shell.xaml.cs +++ /dev/null @@ -1,32 +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 UnoPlatformSample.Presentation; - -public sealed partial class Shell : UserControl, IContentControlProvider -{ - public Shell() - { - this.InitializeComponent(); - } - public ContentControl ContentControl => Splash; -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/ShellModel.cs b/samples/UnoPlatformSample/UnoPlatformSample/Presentation/ShellModel.cs deleted file mode 100644 index cd7b73dec..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Presentation/ShellModel.cs +++ /dev/null @@ -1,40 +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 UnoPlatformSample.Presentation; - -public class ShellModel -{ - private readonly INavigator _navigator; - - public ShellModel( - INavigator navigator) - { - _navigator = navigator; - _ = Start(); - } - - public async Task Start() - { - await _navigator.NavigateViewModelAsync(this); - } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Services/Caching/IWeatherCache.cs b/samples/UnoPlatformSample/UnoPlatformSample/Services/Caching/IWeatherCache.cs deleted file mode 100644 index 5ea584067..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Services/Caching/IWeatherCache.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 UnoPlatformSample.Services.Caching; - -public interface IWeatherCache -{ - ValueTask> GetForecast(CancellationToken token); -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Services/Caching/WeatherCache.cs b/samples/UnoPlatformSample/UnoPlatformSample/Services/Caching/WeatherCache.cs deleted file mode 100644 index f3f1d9eb9..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Services/Caching/WeatherCache.cs +++ /dev/null @@ -1,97 +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 UnoPlatformSample.Services.Caching; - -public sealed class WeatherCache : IWeatherCache -{ - private readonly IApiClient _api; - private readonly ISerializer _serializer; - private readonly ILogger _logger; - - public WeatherCache(IApiClient api, ISerializer serializer, ILogger logger) - { - _api = api; - _serializer = serializer; - _logger = logger; - } - - private bool IsConnected => NetworkInformation.GetInternetConnectionProfile().GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess; - - public async ValueTask> GetForecast(CancellationToken token) - { - var weatherText = await GetCachedWeather(); - if (!string.IsNullOrWhiteSpace(weatherText)) - { - return _serializer.FromString>(weatherText); - } - - if (!IsConnected) - { - _logger.LogWarning("App is offline and cannot connect to the API."); - throw new Exception("No internet connection"); - } - - var response = await _api.GetWeather(token); - - if (response.IsSuccessStatusCode && response.Content is not null) - { - var weather = response.Content; - await Save(weather, token); - return weather; - } - else if (response.Error is not null) - { - _logger.LogError(response.Error, "An error occurred while retrieving the latest Forecast."); - throw response.Error; - } - else - { - return ImmutableArray.Empty; - } - } - - private async ValueTask GetFile(CreationCollisionOption option) => - await ApplicationData.Current.TemporaryFolder.CreateFileAsync("weather.json", option); - - private async ValueTask GetCachedWeather() - { - var file = await GetFile(CreationCollisionOption.OpenIfExists); - var properties = await file.GetBasicPropertiesAsync(); - - // Reuse latest cache file if offline - // or if the file is less than 5 minutes old - if (IsConnected || DateTimeOffset.Now.AddMinutes(-5) > properties.DateModified) - { - return null; - } - - return await File.ReadAllTextAsync(file.Path); - } - - private async ValueTask Save(IImmutableList weather, CancellationToken token) - { - var weatherText = _serializer.ToString(weather); - var file = await GetFile(CreationCollisionOption.ReplaceExisting); - await File.WriteAllTextAsync(file.Path, weatherText); - } -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Services/Endpoints/IApiClient.cs b/samples/UnoPlatformSample/UnoPlatformSample/Services/Endpoints/IApiClient.cs deleted file mode 100644 index 85c0ca558..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Services/Endpoints/IApiClient.cs +++ /dev/null @@ -1,30 +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 UnoPlatformSample.Services.Endpoints; - -[Headers("Content-Type: application/json")] -public interface IApiClient -{ - [Get("/api/weatherforecast")] - Task>> GetWeather(CancellationToken cancellationToken = default); -} diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Styles/ColorPaletteOverride.zip b/samples/UnoPlatformSample/UnoPlatformSample/Styles/ColorPaletteOverride.zip deleted file mode 100644 index dfac0a9d8..000000000 Binary files a/samples/UnoPlatformSample/UnoPlatformSample/Styles/ColorPaletteOverride.zip and /dev/null differ diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Styles/MaterialFontsOverride.xaml b/samples/UnoPlatformSample/UnoPlatformSample/Styles/MaterialFontsOverride.xaml deleted file mode 100644 index 385d65953..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/Styles/MaterialFontsOverride.xaml +++ /dev/null @@ -1,8 +0,0 @@ - - - ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf#Roboto - ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf#Roboto - ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf#Roboto - - diff --git a/samples/UnoPlatformSample/UnoPlatformSample/UnoPlatformSample.csproj b/samples/UnoPlatformSample/UnoPlatformSample/UnoPlatformSample.csproj deleted file mode 100644 index 03de68bc9..000000000 --- a/samples/UnoPlatformSample/UnoPlatformSample/UnoPlatformSample.csproj +++ /dev/null @@ -1,77 +0,0 @@ - - - $(TargetFrameworks);net7.0-windows10.0.19041 - $(TargetFrameworks);net7.0;net7.0-ios;net7.0-android;net7.0-maccatalyst - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %(Filename) - - - - - - - - - - - - - - - - - - - - diff --git a/samples/UnoPlatform_v5/.editorconfig b/samples/UnoPlatform_v5/.editorconfig new file mode 100644 index 000000000..ed52b2042 --- /dev/null +++ b/samples/UnoPlatform_v5/.editorconfig @@ -0,0 +1,167 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://editorconfig.org + +# This file is the top-most EditorConfig file +root = true + +########################################## +# Common Settings +########################################## + +[*] +indent_style = space +end_of_line = crlf +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 + +########################################## +# File Extension Settings +########################################## + +[*.{yml,yaml}] +indent_size = 2 + +[.vsconfig] +indent_size = 2 +end_of_line = lf + +[*.sln] +indent_style = tab +indent_size = 2 + +[*.{csproj,proj,projitems,shproj}] +indent_size = 2 + +[*.{json,slnf}] +indent_size = 2 +end_of_line = lf + +[*.{props,targets}] +indent_size = 2 + +[*.xaml] +indent_size = 2 +charset = utf-8-bom + +[*.xml] +indent_size = 2 +end_of_line = lf + +[*.plist] +indent_size = 2 +indent_style = tab +end_of_line = lf + +[*.manifest] +indent_size = 2 + +[*.appxmanifest] +indent_size = 2 + +[*.{json,css,webmanifest}] +indent_size = 2 +end_of_line = lf + +[web.config] +indent_size = 2 +end_of_line = lf + +[*.sh] +indent_size = 2 +end_of_line = lf + +[*.cs] +# EOL should be normalized by Git. See https://github.com/dotnet/format/issues/1099 +end_of_line = unset + +# See https://github.com/dotnet/roslyn/issues/20356#issuecomment-310143926 +trim_trailing_whitespace = false + +tab_width = 4 +indent_size = 4 + +# Sort using and Import directives with System.* appearing first +dotnet_sort_system_directives_first = true + +# Avoid "this." and "Me." if not necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion + +csharp_indent_labels = one_less_than_current +csharp_using_directive_placement = outside_namespace:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:silent +csharp_style_namespace_declarations = block_scoped:silent +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_prefer_primary_constructors = true:suggestion +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent diff --git a/samples/UnoPlatform_v5/.gitignore b/samples/UnoPlatform_v5/.gitignore new file mode 100644 index 000000000..bc55501a7 --- /dev/null +++ b/samples/UnoPlatform_v5/.gitignore @@ -0,0 +1,403 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + +# Single Target Config +solution-config.props +# Windows Publish Profiles +!**/*.Windows/Properties/PublishProfiles/*.pubxml \ No newline at end of file diff --git a/samples/UnoPlatformSample/.vscode/launch.json b/samples/UnoPlatform_v5/.vscode/launch.json similarity index 85% rename from samples/UnoPlatformSample/.vscode/launch.json rename to samples/UnoPlatform_v5/.vscode/launch.json index d6af66c57..4c8e1b506 100644 --- a/samples/UnoPlatformSample/.vscode/launch.json +++ b/samples/UnoPlatform_v5/.vscode/launch.json @@ -4,6 +4,13 @@ // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md "version": "0.2.0", "configurations": [ + { + "name": "Uno Platform Mobile", + "type": "Uno", + "request": "launch", + // any Uno* task will do, this is simply to satisfy vscode requirement when a launch.json is present + "preLaunchTask": "Uno: android | Debug | android-x64" + }, { // Use IntelliSense to find out which attributes exist for C# debugging // Use hover for the description of the existing attributes @@ -11,8 +18,8 @@ "name": "Debug (Chrome, WebAssembly)", "type": "chrome", "request": "launch", - "url": "http://localhost:5000", - "webRoot": "${workspaceFolder}/UnoPlatformSample.Wasm", + "url": "http://localhost:5001", + "webRoot": "${workspaceFolder}/UnoPlatform_v5.Wasm", "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "timeout": 30000, "server": { @@ -20,7 +27,7 @@ "program": "run", "outputCapture": "std", "timeout": 30000, - "cwd": "${workspaceFolder}/UnoPlatformSample.Wasm" + "cwd": "${workspaceFolder}/UnoPlatform_v5.Wasm" } }, { @@ -32,22 +39,15 @@ "request": "launch", "preLaunchTask": "build-skia-gtk", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/UnoPlatformSample.Skia.Gtk/bin/Debug/net7.0/UnoPlatformSample.Skia.Gtk.dll", + "program": "${workspaceFolder}/UnoPlatform_v5.Skia.Gtk/bin/Debug/net7.0/UnoPlatform_v5.Skia.Gtk.dll", "args": [], "env": { "DOTNET_MODIFIABLE_ASSEMBLIES": "debug" }, - "cwd": "${workspaceFolder}/UnoPlatformSample.Skia.Gtk", + "cwd": "${workspaceFolder}/UnoPlatform_v5.Skia.Gtk", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console "console": "internalConsole", "stopAtEntry": false }, - { - "name": "Uno Platform Mobile", - "type": "Uno", - "request": "launch", - // any Uno* task will do, this is simply to satisfy vscode requirement when a launch.json is present - "preLaunchTask": "Uno: android | Debug | android-x64" - }, ] } diff --git a/samples/UnoPlatformSample/.vscode/settings.json b/samples/UnoPlatform_v5/.vscode/settings.json similarity index 100% rename from samples/UnoPlatformSample/.vscode/settings.json rename to samples/UnoPlatform_v5/.vscode/settings.json diff --git a/samples/UnoPlatformSample/.vscode/tasks.json b/samples/UnoPlatform_v5/.vscode/tasks.json similarity index 76% rename from samples/UnoPlatformSample/.vscode/tasks.json rename to samples/UnoPlatform_v5/.vscode/tasks.json index 32f202f6d..580ba43da 100644 --- a/samples/UnoPlatformSample/.vscode/tasks.json +++ b/samples/UnoPlatform_v5/.vscode/tasks.json @@ -7,7 +7,7 @@ "type": "process", "args": [ "build", - "${workspaceFolder}/UnoPlatformSample.Wasm/UnoPlatformSample.Wasm.csproj", + "${workspaceFolder}/UnoPlatform_v5.Wasm/UnoPlatform_v5.Wasm.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], @@ -19,7 +19,7 @@ "type": "process", "args": [ "publish", - "${workspaceFolder}/UnoPlatformSample.Wasm/UnoPlatformSample.Wasm.csproj", + "${workspaceFolder}/UnoPlatform_v5.Wasm/UnoPlatform_v5.Wasm.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], @@ -31,7 +31,7 @@ "type": "process", "args": [ "build", - "${workspaceFolder}/UnoPlatformSample.Skia.Gtk/UnoPlatformSample.Skia.Gtk.csproj", + "${workspaceFolder}/UnoPlatform_v5.Skia.Gtk/UnoPlatform_v5.Skia.Gtk.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], @@ -43,7 +43,7 @@ "type": "process", "args": [ "publish", - "${workspaceFolder}/UnoPlatformSample.Skia.Gtk/UnoPlatformSample.Skia.Gtk.csproj", + "${workspaceFolder}/UnoPlatform_v5.Skia.Gtk/UnoPlatform_v5.Skia.Gtk.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], diff --git a/samples/UnoPlatformSample/.vsconfig b/samples/UnoPlatform_v5/.vsconfig similarity index 90% rename from samples/UnoPlatformSample/.vsconfig rename to samples/UnoPlatform_v5/.vsconfig index 1c9c22808..072b0c88c 100644 --- a/samples/UnoPlatformSample/.vsconfig +++ b/samples/UnoPlatform_v5/.vsconfig @@ -5,10 +5,10 @@ "Microsoft.VisualStudio.Workload.CoreEditor", "Microsoft.NetCore.Component.SDK", "Microsoft.NetCore.Component.DevelopmentTools", - "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions", - "Microsoft.NetCore.Component.Web", "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", "Microsoft.VisualStudio.Component.TextTemplating", + "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions", + "Microsoft.NetCore.Component.Web", "Microsoft.VisualStudio.Component.IISExpress", "Component.Microsoft.Web.LibraryManager", "Microsoft.VisualStudio.ComponentGroup.Web", @@ -17,22 +17,23 @@ "Microsoft.VisualStudio.Workload.NetWeb", "Microsoft.VisualStudio.ComponentGroup.Azure.Prerequisites", "Microsoft.VisualStudio.Workload.Azure", + "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine", "Microsoft.VisualStudio.Component.Windows10SDK.19041", + "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging", "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", "Microsoft.VisualStudio.Component.Debugger.JustInTime", - "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging", "Microsoft.VisualStudio.Workload.ManagedDesktop", "Microsoft.Component.NetFX.Native", "Microsoft.VisualStudio.Component.Graphics", - "Component.OpenJDK", - "Microsoft.VisualStudio.Component.MonoDebugger", "Microsoft.VisualStudio.Component.Merq", "Component.Xamarin.RemotedSimulator", - "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine", + "Microsoft.VisualStudio.Component.MonoDebugger", "Component.Xamarin", - "Component.Android.SDK32", + "Microsoft.VisualStudio.ComponentGroup.Maui.All", + "Component.Android.SDK34", + "Component.Android.SDK33", + "Component.OpenJDK", "Microsoft.VisualStudio.Workload.NetCrossPlat", - "Microsoft.VisualStudio.Workload.NetCoreTools", - "Microsoft.VisualStudio.ComponentGroup.Maui.All" + "Microsoft.VisualStudio.Workload.NetCoreTools" ] } diff --git a/samples/UnoPlatform_v5/Directory.Build.props b/samples/UnoPlatform_v5/Directory.Build.props new file mode 100644 index 000000000..4637a6bd2 --- /dev/null +++ b/samples/UnoPlatform_v5/Directory.Build.props @@ -0,0 +1,77 @@ + + + + + + + + enable + enable + + portable + True + + true + + + $(NoWarn);NU1507;NETSDK1201;PRI257 + + en + + false + false + false + false + false + + + false + + + + + + true + 21.0 + + + + + true + 14.2 + + + + + true + 10.14 + + + + + true + 14.0 + + + + + true + 10.0.18362.0 + 10.0.18362.0 + win-x86;win-x64;win-arm64 + false + + + + + diff --git a/samples/UnoPlatform_v5/Directory.Build.targets b/samples/UnoPlatform_v5/Directory.Build.targets new file mode 100644 index 000000000..f624a9286 --- /dev/null +++ b/samples/UnoPlatform_v5/Directory.Build.targets @@ -0,0 +1,6 @@ + + + + + + diff --git a/samples/UnoPlatformSample/Directory.Packages.props b/samples/UnoPlatform_v5/Directory.Packages.props similarity index 54% rename from samples/UnoPlatformSample/Directory.Packages.props rename to samples/UnoPlatform_v5/Directory.Packages.props index b3b9a4186..a09997cbe 100644 --- a/samples/UnoPlatformSample/Directory.Packages.props +++ b/samples/UnoPlatform_v5/Directory.Packages.props @@ -1,56 +1,56 @@ - + - - - + + + - + - + - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + - + diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5.Base/AppHead.xaml b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/AppHead.xaml new file mode 100644 index 000000000..3b7203ef5 --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/AppHead.xaml @@ -0,0 +1,17 @@ + + + + + + + + + + + diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5.Base/AppHead.xaml.cs b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/AppHead.xaml.cs new file mode 100644 index 000000000..65b35b016 --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/AppHead.xaml.cs @@ -0,0 +1,29 @@ +using Microsoft.UI.Xaml; +using Uno.Resizetizer; + +namespace UnoPlatform_v5 +{ + public sealed partial class AppHead : App + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public AppHead() + { + this.InitializeComponent(); + } + + /// + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// + /// Details about the launch request and process. + protected override void OnLaunched(LaunchActivatedEventArgs args) + { + base.OnLaunched(args); + + MainWindow.SetWindowIcon(); + } + } +} \ No newline at end of file diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Base/Icons/iconapp.svg b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/Icons/icon.svg similarity index 96% rename from samples/UnoPlatformSample/UnoPlatformSample.Base/Icons/iconapp.svg rename to samples/UnoPlatform_v5/UnoPlatform_v5.Base/Icons/icon.svg index f621ea597..a15af53aa 100644 --- a/samples/UnoPlatformSample/UnoPlatformSample.Base/Icons/iconapp.svg +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/Icons/icon.svg @@ -5,7 +5,7 @@ viewBox="0 0 456 456" version="1.1" id="svg453" - sodipodi:docname="iconapp.old.svg" + sodipodi:docname="icon.svg" inkscape:version="1.2 (dc2aedaf03, 2022-05-15)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Base/Icons/appconfig.svg b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/Icons/icon_foreground.svg similarity index 99% rename from samples/UnoPlatformSample/UnoPlatformSample.Base/Icons/appconfig.svg rename to samples/UnoPlatform_v5/UnoPlatform_v5.Base/Icons/icon_foreground.svg index 3106b1a8b..8ffc41ae3 100644 --- a/samples/UnoPlatformSample/UnoPlatformSample.Base/Icons/appconfig.svg +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/Icons/icon_foreground.svg @@ -5,7 +5,7 @@ viewBox="0 0 50.369617 49.826836" version="1.1" id="svg151" - sodipodi:docname="appconfig.svg" + sodipodi:docname="icon_foreground.svg" inkscape:version="1.2 (dc2aedaf03, 2022-05-15)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Base/Splash/splash_screen.svg b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/Splash/splash_screen.svg similarity index 99% rename from samples/UnoPlatformSample/UnoPlatformSample.Base/Splash/splash_screen.svg rename to samples/UnoPlatform_v5/UnoPlatform_v5.Base/Splash/splash_screen.svg index 3106b1a8b..8ffc41ae3 100644 --- a/samples/UnoPlatformSample/UnoPlatformSample.Base/Splash/splash_screen.svg +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/Splash/splash_screen.svg @@ -5,7 +5,7 @@ viewBox="0 0 50.369617 49.826836" version="1.1" id="svg151" - sodipodi:docname="appconfig.svg" + sodipodi:docname="icon_foreground.svg" inkscape:version="1.2 (dc2aedaf03, 2022-05-15)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5.Base/UnoPlatform_v5.Base.csproj b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/UnoPlatform_v5.Base.csproj new file mode 100644 index 000000000..8d78f515e --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/UnoPlatform_v5.Base.csproj @@ -0,0 +1,12 @@ + + + + net7.0 + false + + + + + + + diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5.Base/base.props b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/base.props new file mode 100644 index 000000000..18467633a --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.Base/base.props @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5.DataContracts/Serialization/WeatherForecastContext.cs b/samples/UnoPlatform_v5/UnoPlatform_v5.DataContracts/Serialization/WeatherForecastContext.cs new file mode 100644 index 000000000..6902c56f1 --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.DataContracts/Serialization/WeatherForecastContext.cs @@ -0,0 +1,25 @@ +using System.Collections.Immutable; +using System.Text.Json.Serialization; + +namespace UnoPlatform_v5.DataContracts.Serialization +{ + /// + /// Generated class for System.Text.Json Serialization + /// + /// + /// When using the JsonSerializerContext you must add the JsonSerializableAttribute + /// for each type that you may need to serialize / deserialize including both the + /// concrete type and any interface that the concrete type implements. + /// For more information on the JsonSerializerContext see: + /// https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/source-generation?WT.mc_id=DT-MVP-5002924 + /// + [JsonSerializable(typeof(WeatherForecast))] + [JsonSerializable(typeof(WeatherForecast[]))] + [JsonSerializable(typeof(IEnumerable))] + [JsonSerializable(typeof(IImmutableList))] + [JsonSerializable(typeof(ImmutableList))] + [JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)] + public partial class WeatherForecastContext : JsonSerializerContext + { + } +} \ No newline at end of file diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5.DataContracts/UnoPlatform_v5.DataContracts.csproj b/samples/UnoPlatform_v5/UnoPlatform_v5.DataContracts/UnoPlatform_v5.DataContracts.csproj new file mode 100644 index 000000000..60d4bd525 --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.DataContracts/UnoPlatform_v5.DataContracts.csproj @@ -0,0 +1,6 @@ + + + net7.0 + true + + diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5.DataContracts/WeatherForecast.cs b/samples/UnoPlatform_v5/UnoPlatform_v5.DataContracts/WeatherForecast.cs new file mode 100644 index 000000000..fe0ff0a5f --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.DataContracts/WeatherForecast.cs @@ -0,0 +1,16 @@ +namespace UnoPlatform_v5.DataContracts +{ + /// + /// A Weather Forecast for a specific date + /// + /// Gets the Date of the Forecast. + /// Gets the Forecast Temperature in Celsius. + /// Get a description of how the weather will feel. + public record WeatherForecast(DateOnly Date, double TemperatureC, string? Summary) + { + /// + /// Gets the Forecast Temperature in Fahrenheit + /// + public double TemperatureF => 32 + (TemperatureC * 9 / 5); + } +} \ No newline at end of file diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/AndroidManifest.xml b/samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/AndroidManifest.xml similarity index 100% rename from samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/AndroidManifest.xml rename to samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/AndroidManifest.xml diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/Assets/AboutAssets.txt b/samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/Assets/AboutAssets.txt similarity index 100% rename from samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/Assets/AboutAssets.txt rename to samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/Assets/AboutAssets.txt diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/Main.Android.cs b/samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/Main.Android.cs new file mode 100644 index 000000000..67458f131 --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/Main.Android.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Android.App; +using Android.Content; +using Android.OS; +using Android.Runtime; +using Android.Views; +using Android.Widget; +using Com.Nostra13.Universalimageloader.Core; +using Microsoft.UI.Xaml.Media; + +namespace UnoPlatform_v5.Droid +{ + [global::Android.App.ApplicationAttribute( + Label = "@string/ApplicationName", + Icon = "@mipmap/icon", + LargeHeap = true, + HardwareAccelerated = true, + Theme = "@style/AppTheme" + )] + public class Application : Microsoft.UI.Xaml.NativeApplication + { + public Application(IntPtr javaReference, JniHandleOwnership transfer) + : base(() => new AppHead(), javaReference, transfer) + { + ConfigureUniversalImageLoader(); + } + + private static void ConfigureUniversalImageLoader() + { + // Create global configuration and initialize ImageLoader with this config + ImageLoaderConfiguration config = new ImageLoaderConfiguration + .Builder(Context) + .Build(); + + ImageLoader.Instance.Init(config); + + ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync; + } + } +} \ No newline at end of file diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/MainActivity.Android.cs b/samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/MainActivity.Android.cs new file mode 100644 index 000000000..e2f279316 --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/MainActivity.Android.cs @@ -0,0 +1,17 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; +using Android.Views; +using Android.Widget; + +namespace UnoPlatform_v5.Droid +{ + [Activity( + MainLauncher = true, + ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges, + WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden + )] + public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity + { + } +} \ No newline at end of file diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/Resources/AboutResources.txt b/samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/Resources/AboutResources.txt similarity index 100% rename from samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/Resources/AboutResources.txt rename to samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/Resources/AboutResources.txt diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/Resources/values/Strings.xml b/samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/Resources/values/Strings.xml similarity index 66% rename from samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/Resources/values/Strings.xml rename to samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/Resources/values/Strings.xml index 302d078a6..36c75f54d 100644 --- a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/Resources/values/Strings.xml +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/Resources/values/Strings.xml @@ -1,5 +1,5 @@ Hello World, Click Me! - UnoPlatformSample + UnoPlatform_v5 diff --git a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/Resources/values/Styles.xml b/samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/Resources/values/Styles.xml similarity index 93% rename from samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/Resources/values/Styles.xml rename to samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/Resources/values/Styles.xml index 7e1f95c8d..c02bd06f7 100644 --- a/samples/UnoPlatformSample/UnoPlatformSample.Mobile/Android/Resources/values/Styles.xml +++ b/samples/UnoPlatform_v5/UnoPlatform_v5.Mobile/Android/Resources/values/Styles.xml @@ -1,6 +1,6 @@ - + + + + + + + diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/MainPage.xaml.cs b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/MainPage.xaml.cs new file mode 100644 index 000000000..d27fdf24e --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/MainPage.xaml.cs @@ -0,0 +1,43 @@ +using Microsoft.UI.Xaml.Controls; + +namespace UnoPlatform_v5.Presentation +{ + public sealed partial class MainPage : Page + { + private bool _isMenuOpen = false; + + public MainPage() + { + this.InitializeComponent(); + + Samples = ViewModelsSamples.Index.Samples; + grid.DataContext = this; + + LoadSample("Design/LinearGradients"); + + } + + public string[] Samples { get; set; } + + private void LoadSample(string route) + { + route = route.Replace('/', '.'); + var t = Type.GetType($"UnoWinUISample.{route}.View") ?? throw new FileNotFoundException($"{route} not found!"); + content.Content = Activator.CreateInstance(t); + } + + private void Button_Click(object sender, RoutedEventArgs e) + { + grid.ColumnDefinitions[0].Width = _isMenuOpen ? new GridLength(0) : new GridLength(250); + _isMenuOpen = !_isMenuOpen; + } + + private void Button_Click_1(object sender, RoutedEventArgs e) + { + grid.ColumnDefinitions[0].Width = new GridLength(0); + + var ctx = (string)((FrameworkElement)sender).DataContext; + LoadSample(ctx); + } + } +} diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/SecondModel.cs b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/SecondModel.cs new file mode 100644 index 000000000..f050aa475 --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/SecondModel.cs @@ -0,0 +1,6 @@ +namespace UnoPlatform_v5.Presentation +{ + public partial record SecondModel(Entity Entity) + { + } +} \ No newline at end of file diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/SecondPage.xaml b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/SecondPage.xaml new file mode 100644 index 000000000..f9d2785bb --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/SecondPage.xaml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/SecondPage.xaml.cs b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/SecondPage.xaml.cs new file mode 100644 index 000000000..27a772d2e --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/SecondPage.xaml.cs @@ -0,0 +1,10 @@ +namespace UnoPlatform_v5.Presentation +{ + public sealed partial class SecondPage : Page + { + public SecondPage() + { + this.InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/Shell.xaml b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/Shell.xaml new file mode 100644 index 000000000..4be2a5b37 --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/Shell.xaml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/Shell.xaml.cs b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/Shell.xaml.cs new file mode 100644 index 000000000..17b23eabc --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/Shell.xaml.cs @@ -0,0 +1,11 @@ +namespace UnoPlatform_v5.Presentation +{ + public sealed partial class Shell : UserControl, IContentControlProvider + { + public Shell() + { + this.InitializeComponent(); + } + public ContentControl ContentControl => Splash; + } +} \ No newline at end of file diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/ShellModel.cs b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/ShellModel.cs new file mode 100644 index 000000000..68e014761 --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Presentation/ShellModel.cs @@ -0,0 +1,19 @@ +namespace UnoPlatform_v5.Presentation +{ + public class ShellModel + { + private readonly INavigator _navigator; + + public ShellModel( + INavigator navigator) + { + _navigator = navigator; + _ = Start(); + } + + public async Task Start() + { + await _navigator.NavigateViewModelAsync(this); + } + } +} \ No newline at end of file diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/Services/Caching/IWeatherCache.cs b/samples/UnoPlatform_v5/UnoPlatform_v5/Services/Caching/IWeatherCache.cs new file mode 100644 index 000000000..af4706223 --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Services/Caching/IWeatherCache.cs @@ -0,0 +1,7 @@ +namespace UnoPlatform_v5.Services.Caching +{ + public interface IWeatherCache + { + ValueTask> GetForecast(CancellationToken token); + } +} \ No newline at end of file diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/Services/Caching/WeatherCache.cs b/samples/UnoPlatform_v5/UnoPlatform_v5/Services/Caching/WeatherCache.cs new file mode 100644 index 000000000..1f77033c8 --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Services/Caching/WeatherCache.cs @@ -0,0 +1,76 @@ +namespace UnoPlatform_v5.Services.Caching +{ + public sealed class WeatherCache : IWeatherCache + { + private readonly IApiClient _api; + private readonly ISerializer _serializer; + private readonly ILogger _logger; + + public WeatherCache(IApiClient api, ISerializer serializer, ILogger logger) + { + _api = api; + _serializer = serializer; + _logger = logger; + } + + private bool IsConnected => NetworkInformation.GetInternetConnectionProfile().GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess; + + public async ValueTask> GetForecast(CancellationToken token) + { + var weatherText = await GetCachedWeather(); + if (!string.IsNullOrWhiteSpace(weatherText)) + { + return _serializer.FromString>(weatherText); + } + + if (!IsConnected) + { + _logger.LogWarning("App is offline and cannot connect to the API."); + throw new Exception("No internet connection"); + } + + var response = await _api.GetWeather(token); + + if (response.IsSuccessStatusCode && response.Content is not null) + { + var weather = response.Content; + await Save(weather, token); + return weather; + } + else if (response.Error is not null) + { + _logger.LogError(response.Error, "An error occurred while retrieving the latest Forecast."); + throw response.Error; + } + else + { + return ImmutableArray.Empty; + } + } + + private async ValueTask GetFile(CreationCollisionOption option) => + await ApplicationData.Current.TemporaryFolder.CreateFileAsync("weather.json", option); + + private async ValueTask GetCachedWeather() + { + var file = await GetFile(CreationCollisionOption.OpenIfExists); + var properties = await file.GetBasicPropertiesAsync(); + + // Reuse latest cache file if offline + // or if the file is less than 5 minutes old + if (IsConnected || DateTimeOffset.Now.AddMinutes(-5) > properties.DateModified) + { + return null; + } + + return await File.ReadAllTextAsync(file.Path); + } + + private async ValueTask Save(IImmutableList weather, CancellationToken token) + { + var weatherText = _serializer.ToString(weather); + var file = await GetFile(CreationCollisionOption.ReplaceExisting); + await File.WriteAllTextAsync(file.Path, weatherText); + } + } +} \ No newline at end of file diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/Services/Endpoints/IApiClient.cs b/samples/UnoPlatform_v5/UnoPlatform_v5/Services/Endpoints/IApiClient.cs new file mode 100644 index 000000000..75bf13f8f --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Services/Endpoints/IApiClient.cs @@ -0,0 +1,11 @@ +using Refit; + +namespace UnoPlatform_v5.Services.Endpoints +{ + [Headers("Content-Type: application/json")] + public interface IApiClient + { + [Get("/api/weatherforecast")] + Task>> GetWeather(CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Strings/en/Resources.resw b/samples/UnoPlatform_v5/UnoPlatform_v5/Strings/en/Resources.resw similarity index 99% rename from samples/UnoPlatformSample/UnoPlatformSample/Strings/en/Resources.resw rename to samples/UnoPlatform_v5/UnoPlatform_v5/Strings/en/Resources.resw index e54534102..95c06a5e5 100644 --- a/samples/UnoPlatformSample/UnoPlatformSample/Strings/en/Resources.resw +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Strings/en/Resources.resw @@ -118,6 +118,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - UnoPlatformSample-en + UnoPlatform_v5-en diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Strings/es/Resources.resw b/samples/UnoPlatform_v5/UnoPlatform_v5/Strings/es/Resources.resw similarity index 99% rename from samples/UnoPlatformSample/UnoPlatformSample/Strings/es/Resources.resw rename to samples/UnoPlatform_v5/UnoPlatform_v5/Strings/es/Resources.resw index 98c09cd2d..12c100553 100644 --- a/samples/UnoPlatformSample/UnoPlatformSample/Strings/es/Resources.resw +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Strings/es/Resources.resw @@ -118,6 +118,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - UnoPlatformSample-es + UnoPlatform_v5-es diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Strings/fr/Resources.resw b/samples/UnoPlatform_v5/UnoPlatform_v5/Strings/fr/Resources.resw similarity index 99% rename from samples/UnoPlatformSample/UnoPlatformSample/Strings/fr/Resources.resw rename to samples/UnoPlatform_v5/UnoPlatform_v5/Strings/fr/Resources.resw index 9d7f9b16b..7be2598e6 100644 --- a/samples/UnoPlatformSample/UnoPlatformSample/Strings/fr/Resources.resw +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Strings/fr/Resources.resw @@ -118,6 +118,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - UnoPlatformSample-fr + UnoPlatform_v5-fr diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Strings/pt-BR/Resources.resw b/samples/UnoPlatform_v5/UnoPlatform_v5/Strings/pt-BR/Resources.resw similarity index 99% rename from samples/UnoPlatformSample/UnoPlatformSample/Strings/pt-BR/Resources.resw rename to samples/UnoPlatform_v5/UnoPlatform_v5/Strings/pt-BR/Resources.resw index e1ce2edb1..7a610b4f3 100644 --- a/samples/UnoPlatformSample/UnoPlatformSample/Strings/pt-BR/Resources.resw +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Strings/pt-BR/Resources.resw @@ -118,6 +118,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - UnoPlatformSample-pt-BR + UnoPlatform_v5-pt-BR diff --git a/samples/UnoPlatformSample/UnoPlatformSample/Styles/ColorPaletteOverride.xaml b/samples/UnoPlatform_v5/UnoPlatform_v5/Styles/ColorPaletteOverride.xaml similarity index 89% rename from samples/UnoPlatformSample/UnoPlatformSample/Styles/ColorPaletteOverride.xaml rename to samples/UnoPlatform_v5/UnoPlatform_v5/Styles/ColorPaletteOverride.xaml index 2710b2912..c971b5443 100644 --- a/samples/UnoPlatformSample/UnoPlatformSample/Styles/ColorPaletteOverride.xaml +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Styles/ColorPaletteOverride.xaml @@ -9,7 +9,7 @@ #6B4EA2 #FFFFFF #EBDDFF - #1F182B + #220555 #0061A4 #FFFFFF #CFE4FF @@ -22,7 +22,7 @@ #1C1B1F #FFFFFF #1C1B1F - #F3EFF5 + #F2EFF5 #8B8494 #79747E #F4EFF4 @@ -39,10 +39,10 @@ #CDC2DC #332D41 #433C52 - #EBDDFF + #EDDFFF #9FCAFF #003258 - #00497E + #00497D #D1E4FF #FFB4AB #93000A @@ -50,7 +50,7 @@ #FFDAD6 #1C1B1F #E5E1E6 - #302D38 + #302D37 #E6E1E5 #47464F #C9C5D0 @@ -58,7 +58,7 @@ #1C1B1F #E6E1E5 #2A009F - #544794 + #C7BFFF #57545D diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/Styles/ColorPaletteOverride.zip b/samples/UnoPlatform_v5/UnoPlatform_v5/Styles/ColorPaletteOverride.zip new file mode 100644 index 000000000..fab69ba0b Binary files /dev/null and b/samples/UnoPlatform_v5/UnoPlatform_v5/Styles/ColorPaletteOverride.zip differ diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/Styles/MaterialFontsOverride.xaml b/samples/UnoPlatform_v5/UnoPlatform_v5/Styles/MaterialFontsOverride.xaml new file mode 100644 index 000000000..0564fd795 --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/Styles/MaterialFontsOverride.xaml @@ -0,0 +1,8 @@ + + + ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf#Roboto + ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf#Roboto + ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf#Roboto + + diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/UnoPlatform_v5.csproj b/samples/UnoPlatform_v5/UnoPlatform_v5/UnoPlatform_v5.csproj new file mode 100644 index 000000000..046c470e3 --- /dev/null +++ b/samples/UnoPlatform_v5/UnoPlatform_v5/UnoPlatform_v5.csproj @@ -0,0 +1,84 @@ + + + $(TargetFrameworks);net7.0-windows10.0.19041 + $(TargetFrameworks);net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst + $(OverrideTargetFrameworks) + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %(Filename) + + + + + + + + + + + + + + + + + + + + diff --git a/samples/UnoPlatformSample/UnoPlatformSample/appsettings.development.json b/samples/UnoPlatform_v5/UnoPlatform_v5/appsettings.development.json similarity index 100% rename from samples/UnoPlatformSample/UnoPlatformSample/appsettings.development.json rename to samples/UnoPlatform_v5/UnoPlatform_v5/appsettings.development.json diff --git a/samples/UnoPlatformSample/UnoPlatformSample/appsettings.json b/samples/UnoPlatform_v5/UnoPlatform_v5/appsettings.json similarity index 100% rename from samples/UnoPlatformSample/UnoPlatformSample/appsettings.json rename to samples/UnoPlatform_v5/UnoPlatform_v5/appsettings.json diff --git a/samples/UnoPlatform_v5/solution-config.props.sample b/samples/UnoPlatform_v5/solution-config.props.sample new file mode 100644 index 000000000..48f0a3ccf --- /dev/null +++ b/samples/UnoPlatform_v5/solution-config.props.sample @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + diff --git a/samples/ViewModelsSamples/Axes/Logarithmic/ViewModel.cs b/samples/ViewModelsSamples/Axes/Logarithmic/ViewModel.cs index f389a9c60..5a6c2c3a8 100644 --- a/samples/ViewModelsSamples/Axes/Logarithmic/ViewModel.cs +++ b/samples/ViewModelsSamples/Axes/Logarithmic/ViewModel.cs @@ -17,12 +17,9 @@ public partial class ViewModel : ObservableObject { new LineSeries { - Mapping = (logPoint, chartPoint) => - { - // for the x coordinate, we use the X property - // and for the Y coordinate, we will map it to the logarithm of the value - chartPoint.Coordinate = new(logPoint.X, Math.Log(logPoint.Y, s_logBase)); - }, + // for the x coordinate, we use the X property + // and for the Y coordinate, we will map it to the logarithm of the value + Mapping = (logPoint, index) => new(logPoint.X, Math.Log(logPoint.Y, s_logBase)), Values = new LogarithmicPoint[] { new() { X = 1, Y = 1 }, diff --git a/samples/ViewModelsSamples/Bars/Basic/ViewModel.cs b/samples/ViewModelsSamples/Bars/Basic/ViewModel.cs index 49c263d75..693cab2d1 100644 --- a/samples/ViewModelsSamples/Bars/Basic/ViewModel.cs +++ b/samples/ViewModelsSamples/Bars/Basic/ViewModel.cs @@ -34,7 +34,7 @@ public partial class ViewModel : ObservableObject TicksAtCenter = true, // By default the axis tries to optimize the number of // mark // labels to fit the available space, // mark - // when you neeed to force the axis to show all the labels then you must: // mark + // when you need to force the axis to show all the labels then you must: // mark ForceStepToMin = true, // mark MinStep = 1 // mark } diff --git a/samples/ViewModelsSamples/Events/Cartesian/ViewModel.cs b/samples/ViewModelsSamples/Events/Cartesian/ViewModel.cs index 497f7205b..ee7cc462d 100644 --- a/samples/ViewModelsSamples/Events/Cartesian/ViewModel.cs +++ b/samples/ViewModelsSamples/Events/Cartesian/ViewModel.cs @@ -32,12 +32,9 @@ public ViewModel() DataLabelsPaint = new SolidColorPaint(new SKColor(30, 30, 30)), DataLabelsFormatter = point => $"{point.Model?.SalesPerDay} {point.Model?.Name}", DataLabelsPosition = DataLabelsPosition.End, - Mapping = (fruit, point) => - { - // use the SalesPerDay property in this in the Y axis // mark - // and the index of the fruit in the array in the X axis // mark - point.Coordinate = new(point.Index, fruit.SalesPerDay); - } + // use the SalesPerDay property in this in the Y axis // mark + // and the index of the fruit in the array in the X axis // mark + Mapping = (fruit, index) => new(index, fruit.SalesPerDay) }; // notice that the event signature is different for every series diff --git a/samples/ViewModelsSamples/Events/Pie/ViewModel.cs b/samples/ViewModelsSamples/Events/Pie/ViewModel.cs index 738b5fef1..af8f51642 100644 --- a/samples/ViewModelsSamples/Events/Pie/ViewModel.cs +++ b/samples/ViewModelsSamples/Events/Pie/ViewModel.cs @@ -32,12 +32,9 @@ public ViewModel() (city, series) => { series.Name = city.Name; - series.Mapping = (cityMapper, point) => - { - // use the population property in the Y axis // mark - // and the index of the city in the array in the X axis // mark - point.Coordinate = new(point.Index, cityMapper.Population); - }; + // use the population property in the Y axis // mark + // and the index of the city in the array in the X axis // mark + series.Mapping = (cityMapper, index) => new(index, cityMapper.Population); series.DataPointerDown += Series_DataPointerDown; }); diff --git a/samples/ViewModelsSamples/Events/Polar/ViewModel.cs b/samples/ViewModelsSamples/Events/Polar/ViewModel.cs index 5aa8a2745..8e7a2a4b3 100644 --- a/samples/ViewModelsSamples/Events/Polar/ViewModel.cs +++ b/samples/ViewModelsSamples/Events/Polar/ViewModel.cs @@ -26,12 +26,9 @@ public ViewModel() { Values = data, RadiusToolTipLabelFormatter = point => $"{point.Model?.Name} {point.Model?.Population} Million", - Mapping = (city, point) => - { - // use the Popuplation property in the Y axis - // and the index of the city in the array as the X axis - point.Coordinate = new(point.Index, city.Population); - } + // use the Population property in the Y axis + // and the index of the city in the array as the X axis + Mapping = (city, index) => new(index, city.Population) }; Series = new ISeries[] diff --git a/samples/ViewModelsSamples/General/DrawOnCanvas/ViewModel.cs b/samples/ViewModelsSamples/General/DrawOnCanvas/ViewModel.cs new file mode 100644 index 000000000..a0803ee30 --- /dev/null +++ b/samples/ViewModelsSamples/General/DrawOnCanvas/ViewModel.cs @@ -0,0 +1,105 @@ +using System; +using CommunityToolkit.Mvvm.Input; +using LiveChartsCore; +using LiveChartsCore.Drawing; +using LiveChartsCore.Kernel; +using LiveChartsCore.Kernel.Events; +using LiveChartsCore.Kernel.Sketches; +using LiveChartsCore.Motion; +using LiveChartsCore.SkiaSharpView.Drawing; +using LiveChartsCore.SkiaSharpView.Drawing.Geometries; +using LiveChartsCore.SkiaSharpView.Painting; +using SkiaSharp; + +namespace ViewModelsSamples.General.DrawOnCanvas; + +public partial class ViewModel +{ + private SolidColorPaint? _paint; + private SimpleGeometry? _simpleGeometry; + private MotionGeometry? _motionGeometry; + + [RelayCommand] + public void ChartUpdated(ChartCommandArgs args) + { + var chartView = (ICartesianChartView)args.Chart; + + var isNewGeometry = _simpleGeometry is null; + + _simpleGeometry ??= new SimpleGeometry(); + if (_motionGeometry is null) + { + _motionGeometry = new MotionGeometry(); + _motionGeometry.Animate( + new(EasingFunctions.BounceOut, TimeSpan.FromMilliseconds(800))); + } + + if (_paint is null) + { + _paint = new SolidColorPaint(SKColors.Blue) { IsStroke = true, StrokeThickness = 2 }; + _paint.AddGeometryToPaintTask(chartView.CoreCanvas, _simpleGeometry); + _paint.AddGeometryToPaintTask(chartView.CoreCanvas, _motionGeometry); + chartView.CoreCanvas.AddDrawableTask(_paint); + } + + // lets convert the point (5, 5) in the chart values scale to pixels + var locationInChartValues = new LvcPointD(5, 5); + var locationInPixels = chartView.ScaleDataToPixels(locationInChartValues); + + _motionGeometry.X = (float)locationInPixels.X; + _motionGeometry.Y = (float)locationInPixels.Y; + _motionGeometry.Diameter = 70; + + // if this is the first time we draw the geometry + // we can complete the animations. + // if (isNewGeometry) _motionGeometry.CompleteTransition(); + } +} + +public class SimpleGeometry : Geometry +{ + public override void OnDraw(SkiaSharpDrawingContext context, SKPaint paint) + { + // we can use SkiaSharp here to draw anything we want + var skCanvas = context.Canvas; + skCanvas.DrawCircle(200, 200, 50, paint); + } + + protected override LvcSize OnMeasure(IPaint paintTasks) + { + // you can measure the geometry here, this method is used when the geometry + // is used inside a layout, in this case it is not necessary. + return new(); + } +} + +public class MotionGeometry : Geometry +{ + // you can use Motion properties to animate the geometry + private readonly FloatMotionProperty _diameter; + + public MotionGeometry() + { + _diameter = RegisterMotionProperty(new FloatMotionProperty(nameof(Diameter), 0)); + } + + public float Diameter + { + get => _diameter.GetMovement(this); + set => _diameter.SetMovement(value, this); + } + + public override void OnDraw(SkiaSharpDrawingContext context, SKPaint paint) + { + // because we inherited from Geometry, this class already contains the X, Y + // and some other motion properties that we can use. + + context.Canvas.DrawCircle(X, Y, Diameter, paint); + } + + protected override LvcSize OnMeasure(IPaint paintTasks) + { + return new(); + } +} + diff --git a/samples/ViewModelsSamples/General/UserDefinedTypes/ViewModel.cs b/samples/ViewModelsSamples/General/UserDefinedTypes/ViewModel.cs index c7b248b7a..895c39849 100644 --- a/samples/ViewModelsSamples/General/UserDefinedTypes/ViewModel.cs +++ b/samples/ViewModelsSamples/General/UserDefinedTypes/ViewModel.cs @@ -11,12 +11,9 @@ public partial class ViewModel : ObservableObject new LineSeries { Name = "Population", - Mapping = (city, point) => - { - // use the Population property as the Y coordinate - // and the index of the city in our collection as the X coordinate - point.Coordinate = new(point.Index, city.Population); - }, + // use the Population property as the Y coordinate + // and the index of the city in our collection as the X coordinate + Mapping = (city, index) => new(index, city.Population), Values = new[] { new City { Name = "Tokyo", Population = 4 }, diff --git a/samples/ViewModelsSamples/Index.cs b/samples/ViewModelsSamples/Index.cs index 1c11e98aa..a969557ee 100644 --- a/samples/ViewModelsSamples/Index.cs +++ b/samples/ViewModelsSamples/Index.cs @@ -112,6 +112,7 @@ public static class Index "General/NullPoints", "General/MultiThreading", "General/MultiThreading2", + "General/DrawOnCanvas", "VisualTest/TwoChartsOneSeries", "VisualTest/ReattachVisual", diff --git a/samples/WPFSample/App.xaml.cs b/samples/WPFSample/App.xaml.cs index c8897419c..2fe80f2a9 100644 --- a/samples/WPFSample/App.xaml.cs +++ b/samples/WPFSample/App.xaml.cs @@ -16,8 +16,8 @@ protected override void OnStartup(StartupEventArgs e) LiveCharts.Configure(config => // mark config // mark - // you can override the theme - // .AddDarkTheme() // mark + // you can override the theme + // .AddDarkTheme() // mark // In case you need a non-Latin based font, you must register a typeface for SkiaSharp //.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark @@ -31,11 +31,9 @@ protected override void OnStartup(StartupEventArgs e) // finally register your own mappers // you can learn more about mappers at: // https://livecharts.dev/docs/{{ platform }}/{{ version }}/Overview.Mappers - .HasMap((city, point) => // mark - { // mark - // here we use the index as X, and the population as Y // mark - point.Coordinate = new(point.Index, city.Population); // mark - }) // mark + + // here we use the index as X, and the population as Y // mark + .HasMap((city, index) => new(index, city.Population)) // mark // .HasMap( .... ) // mark // .HasMap( .... ) // mark ); // mark diff --git a/samples/WPFSample/General/DrawOnCanvas/View.xaml b/samples/WPFSample/General/DrawOnCanvas/View.xaml new file mode 100644 index 000000000..858602660 --- /dev/null +++ b/samples/WPFSample/General/DrawOnCanvas/View.xaml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/samples/WPFSample/General/DrawOnCanvas/View.xaml.cs b/samples/WPFSample/General/DrawOnCanvas/View.xaml.cs new file mode 100644 index 000000000..d69fcbe1a --- /dev/null +++ b/samples/WPFSample/General/DrawOnCanvas/View.xaml.cs @@ -0,0 +1,14 @@ +using System.Windows.Controls; + +namespace WPFSample.General.DrawOnCanvas; + +/// +/// Interaction logic for View.xaml +/// +public partial class View : UserControl +{ + public View() + { + InitializeComponent(); + } +} diff --git a/samples/WPFSample/Lines/Basic/View.xaml b/samples/WPFSample/Lines/Basic/View.xaml index 3984ab23a..7087e8124 100644 --- a/samples/WPFSample/Lines/Basic/View.xaml +++ b/samples/WPFSample/Lines/Basic/View.xaml @@ -6,5 +6,5 @@ - + diff --git a/samples/WinFormsSample/General/DrawOnCanvas/View.Designer.cs b/samples/WinFormsSample/General/DrawOnCanvas/View.Designer.cs new file mode 100644 index 000000000..b3e35ce41 --- /dev/null +++ b/samples/WinFormsSample/General/DrawOnCanvas/View.Designer.cs @@ -0,0 +1,46 @@ + +namespace WinFormsSample.General.DrawOnCanvas +{ + partial class View + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // View + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Name = "View"; + this.Size = new System.Drawing.Size(427, 375); + this.ResumeLayout(false); + + } + + #endregion + } +} diff --git a/samples/WinFormsSample/General/DrawOnCanvas/View.cs b/samples/WinFormsSample/General/DrawOnCanvas/View.cs new file mode 100644 index 000000000..a2fc7069c --- /dev/null +++ b/samples/WinFormsSample/General/DrawOnCanvas/View.cs @@ -0,0 +1,33 @@ +using System.Windows.Forms; +using LiveChartsCore.SkiaSharpView.WinForms; +using ViewModelsSamples.General.DrawOnCanvas; + +namespace WinFormsSample.General.DrawOnCanvas; + +public partial class View : UserControl +{ + private readonly CartesianChart cartesianChart; + + public View() + { + InitializeComponent(); + Size = new System.Drawing.Size(50, 50); + + var viewModel = new ViewModel(); + + cartesianChart = new CartesianChart + { + // out of livecharts properties... + Location = new System.Drawing.Point(0, 0), + Size = new System.Drawing.Size(50, 50), + Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom + }; + + cartesianChart.UpdateStarted += chart => + { + viewModel.ChartUpdated(new(chart)); + }; + + Controls.Add(cartesianChart); + } +} diff --git a/samples/WinFormsSample/General/DrawOnCanvas/View.resx b/samples/WinFormsSample/General/DrawOnCanvas/View.resx new file mode 100644 index 000000000..f298a7be8 --- /dev/null +++ b/samples/WinFormsSample/General/DrawOnCanvas/View.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/samples/WinFormsSample/Program.cs b/samples/WinFormsSample/Program.cs index 34edf0dc2..f170eec16 100644 --- a/samples/WinFormsSample/Program.cs +++ b/samples/WinFormsSample/Program.cs @@ -31,13 +31,11 @@ static void Main() // finally register your own mappers // you can learn more about mappers at: // https://livecharts.dev/docs/{{ platform }}/{{ version }}/Overview.Mappers - .HasMap((city, point) => // mark - { // mark - // here we use the index as X, and the population as Y // mark - point.Coordinate = new(point.Index, city.Population); // mark - }) // mark - // .HasMap( .... ) // mark - // .HasMap( .... ) // mark + + // here we use the index as X, and the population as Y // mark + .HasMap((city, index) => new(index, city.Population)) // mark + // .HasMap( .... ) // mark + // .HasMap( .... ) // mark ); // mark _ = Application.SetHighDpiMode(HighDpiMode.SystemAware); diff --git a/samples/WinUISample/WinUISample/App.xaml.cs b/samples/WinUISample/WinUISample/App.xaml.cs index d0b037177..3011bfb9b 100644 --- a/samples/WinUISample/WinUISample/App.xaml.cs +++ b/samples/WinUISample/WinUISample/App.xaml.cs @@ -48,13 +48,11 @@ protected override void OnLaunched(LaunchActivatedEventArgs args) // finally register your own mappers // you can learn more about mappers at: // https://livecharts.dev/docs/{{ platform }}/{{ version }}/Overview.Mappers - .HasMap((city, point) => // mark - { // mark - // here we use the index as X, and the population as Y // mark - point.Coordinate = new(point.Index, city.Population); // mark - }) // mark - // .HasMap( .... ) // mark - // .HasMap( .... ) // mark + + // here we use the index as X, and the population as Y // mark + .HasMap((city, index) => new(index, city.Population)) // mark + // .HasMap( .... ) // mark + // .HasMap( .... ) // mark ); // mark } diff --git a/samples/WinUISample/WinUISample/General/DrawOnCanvas/View.xaml b/samples/WinUISample/WinUISample/General/DrawOnCanvas/View.xaml new file mode 100644 index 000000000..5a32e4389 --- /dev/null +++ b/samples/WinUISample/WinUISample/General/DrawOnCanvas/View.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + diff --git a/samples/WinUISample/WinUISample/General/DrawOnCanvas/View.xaml.cs b/samples/WinUISample/WinUISample/General/DrawOnCanvas/View.xaml.cs new file mode 100644 index 000000000..b83cbaf30 --- /dev/null +++ b/samples/WinUISample/WinUISample/General/DrawOnCanvas/View.xaml.cs @@ -0,0 +1,17 @@ +using LiveChartsCore.Drawing; +using LiveChartsCore.SkiaSharpView.Drawing; +using LiveChartsCore.SkiaSharpView.Drawing.Geometries; +using LiveChartsCore.SkiaSharpView.Painting; +using LiveChartsCore.SkiaSharpView.WinUI; +using Microsoft.UI.Xaml.Controls; +using SkiaSharp; + +namespace WinUISample.General.DrawOnCanvas; + +public sealed partial class View : UserControl +{ + public View() + { + InitializeComponent(); + } +} diff --git a/samples/WinUISample/WinUISample/WinUISample.csproj b/samples/WinUISample/WinUISample/WinUISample.csproj index 8d70466f1..25029a47c 100644 --- a/samples/WinUISample/WinUISample/WinUISample.csproj +++ b/samples/WinUISample/WinUISample/WinUISample.csproj @@ -23,8 +23,8 @@ - - + + diff --git a/samples/XamarinSample/XamarinSample/XamarinSample/App.xaml.cs b/samples/XamarinSample/XamarinSample/XamarinSample/App.xaml.cs index 72238109b..fe2552e50 100644 --- a/samples/XamarinSample/XamarinSample/XamarinSample/App.xaml.cs +++ b/samples/XamarinSample/XamarinSample/XamarinSample/App.xaml.cs @@ -35,11 +35,9 @@ protected override void OnStart() // finally register your own mappers // you can learn more about mappers at: // https://livecharts.dev/docs/{{ platform }}/{{ version }}/Overview.Mappers - //.HasMap((city, point) => // mark - //{ // mark - // // here we use the index as X, and the population as Y // mark - //point.Coordinate = new(point.Index, city.Population); // mark - //}) // mark + + // here we use the index as X, and the population as Y // mark + //.HasMap((city, index) => new(index, city.Population) // mark // .HasMap( .... ) // mark // .HasMap( .... ) // mark ); // mark diff --git a/samples/XamarinSample/XamarinSample/XamarinSample/General/DrawOnCanvas/View.xaml b/samples/XamarinSample/XamarinSample/XamarinSample/General/DrawOnCanvas/View.xaml new file mode 100644 index 000000000..74c817713 --- /dev/null +++ b/samples/XamarinSample/XamarinSample/XamarinSample/General/DrawOnCanvas/View.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/samples/XamarinSample/XamarinSample/XamarinSample/General/DrawOnCanvas/View.xaml.cs b/samples/XamarinSample/XamarinSample/XamarinSample/General/DrawOnCanvas/View.xaml.cs new file mode 100644 index 000000000..e60e30408 --- /dev/null +++ b/samples/XamarinSample/XamarinSample/XamarinSample/General/DrawOnCanvas/View.xaml.cs @@ -0,0 +1,13 @@ +using Xamarin.Forms; +using Xamarin.Forms.Xaml; + +namespace XamarinSample.General.DrawOnCanvas; + +[XamlCompilation(XamlCompilationOptions.Compile)] +public partial class View : ContentPage +{ + public View() + { + InitializeComponent(); + } +} diff --git a/src/LiveChartsCore.Behaviours/AssemblyInfo.cs b/src/LiveChartsCore.Behaviours/AssemblyInfo.cs index 77fde877e..b803594ea 100644 --- a/src/LiveChartsCore.Behaviours/AssemblyInfo.cs +++ b/src/LiveChartsCore.Behaviours/AssemblyInfo.cs @@ -22,5 +22,12 @@ #if !DEBUG using System.Reflection; +using System.Runtime.CompilerServices; + [assembly: AssemblyKeyFile("./../../LiveCharts.snk")] +[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Uno.WinUI, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")] +#else +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Uno.WinUI")] #endif diff --git a/src/LiveChartsCore.Behaviours/ChartBehaviour.Android.cs b/src/LiveChartsCore.Behaviours/ChartBehaviour.Android.cs index c025d3e87..f13a43fe0 100644 --- a/src/LiveChartsCore.Behaviours/ChartBehaviour.Android.cs +++ b/src/LiveChartsCore.Behaviours/ChartBehaviour.Android.cs @@ -36,6 +36,7 @@ public abstract partial class ChartBehaviour private bool _isPinching; private bool _isDown; private LvcPoint _lastTouch; + private LvcPoint _touchStart; private ScaleGestureDetector? _scaleDetector; private CustomScaleListener _customScaleListener = null!; private DateTime _previousPress = DateTime.MinValue; @@ -50,7 +51,8 @@ protected void OnAndroidHover(object? sender, View.HoverEventArgs e) protected void OnAndroidTouched(object? sender, View.TouchEventArgs e) { - if (e.Event is null) return; + var viewGroup = (ViewGroup?)sender; + if (e.Event is null || viewGroup is null) return; var p = new LvcPoint(e.Event.GetX() / Density, e.Event.GetY() / Density); var isRightClick = (DateTime.Now - _previousPress).TotalMilliseconds < 500; @@ -77,6 +79,7 @@ protected void OnAndroidTouched(object? sender, View.TouchEventArgs e) Pressed?.Invoke(sender, new(p, isRightClick, e.Event)); _previousPress = DateTime.Now; _customScaleListener.Paused = isRightClick && !isPinch; + _touchStart = p; break; case MotionEventActions.Move: case MotionEventActions.HoverMove: @@ -109,6 +112,17 @@ protected void OnAndroidTouched(object? sender, View.TouchEventArgs e) } _lastTouch = p; + + var yTolerance = 0.20 * viewGroup.Height / Density; + var screenTolerance = 0.25 * ScreenSize.Height / Density; + if (screenTolerance < yTolerance) yTolerance = screenTolerance; + + var yMovement = Math.Abs(p.Y - _touchStart.Y); + var isChartInteraction = yMovement < yTolerance; + + // workaround for https://github.com/dotnet/maui/issues/18547 + // intercept events while the vertical movement is less than the threshold + viewGroup.RequestDisallowInterceptTouchEvent(isChartInteraction); } private class CustomScaleListener : ScaleGestureDetector.SimpleOnScaleGestureListener diff --git a/src/LiveChartsCore.Behaviours/ChartBehaviour.MacCatalyst.cs b/src/LiveChartsCore.Behaviours/ChartBehaviour.MacCatalyst.cs index c60ed9e95..f25772112 100644 --- a/src/LiveChartsCore.Behaviours/ChartBehaviour.MacCatalyst.cs +++ b/src/LiveChartsCore.Behaviours/ChartBehaviour.MacCatalyst.cs @@ -142,7 +142,8 @@ protected UIPanGestureRecognizer GetMacCatalystOnPan(UIView view) }) { AllowedScrollTypesMask = UIScrollTypeMask.Discrete | UIScrollTypeMask.Continuous, - MinimumNumberOfTouches = 0 + MinimumNumberOfTouches = 0, + ShouldRecognizeSimultaneously = (g1, g2) => true }; } } diff --git a/src/LiveChartsCore.Behaviours/ChartBehaviour._shared.cs b/src/LiveChartsCore.Behaviours/ChartBehaviour._shared.cs index fb854e50d..af71c57a6 100644 --- a/src/LiveChartsCore.Behaviours/ChartBehaviour._shared.cs +++ b/src/LiveChartsCore.Behaviours/ChartBehaviour._shared.cs @@ -21,6 +21,7 @@ // SOFTWARE. using LiveChartsCore.Behaviours.Events; +using LiveChartsCore.Drawing; namespace LiveChartsCore.Behaviours; @@ -29,6 +30,12 @@ namespace LiveChartsCore.Behaviours; /// public abstract partial class ChartBehaviour { + /// + /// Gets or sets the screen size, only used internally by the Android handler, to implement a + /// workaround for https://github.com/dotnet/maui/issues/18547. + /// + public LvcSize ScreenSize { get; set; } + /// /// Gets or sets the screen density. /// @@ -63,4 +70,34 @@ public abstract partial class ChartBehaviour /// Called when the control is scrolled. /// public event ScrollHandler? Scrolled; + + internal void InvokePressed(object sender, PressedEventArgs e) + { + Pressed?.Invoke(sender, e); + } + + internal void InvokeReleased(object sender, PressedEventArgs e) + { + Released?.Invoke(sender, e); + } + + internal void InvokeMoved(object sender, ScreenEventArgs e) + { + Moved?.Invoke(sender, e); + } + + internal void InvokeExited(object sender, EventArgs e) + { + Exited?.Invoke(sender, e); + } + + internal void InvokePinched(object sender, PinchEventArgs e) + { + Pinched?.Invoke(sender, e); + } + + internal void InvokeScrolled(object sender, ScrollEventArgs e) + { + Scrolled?.Invoke(sender, e); + } } diff --git a/src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.csproj b/src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.csproj index 4eb94eac8..fd2ecf215 100644 --- a/src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.csproj +++ b/src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.csproj @@ -1,8 +1,13 @@ - net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst - $(TargetFrameworks);net6.0-windows10.0.19041.0 + + net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst; + net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst + + + $(TargetFrameworks);net6.0-windows10.0.19041;net7.0-windows10.0.19041 + enable 11.0 @@ -14,7 +19,7 @@ LiveChartsCore.Behaviours LiveChartsCore.Behaviours - 2.0.0-rc1.2 + 2.0.0-rc2 icon.png Adds user interaction for touch screens, touch pads and mouse. MIT @@ -22,20 +27,16 @@ true snupkg https://github.com/beto-rodriguez/LiveCharts2 + bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml - - - - - - - - + + + diff --git a/src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.nuspec b/src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.nuspec new file mode 100644 index 000000000..1dfe911a2 --- /dev/null +++ b/src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.nuspec @@ -0,0 +1,107 @@ + + + + LiveChartsCore.Behaviours + 2.0.0-rc2 + LiveChartsCore.Behaviours + BetoRodriguez + true + MIT + https://github.com/beto-rodriguez/LiveCharts2 + + Simple, flexible, interactive and powerful data visualization, this package adds native + intereaction with touchscreens, touchpads and mouse. + + https://github.com/beto-rodriguez/LiveCharts2/releases + BetoRodriguez + livechart chart charting plot plotting data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/LiveChartsCore.Behaviours/images/icon.png b/src/LiveChartsCore.Behaviours/images/icon.png deleted file mode 100644 index d0c1c5660..000000000 Binary files a/src/LiveChartsCore.Behaviours/images/icon.png and /dev/null differ diff --git a/src/LiveChartsCore/CartesianChart.cs b/src/LiveChartsCore/CartesianChart.cs index de4581d44..94abc5d20 100644 --- a/src/LiveChartsCore/CartesianChart.cs +++ b/src/LiveChartsCore/CartesianChart.cs @@ -426,7 +426,7 @@ protected internal override void Measure() #endregion - SeriesContext = new SeriesContext(VisibleSeries, _isFirstDraw, this); + SeriesContext = new SeriesContext(VisibleSeries, this); var isNewTheme = LiveCharts.DefaultSettings.CurrentThemeId != ThemeId; // restart axes bounds and meta data @@ -542,6 +542,7 @@ protected internal override void Measure() float ts = 0f, bs = 0f, ls = 0f, rs = 0f; if (title is not null) { + title.ClippingMode = ClipMode.None; var titleSize = title.Measure(this); m.Top = titleSize.Height; ts = titleSize.Height; @@ -794,7 +795,11 @@ protected internal override void Measure() } foreach (var section in Sections) AddVisual(section); foreach (var visual in VisualElements) AddVisual(visual); - foreach (var series in VisibleSeries) AddVisual((ChartElement)series); + foreach (var series in VisibleSeries) + { + AddVisual((ChartElement)series); + _drawnSeries.Add(series.SeriesId); + } if (_previousDrawMarginFrame is not null && _chartView.DrawMarginFrame != _previousDrawMarginFrame) { diff --git a/src/LiveChartsCore/Chart.cs b/src/LiveChartsCore/Chart.cs index 76049e0f2..8f1223bd0 100644 --- a/src/LiveChartsCore/Chart.cs +++ b/src/LiveChartsCore/Chart.cs @@ -52,6 +52,8 @@ public abstract class Chart : IChart internal float _titleHeight = 0f; internal LvcSize _legendSize; internal bool _preserveFirstDraw = false; + internal readonly HashSet _drawnSeries = new(); + internal bool _isFirstDraw = true; private readonly ActionThrottler _updateThrottler; private readonly ActionThrottler _tooltipThrottler; private readonly ActionThrottler _panningThrottler; @@ -63,7 +65,6 @@ public abstract class Chart : IChart private readonly Dictionary _activePoints = new(); private LvcSize _previousSize = new(); private readonly bool _isMobile; - internal bool _isFirstDraw = true; #endregion @@ -177,7 +178,7 @@ public abstract class Chart : IChart /// /// The series context /// - public SeriesContext SeriesContext { get; protected set; } = new(Enumerable.Empty>(), true, null!); + public SeriesContext SeriesContext { get; protected set; } = new(Enumerable.Empty>(), null!); /// /// Gets the size of the control. @@ -695,6 +696,12 @@ private void CloseTooltip() _isToolTipOpen = false; Tooltip?.Hide(this); CleanHoveredPoints(new()); + + if (this is CartesianChart cartesianChart) + { + foreach (var ax in cartesianChart.XAxes) ax.ClearCrosshair(cartesianChart); + foreach (var ay in cartesianChart.YAxes) ay.ClearCrosshair(cartesianChart); + } } private void OnCanvasValidated(MotionCanvas chart) diff --git a/src/LiveChartsCore/Axis.cs b/src/LiveChartsCore/CoreAxis.cs similarity index 97% rename from src/LiveChartsCore/Axis.cs rename to src/LiveChartsCore/CoreAxis.cs index a250d1ae7..848d59fd8 100644 --- a/src/LiveChartsCore/Axis.cs +++ b/src/LiveChartsCore/CoreAxis.cs @@ -41,7 +41,7 @@ namespace LiveChartsCore; /// The type of the drawing context. /// The type of the text geometry. /// The type of the line geometry. -public abstract class Axis +public abstract class CoreAxis : ChartElement, ICartesianAxis, IPlane where TDrawingContext : DrawingContext where TTextGeometry : ILabelGeometry, new() @@ -64,6 +64,7 @@ public abstract class Axis private double _minStep = 0; private double _labelsRotation; private LvcRectangle _labelsDesiredSize = new(), _nameDesiredSize = new(); + private LvcSize? _possibleMaxLabelsSize = new(); private TTextGeometry? _nameGeometry; private AxisPosition _position = AxisPosition.Start; private Func _labeler = Labelers.Default; @@ -112,6 +113,7 @@ public abstract class Axis float ICartesianAxis.Yo { get => _yo; set => _yo = value; } LvcSize ICartesianAxis.Size { get => _size; set => _size = value; } LvcRectangle ICartesianAxis.LabelsDesiredSize { get => _labelsDesiredSize; set => _labelsDesiredSize = value; } + LvcSize ICartesianAxis.PossibleMaxLabelSize => _possibleMaxLabelsSize ?? (_possibleMaxLabelsSize = GetPossibleMaxLabelSize()).Value; LvcRectangle ICartesianAxis.NameDesiredSize { get => _nameDesiredSize; set => _nameDesiredSize = value; } /// @@ -487,7 +489,7 @@ public override void Invalidate(Chart chart) if (!_separatorsAtCenter && _orientation == AxisOrientation.X) sxco = uw * 0.5f; if (!_separatorsAtCenter && _orientation == AxisOrientation.Y) sxco = uw * 0.5f; - var axisTick = this.GetTick(drawMarginSize, null, GetPossibleMaxLabelSize(chart)); + var axisTick = this.GetTick(drawMarginSize, null); var s = axisTick.Value; if (s < _minStep) s = _minStep; if (_forceStepToMin) s = _minStep; @@ -649,6 +651,15 @@ public void InvalidateCrosshair(Chart chart, LvcPoint pointerPo { if (CrosshairPaint is null || chart is not CartesianChart cartesianChart) return; + var location = chart.DrawMarginLocation; + var size = chart.DrawMarginSize; + + if (pointerPosition.X < location.X || pointerPosition.X > location.X + size.Width || + pointerPosition.Y < location.Y || pointerPosition.Y > location.Y + size.Height) + { + return; + } + var scale = this.GetNextScaler(cartesianChart); var controlSize = cartesianChart.ControlSize; var drawLocation = cartesianChart.DrawMarginLocation; @@ -780,6 +791,16 @@ public void InvalidateCrosshair(Chart chart, LvcPoint pointerPo chart.Canvas.Invalidate(); } + /// + public void ClearCrosshair(Chart chart) + { + if (_crosshairLine is not null) + CrosshairPaint?.RemoveGeometryFromPainTask(chart.Canvas, _crosshairLine); + + if (_crosshairLabel is not null) + CrosshairLabelsPaint?.RemoveGeometryFromPainTask(chart.Canvas, _crosshairLabel); + } + private IEnumerable EnumerateSeparators(double start, double end, double step) { if (CustomSeparators is not null) @@ -926,6 +947,7 @@ void ICartesianAxis.Initialize(AxisOrientation orientation) _dataBounds = new Bounds(); _visibleDataBounds = new Bounds(); _animatableBounds ??= new(); + _possibleMaxLabelsSize = null; Initialized?.Invoke(this); } @@ -988,20 +1010,19 @@ protected override void OnPaintChanged(string? propertyName) return labeler; } - private LvcSize GetPossibleMaxLabelSize(Chart chart) + private LvcSize GetPossibleMaxLabelSize() { if (LabelsPaint is null) return new LvcSize(); var labeler = GetActualLabeler(); - var axisTick = this.GetTick(chart.DrawMarginSize); - var s = axisTick.Value; - var max = MaxLimit is null ? _visibleDataBounds.Max : MaxLimit.Value; var min = MinLimit is null ? _visibleDataBounds.Min : MinLimit.Value; AxisLimit.ValidateLimits(ref min, ref max); + const double testSeparators = 25; + var s = (max - min) / testSeparators; if (s == 0) s = 1; if (s < _minStep) s = _minStep; if (_forceStepToMin) s = _minStep; @@ -1403,15 +1424,15 @@ private void SetUpdateMode(IGeometry geometry, UpdateMode mode) { switch (mode) { - case Axis.UpdateMode.UpdateAndComplete: + case CoreAxis.UpdateMode.UpdateAndComplete: if (_animatableBounds.HasPreviousState) geometry.Opacity = 0; geometry.CompleteTransition(null); break; - case Axis.UpdateMode.UpdateAndRemove: + case CoreAxis.UpdateMode.UpdateAndRemove: geometry.Opacity = 0; geometry.RemoveOnCompleted = true; break; - case Axis.UpdateMode.Update: + case CoreAxis.UpdateMode.Update: default: geometry.Opacity = 1; break; @@ -1436,7 +1457,7 @@ private string TryGetLabelOrLogError(Func labeler, double value) private void ThrowInfiniteSeparators() { throw new Exception( - $"The {_orientation} axis has an excesive number of separators. " + + $"The {_orientation} axis has an excessive number of separators. " + $"If you set the step manually, ensure the number of separators is less than 10,000. " + $"This could also be caused because you are zooming too deep, " + $"try to set a limit to the current chart zoom using the Axis.{nameof(MinZoomDelta)} property. " + diff --git a/src/LiveChartsCore/BoxSeries.cs b/src/LiveChartsCore/CoreBoxSeries.cs similarity index 98% rename from src/LiveChartsCore/BoxSeries.cs rename to src/LiveChartsCore/CoreBoxSeries.cs index 762d996c4..a5c50b3c7 100644 --- a/src/LiveChartsCore/BoxSeries.cs +++ b/src/LiveChartsCore/CoreBoxSeries.cs @@ -41,7 +41,7 @@ namespace LiveChartsCore; /// /// /// -public abstract class BoxSeries +public abstract class CoreBoxSeries : StrokeAndFillCartesianSeries, IBoxSeries where TVisual : class, IBoxGeometry, new() where TDrawingContext : DrawingContext @@ -52,9 +52,9 @@ public abstract class BoxSeries - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - protected BoxSeries() + protected CoreBoxSeries() : base( SeriesProperties.BoxSeries | SeriesProperties.PrimaryAxisVerticalOrientation | SeriesProperties.Solid | SeriesProperties.PrefersXStrategyTooltips) diff --git a/src/LiveChartsCore/ColumnSeries.cs b/src/LiveChartsCore/CoreColumnSeries.cs similarity index 97% rename from src/LiveChartsCore/ColumnSeries.cs rename to src/LiveChartsCore/CoreColumnSeries.cs index f0d1f0b6c..d4fe48af2 100644 --- a/src/LiveChartsCore/ColumnSeries.cs +++ b/src/LiveChartsCore/CoreColumnSeries.cs @@ -37,7 +37,7 @@ namespace LiveChartsCore; /// the type of the label. /// The type of the drawing context. /// The type of the error geometry. -public abstract class ColumnSeries : BarSeries +public abstract class CoreColumnSeries : BarSeries where TVisual : class, ISizedGeometry, new() where TDrawingContext : DrawingContext where TLabel : class, ILabelGeometry, new() @@ -46,9 +46,9 @@ public abstract class ColumnSeries - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - protected ColumnSeries(bool isStacked = false) + protected CoreColumnSeries(bool isStacked = false) : base( SeriesProperties.Bar | SeriesProperties.PrimaryAxisVerticalOrientation | SeriesProperties.Solid | SeriesProperties.PrefersXStrategyTooltips | (isStacked ? SeriesProperties.Stacked : 0)) @@ -121,6 +121,8 @@ public override void Invalidate(Chart chart) var stacker = isStacked ? cartesianChart.SeriesContext.GetStackPosition(this, GetStackGroup()) : null; var hasSvg = this.HasSvgGeometry(); + var isFirstDraw = !chart._drawnSeries.Contains(((ISeries)this).SeriesId); + foreach (var point in Fetch(cartesianChart)) { var coordinate = point.Coordinate; @@ -299,7 +301,7 @@ public override void Invalidate(Chart chart) label.TextSize = dls; label.Padding = DataLabelsPadding; - if (chart.SeriesContext.IsFirstDraw) + if (isFirstDraw) label.CompleteTransition( nameof(label.TextSize), nameof(label.X), nameof(label.Y), nameof(label.RotateTransform)); diff --git a/src/LiveChartsCore/FinancialSeries.cs b/src/LiveChartsCore/CoreFinancialSeries.cs similarity index 98% rename from src/LiveChartsCore/FinancialSeries.cs rename to src/LiveChartsCore/CoreFinancialSeries.cs index 7e6f2ebb8..8f4556c17 100644 --- a/src/LiveChartsCore/FinancialSeries.cs +++ b/src/LiveChartsCore/CoreFinancialSeries.cs @@ -42,7 +42,7 @@ namespace LiveChartsCore; /// /// /// -public abstract class FinancialSeries +public abstract class CoreFinancialSeries : CartesianSeries, IFinancialSeries where TVisual : class, IFinancialGeometry, new() where TDrawingContext : DrawingContext @@ -56,9 +56,9 @@ public abstract class FinancialSeries - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - protected FinancialSeries() + protected CoreFinancialSeries() : base( SeriesProperties.Financial | SeriesProperties.PrimaryAxisVerticalOrientation | SeriesProperties.Solid | SeriesProperties.PrefersXStrategyTooltips) @@ -175,6 +175,8 @@ public override void Invalidate(Chart chart) var dls = (float)DataLabelsSize; var pointsCleanup = ChartPointCleanupContext.For(everFetched); + var isFirstDraw = !chart._drawnSeries.Contains(((ISeries)this).SeriesId); + foreach (var point in Fetch(cartesianChart)) { var coordinate = point.Coordinate; @@ -302,7 +304,7 @@ public override void Invalidate(Chart chart) label.TextSize = dls; label.Padding = DataLabelsPadding; - if (chart.SeriesContext.IsFirstDraw) + if (isFirstDraw) label.CompleteTransition( nameof(label.TextSize), nameof(label.X), nameof(label.Y), nameof(label.RotateTransform)); diff --git a/src/LiveChartsCore/HeatLandSeries.cs b/src/LiveChartsCore/CoreHeatLandSeries.cs similarity index 96% rename from src/LiveChartsCore/HeatLandSeries.cs rename to src/LiveChartsCore/CoreHeatLandSeries.cs index 663287164..594536afc 100644 --- a/src/LiveChartsCore/HeatLandSeries.cs +++ b/src/LiveChartsCore/CoreHeatLandSeries.cs @@ -36,7 +36,7 @@ namespace LiveChartsCore; /// Defines the heat land series class. /// /// -public class HeatLandSeries : IGeoSeries, INotifyPropertyChanged +public class CoreHeatLandSeries : IGeoSeries, INotifyPropertyChanged where TDrawingContext : DrawingContext { private IPaint? _heatPaint; @@ -50,9 +50,9 @@ public class HeatLandSeries : IGeoSeries, INot private readonly HashSet _everUsed = new(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public HeatLandSeries() + public CoreHeatLandSeries() { _observer = new CollectionDeepObserver( (sender, e) => NotifySubscribers(), diff --git a/src/LiveChartsCore/HeatSeries.cs b/src/LiveChartsCore/CoreHeatSeries.cs similarity index 97% rename from src/LiveChartsCore/HeatSeries.cs rename to src/LiveChartsCore/CoreHeatSeries.cs index 7de693c57..751c2a12e 100644 --- a/src/LiveChartsCore/HeatSeries.cs +++ b/src/LiveChartsCore/CoreHeatSeries.cs @@ -37,7 +37,7 @@ namespace LiveChartsCore; /// The type of the visual. /// The type of the label. /// The type of the drawing context. -public abstract class HeatSeries +public abstract class CoreHeatSeries : CartesianSeries, IHeatSeries where TVisual : class, ISizedGeometry, IColoredGeometry, new() where TDrawingContext : DrawingContext @@ -56,9 +56,9 @@ public abstract class HeatSeries private Padding _pointPadding = new(4); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - protected HeatSeries() + protected CoreHeatSeries() : base( SeriesProperties.Heat | SeriesProperties.PrimaryAxisVerticalOrientation | SeriesProperties.Solid | SeriesProperties.PrefersXYStrategyTooltips) @@ -146,6 +146,8 @@ public override void Invalidate(Chart chart) var hasSvg = this.HasSvgGeometry(); + var isFirstDraw = !chart._drawnSeries.Contains(((ISeries)this).SeriesId); + foreach (var point in Fetch(cartesianChart)) { var coordinate = point.Coordinate; @@ -246,7 +248,7 @@ public override void Invalidate(Chart chart) label.TextSize = dls; label.Padding = DataLabelsPadding; - if (chart.SeriesContext.IsFirstDraw) + if (isFirstDraw) label.CompleteTransition( nameof(label.TextSize), nameof(label.X), nameof(label.Y), nameof(label.RotateTransform)); diff --git a/src/LiveChartsCore/LineSeries.cs b/src/LiveChartsCore/CoreLineSeries.cs similarity index 98% rename from src/LiveChartsCore/LineSeries.cs rename to src/LiveChartsCore/CoreLineSeries.cs index ea72504ba..1a74fd5ca 100644 --- a/src/LiveChartsCore/LineSeries.cs +++ b/src/LiveChartsCore/CoreLineSeries.cs @@ -41,7 +41,7 @@ namespace LiveChartsCore; /// The type of the drawing context. /// The type of the path geometry. /// The type of the error geometry. -public class LineSeries +public class CoreLineSeries : StrokeAndFillCartesianSeries, ILineSeries where TPathGeometry : IVectorGeometry, new() where TVisual : class, ISizedGeometry, new() @@ -60,11 +60,11 @@ public class LineSeries /// Initializes a new instance of the - /// + /// /// class. /// /// if set to true [is stacked]. - public LineSeries(bool isStacked = false) + public CoreLineSeries(bool isStacked = false) : base( SeriesProperties.Line | SeriesProperties.PrimaryAxisVerticalOrientation | (isStacked ? SeriesProperties.Stacked : 0) | SeriesProperties.Sketch | SeriesProperties.PrefersXStrategyTooltips) @@ -179,6 +179,8 @@ public override void Invalidate(Chart chart) var segmentI = 0; var hasSvg = this.HasSvgGeometry(); + var isFirstDraw = !chart._drawnSeries.Contains(((ISeries)this).SeriesId); + foreach (var segment in segments) { var hasPaths = false; @@ -281,7 +283,7 @@ public override void Invalidate(Chart chart) visual = v; - if (chart.SeriesContext.IsFirstDraw) + if (isFirstDraw) { v.Geometry.X = secondaryScale.ToPixels(coordinate.SecondaryValue); v.Geometry.Y = p; @@ -317,8 +319,8 @@ public override void Invalidate(Chart chart) visual.Bezier.Id = data.TargetPoint.Context.Entity.MetaData!.EntityIndex; - if (Fill is not null) fillVector!.AddConsecutiveSegment(visual.Bezier, !chart.SeriesContext.IsFirstDraw); - if (Stroke is not null) strokeVector!.AddConsecutiveSegment(visual.Bezier, !chart.SeriesContext.IsFirstDraw); + if (Fill is not null) fillVector!.AddConsecutiveSegment(visual.Bezier, !isFirstDraw); + if (Stroke is not null) strokeVector!.AddConsecutiveSegment(visual.Bezier, !isFirstDraw); visual.Bezier.Xi = secondaryScale.ToPixels(data.X0); visual.Bezier.Xm = secondaryScale.ToPixels(data.X1); @@ -392,7 +394,7 @@ public override void Invalidate(Chart chart) label.TextSize = dls; label.Padding = DataLabelsPadding; - if (chart.SeriesContext.IsFirstDraw) + if (isFirstDraw) label.CompleteTransition( nameof(label.TextSize), nameof(label.X), nameof(label.Y), nameof(label.RotateTransform)); diff --git a/src/LiveChartsCore/PieSeries.cs b/src/LiveChartsCore/CorePieSeries.cs similarity index 98% rename from src/LiveChartsCore/PieSeries.cs rename to src/LiveChartsCore/CorePieSeries.cs index 059aa4d9c..5f0c0c931 100644 --- a/src/LiveChartsCore/PieSeries.cs +++ b/src/LiveChartsCore/CorePieSeries.cs @@ -41,7 +41,7 @@ namespace LiveChartsCore; /// The type of the label. /// The type of the miniature geometry, used in tool tips and legends. /// The type of the drawing context. -public abstract class PieSeries +public abstract class CorePieSeries : ChartSeries, IPieSeries where TDrawingContext : DrawingContext where TVisual : class, IDoughnutGeometry, new() @@ -67,9 +67,9 @@ public abstract class PieSeries, string>? _tooltipLabelFormatter; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - protected PieSeries(bool isGauge = false, bool isGaugeFill = false) + protected CorePieSeries(bool isGauge = false, bool isGaugeFill = false) : base(SeriesProperties.PieSeries | SeriesProperties.Stacked | (isGauge ? SeriesProperties.Gauge : 0) | (isGaugeFill ? SeriesProperties.GaugeFill : 0) | SeriesProperties.Solid) { } @@ -267,6 +267,8 @@ public override void Invalidate(Chart chart) var i = 1f; var isClockWise = view.IsClockwise; + var isFirstDraw = !chart._drawnSeries.Contains(((ISeries)this).SeriesId); + foreach (var point in fetched) { var coordinate = point.Coordinate; @@ -348,7 +350,7 @@ public override void Invalidate(Chart chart) Y = cy, Width = 0, Height = 0, - StartAngle = (float)(chart.SeriesContext.IsFirstDraw ? initialRotation : start + initialRotation), + StartAngle = (float)(isFirstDraw ? initialRotation : start + initialRotation), SweepAngle = 0, PushOut = 0, InnerRadius = 0, @@ -428,7 +430,7 @@ public override void Invalidate(Chart chart) AlignLabel(label, (float)start, initialRotation, sweep); - if (chart.SeriesContext.IsFirstDraw) + if (isFirstDraw) label.CompleteTransition( nameof(label.TextSize), nameof(label.X), nameof(label.Y), nameof(label.RotateTransform)); diff --git a/src/LiveChartsCore/PolarAxis.cs b/src/LiveChartsCore/CorePolarAxis.cs similarity index 99% rename from src/LiveChartsCore/PolarAxis.cs rename to src/LiveChartsCore/CorePolarAxis.cs index 9effcc078..832d5f306 100644 --- a/src/LiveChartsCore/PolarAxis.cs +++ b/src/LiveChartsCore/CorePolarAxis.cs @@ -40,7 +40,7 @@ namespace LiveChartsCore; /// The type of the text geometry. /// The type of the circle geometry. /// /// The type of the line geometry. -public abstract class PolarAxis +public abstract class CorePolarAxis : ChartElement, IPolarAxis, IPlane, INotifyPropertyChanged where TDrawingContext : DrawingContext where TTextGeometry : ILabelGeometry, new() diff --git a/src/LiveChartsCore/PolarLineSeries.cs b/src/LiveChartsCore/CorePolarLineSeries.cs similarity index 98% rename from src/LiveChartsCore/PolarLineSeries.cs rename to src/LiveChartsCore/CorePolarLineSeries.cs index 0e9c02e4f..874799fe3 100644 --- a/src/LiveChartsCore/PolarLineSeries.cs +++ b/src/LiveChartsCore/CorePolarLineSeries.cs @@ -40,7 +40,7 @@ namespace LiveChartsCore; /// The type of the data label. /// The type of the drawing context. /// The type of the path geometry. -public class PolarLineSeries +public class CorePolarLineSeries : ChartSeries, IPolarLineSeries, IPolarSeries where TPathGeometry : IVectorGeometry, new() where TVisual : class, ISizedGeometry, new() @@ -64,10 +64,10 @@ public class PolarLineSeries, string>? _radiusTooltipLabelFormatter; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// if set to true [is stacked]. - public PolarLineSeries(bool isStacked = false) + public CorePolarLineSeries(bool isStacked = false) : base( SeriesProperties.Polar | SeriesProperties.PolarLine | (isStacked ? SeriesProperties.Stacked : 0) | SeriesProperties.Sketch | SeriesProperties.PrefersXStrategyTooltips) @@ -249,6 +249,8 @@ public override void Invalidate(Chart chart) var hasSvg = this.HasSvgGeometry(); + var isFirstDraw = !chart._drawnSeries.Contains(((ISeries)this).SeriesId); + foreach (var segment in segments) { TPathGeometry fillPath; @@ -395,7 +397,7 @@ public override void Invalidate(Chart chart) var rad = Math.Sqrt(Math.Pow(cp.X - scaler.CenterX, 2) + Math.Pow(cp.Y - scaler.CenterY, 2)); - if (chart.SeriesContext.IsFirstDraw) + if (isFirstDraw) label.CompleteTransition( nameof(label.TextSize), nameof(label.X), nameof(label.Y), nameof(label.RotateTransform)); diff --git a/src/LiveChartsCore/RowSeries.cs b/src/LiveChartsCore/CoreRowSeries.cs similarity index 97% rename from src/LiveChartsCore/RowSeries.cs rename to src/LiveChartsCore/CoreRowSeries.cs index d2bd6f089..9a59e9615 100644 --- a/src/LiveChartsCore/RowSeries.cs +++ b/src/LiveChartsCore/CoreRowSeries.cs @@ -38,7 +38,7 @@ namespace LiveChartsCore; /// The type of the drawing context. /// /// The type of the error geometry. -public class RowSeries : BarSeries +public class CoreRowSeries : BarSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() where TErrorGeometry : class, ILineGeometry, new() @@ -47,9 +47,9 @@ public class RowSeries private readonly bool _isRounded = false; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public RowSeries(bool isStacked = false) + public CoreRowSeries(bool isStacked = false) : base( SeriesProperties.Bar | SeriesProperties.PrimaryAxisHorizontalOrientation | SeriesProperties.Solid | SeriesProperties.PrefersYStrategyTooltips | (isStacked ? SeriesProperties.Stacked : 0)) @@ -122,6 +122,8 @@ public override void Invalidate(Chart chart) var stacker = isStacked ? cartesianChart.SeriesContext.GetStackPosition(this, GetStackGroup()) : null; var hasSvg = this.HasSvgGeometry(); + var isFirstDraw = !chart._drawnSeries.Contains(((ISeries)this).SeriesId); + foreach (var point in Fetch(cartesianChart)) { var coordinate = point.Coordinate; @@ -302,7 +304,7 @@ public override void Invalidate(Chart chart) label.TextSize = dls; label.Padding = DataLabelsPadding; - if (chart.SeriesContext.IsFirstDraw) + if (isFirstDraw) label.CompleteTransition( nameof(label.TextSize), nameof(label.X), nameof(label.Y), nameof(label.RotateTransform)); diff --git a/src/LiveChartsCore/ScatterSeries.cs b/src/LiveChartsCore/CoreScatterSeries.cs similarity index 96% rename from src/LiveChartsCore/ScatterSeries.cs rename to src/LiveChartsCore/CoreScatterSeries.cs index f59242075..fba7b6bd3 100644 --- a/src/LiveChartsCore/ScatterSeries.cs +++ b/src/LiveChartsCore/CoreScatterSeries.cs @@ -40,7 +40,7 @@ namespace LiveChartsCore; /// The type of the error geometry. /// /// -public class ScatterSeries +public class CoreScatterSeries : StrokeAndFillCartesianSeries, IScatterSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() @@ -51,9 +51,9 @@ public class ScatterSeries? _errorPaint; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ScatterSeries() + public CoreScatterSeries() : base(SeriesProperties.Scatter | SeriesProperties.Solid | SeriesProperties.PrefersXYStrategyTooltips) { DataPadding = new LvcPoint(1, 1); @@ -61,7 +61,7 @@ public ScatterSeries() DataLabelsFormatter = (point) => $"{point.Coordinate.PrimaryValue}"; YToolTipLabelFormatter = point => { - var series = (ScatterSeries)point.Context.Series; + var series = (CoreScatterSeries)point.Context.Series; var c = point.Coordinate; return series.IsWeighted ? $"X = {c.SecondaryValue}{Environment.NewLine}" + @@ -158,6 +158,8 @@ public override void Invalidate(Chart chart) var hy = chart.ControlSize.Height * .5f; var hasSvg = this.HasSvgGeometry(); + var isFirstDraw = !chart._drawnSeries.Contains(((ISeries)this).SeriesId); + foreach (var point in Fetch(cartesianChart)) { var coordinate = point.Coordinate; @@ -281,7 +283,7 @@ public override void Invalidate(Chart chart) label.TextSize = dls; label.Padding = DataLabelsPadding; - if (chart.SeriesContext.IsFirstDraw) + if (isFirstDraw) label.CompleteTransition( nameof(label.TextSize), nameof(label.X), nameof(label.Y), nameof(label.RotateTransform)); diff --git a/src/LiveChartsCore/StackedAreaSeries.cs b/src/LiveChartsCore/CoreStackedAreaSeries.cs similarity index 82% rename from src/LiveChartsCore/StackedAreaSeries.cs rename to src/LiveChartsCore/CoreStackedAreaSeries.cs index 36fed1b68..f2e71cc29 100644 --- a/src/LiveChartsCore/StackedAreaSeries.cs +++ b/src/LiveChartsCore/CoreStackedAreaSeries.cs @@ -34,9 +34,9 @@ namespace LiveChartsCore; /// The type of the drawing context. /// The type of the path geometry. /// The type of the error geometry. -/// -public class StackedAreaSeries - : LineSeries +/// +public class CoreStackedAreaSeries + : CoreLineSeries where TPathGeometry : IVectorGeometry, new() where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() @@ -44,9 +44,9 @@ public class StackedAreaSeries - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public StackedAreaSeries() + public CoreStackedAreaSeries() : base(true) { GeometryFill = null; diff --git a/src/LiveChartsCore/StackedColumnSeries.cs b/src/LiveChartsCore/CoreStackedColumnSeries.cs similarity index 82% rename from src/LiveChartsCore/StackedColumnSeries.cs rename to src/LiveChartsCore/CoreStackedColumnSeries.cs index 46923ddd9..3366582da 100644 --- a/src/LiveChartsCore/StackedColumnSeries.cs +++ b/src/LiveChartsCore/CoreStackedColumnSeries.cs @@ -33,9 +33,9 @@ namespace LiveChartsCore; /// The type of the label. /// The type of the drawing context. /// The type of the error geometry. -/// -public class StackedColumnSeries - : ColumnSeries, IStackedBarSeries +/// +public class CoreStackedColumnSeries + : CoreColumnSeries, IStackedBarSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() where TErrorGeometry : class, ILineGeometry, new() @@ -44,9 +44,9 @@ public class StackedColumnSeries - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public StackedColumnSeries() : base(true) + public CoreStackedColumnSeries() : base(true) { } /// diff --git a/src/LiveChartsCore/StackedRowSeries.cs b/src/LiveChartsCore/CoreStackedRowSeries.cs similarity index 85% rename from src/LiveChartsCore/StackedRowSeries.cs rename to src/LiveChartsCore/CoreStackedRowSeries.cs index 7ef7f55e1..0c3825f5e 100644 --- a/src/LiveChartsCore/StackedRowSeries.cs +++ b/src/LiveChartsCore/CoreStackedRowSeries.cs @@ -33,8 +33,8 @@ namespace LiveChartsCore; /// The type of the label. /// The type of the error geometry. /// The type of the drawing context. -public class StackedRowSeries - : RowSeries, IStackedBarSeries +public class CoreStackedRowSeries + : CoreRowSeries, IStackedBarSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() where TErrorGeometry : class, ILineGeometry, new() @@ -43,9 +43,9 @@ public class StackedRowSeries - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public StackedRowSeries() : base(true) + public CoreStackedRowSeries() : base(true) { } /// diff --git a/src/LiveChartsCore/StackedStepAreaSeries.cs b/src/LiveChartsCore/CoreStackedStepAreaSeries.cs similarity index 82% rename from src/LiveChartsCore/StackedStepAreaSeries.cs rename to src/LiveChartsCore/CoreStackedStepAreaSeries.cs index dd641291a..fb09312d6 100644 --- a/src/LiveChartsCore/StackedStepAreaSeries.cs +++ b/src/LiveChartsCore/CoreStackedStepAreaSeries.cs @@ -33,18 +33,18 @@ namespace LiveChartsCore; /// The type of the data label. /// The type of the drawing context. /// The type of the path geometry. -/// -public class StackedStepAreaSeries - : StepLineSeries +/// +public class CoreStackedStepAreaSeries + : CoreStepLineSeries where TPathGeometry : IVectorGeometry, new() where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() where TDrawingContext : DrawingContext { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public StackedStepAreaSeries() + public CoreStackedStepAreaSeries() : base(true) { GeometryFill = null; diff --git a/src/LiveChartsCore/StepLineSeries.cs b/src/LiveChartsCore/CoreStepLineSeries.cs similarity index 97% rename from src/LiveChartsCore/StepLineSeries.cs rename to src/LiveChartsCore/CoreStepLineSeries.cs index bcd1e29c5..96af5eaff 100644 --- a/src/LiveChartsCore/StepLineSeries.cs +++ b/src/LiveChartsCore/CoreStepLineSeries.cs @@ -41,7 +41,7 @@ namespace LiveChartsCore; /// The type of the data label. /// The type of the drawing context. /// The type of the path geometry. -public class StepLineSeries +public class CoreStepLineSeries : StrokeAndFillCartesianSeries, IStepLineSeries where TPathGeometry : IVectorGeometry, new() where TVisual : class, ISizedGeometry, new() @@ -56,10 +56,10 @@ public class StepLineSeries - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// if set to true [is stacked]. - public StepLineSeries(bool isStacked = false) + public CoreStepLineSeries(bool isStacked = false) : base( SeriesProperties.StepLine | SeriesProperties.PrimaryAxisVerticalOrientation | (isStacked ? SeriesProperties.Stacked : 0) | SeriesProperties.Sketch | SeriesProperties.PrefersXStrategyTooltips) @@ -147,6 +147,8 @@ public override void Invalidate(Chart chart) uwx = uwx < gs ? gs : uwx; var hasSvg = this.HasSvgGeometry(); + var isFirstDraw = !chart._drawnSeries.Contains(((ISeries)this).SeriesId); + foreach (var segment in segments) { TPathGeometry fillPath; @@ -213,7 +215,7 @@ public override void Invalidate(Chart chart) var v = new StepLineVisualPoint(); visual = v; - if (chart.SeriesContext.IsFirstDraw) + if (isFirstDraw) { v.Geometry.X = secondaryScale.ToPixels(coordinate.SecondaryValue); v.Geometry.Y = p; @@ -245,8 +247,8 @@ public override void Invalidate(Chart chart) visual.StepSegment.Id = point.Context.Entity.MetaData!.EntityIndex; - if (Fill is not null) fillVector.AddConsecutiveSegment(visual.StepSegment, !chart.SeriesContext.IsFirstDraw); - if (Stroke is not null) strokeVector.AddConsecutiveSegment(visual.StepSegment, !chart.SeriesContext.IsFirstDraw); + if (Fill is not null) fillVector.AddConsecutiveSegment(visual.StepSegment, !isFirstDraw); + if (Stroke is not null) strokeVector.AddConsecutiveSegment(visual.StepSegment, !isFirstDraw); visual.StepSegment.Xi = secondaryScale.ToPixels(coordinate.SecondaryValue - ds); visual.StepSegment.Xj = secondaryScale.ToPixels(coordinate.SecondaryValue); @@ -299,7 +301,7 @@ public override void Invalidate(Chart chart) label.TextSize = dls; label.Padding = DataLabelsPadding; - if (chart.SeriesContext.IsFirstDraw) + if (isFirstDraw) label.CompleteTransition( nameof(label.TextSize), nameof(label.X), nameof(label.Y), nameof(label.RotateTransform)); diff --git a/src/LiveChartsCore/Defaults/FinancialPointI.cs b/src/LiveChartsCore/Defaults/FinancialPointI.cs index 2e6b4e4df..a3d5047cf 100644 --- a/src/LiveChartsCore/Defaults/FinancialPointI.cs +++ b/src/LiveChartsCore/Defaults/FinancialPointI.cs @@ -30,7 +30,7 @@ namespace LiveChartsCore.Defaults; /// /// Defines a point with financial data, this point does not use in the X axis, instead it uses the position /// of the point the array as the X coordinate,the dates must be specified in the -/// property. +/// property. /// public class FinancialPointI : IChartEntity, INotifyPropertyChanged { diff --git a/src/LiveChartsCore/ISeries.cs b/src/LiveChartsCore/ISeries.cs index a15a22389..ac562b040 100644 --- a/src/LiveChartsCore/ISeries.cs +++ b/src/LiveChartsCore/ISeries.cs @@ -223,7 +223,7 @@ public interface ISeries : ISeries /// /// The mapping. /// - Action? Mapping { get; set; } + Func? Mapping { get; set; } /// /// Gets or sets the values. diff --git a/src/LiveChartsCore/Kernel/Extensions.cs b/src/LiveChartsCore/Kernel/Extensions.cs index a356b975a..0e5285b65 100644 --- a/src/LiveChartsCore/Kernel/Extensions.cs +++ b/src/LiveChartsCore/Kernel/Extensions.cs @@ -38,7 +38,7 @@ namespace LiveChartsCore.Kernel; /// public static class Extensions { - private const double Cf = 3d; + private const float MinLabelSize = 10; // Assume the label size is at least 10px private static readonly Type s_nullableType = typeof(Nullable<>); @@ -196,17 +196,38 @@ public static class Extensions /// The axis. /// Size of the control. /// The bounds. - /// The max label size. /// - public static AxisTick GetTick(this ICartesianAxis axis, LvcSize controlSize, Bounds? bounds = null, LvcSize? maxLabelSize = null) + public static AxisTick GetTick(this ICartesianAxis axis, LvcSize controlSize, Bounds? bounds = null) { bounds ??= axis.VisibleDataBounds; + var maxLabelSize = axis.PossibleMaxLabelSize; - var w = (maxLabelSize?.Width ?? 0d) * 0.60; - if (w < 20 * Cf) w = 20 * Cf; + var w = maxLabelSize.Width; + var h = maxLabelSize.Height; - var h = maxLabelSize?.Height ?? 0d; - if (h < 12 * Cf) h = 12 * Cf; + var r = Math.Abs(axis.LabelsRotation % 90); + + if (r is >= 20 and <= 70) + { + // if the labels are rotated, we assume that they can overlap. + var d = 0.35f * (float)Math.Sqrt(w * w + h * h); + w = d; + h = d; + } + else + { + // modify the size of the label to avoid overlapping + // and improve readability. + + const float xGrowFactor = 1.10f; + if (axis.Orientation == AxisOrientation.X) w *= xGrowFactor; + + const float yGrowFactor = 1.5f; + if (axis.Orientation == AxisOrientation.Y) h *= yGrowFactor; + } + + if (w < MinLabelSize) w = MinLabelSize; + if (h < MinLabelSize) h = MinLabelSize; var max = axis.MaxLimit is null ? bounds.Max : axis.MaxLimit.Value; var min = axis.MinLimit is null ? bounds.Min : axis.MinLimit.Value; @@ -257,8 +278,8 @@ public static AxisTick GetTick(this IPolarAxis axis, PolarChart var range = max - min; var separations = axis.Orientation == PolarAxisOrientation.Angle - ? Math.Round(c / (10 * Cf), 0) - : Math.Round(radius / (30 * Cf), 0); + ? Math.Round(c / 30, 0) + : Math.Round(radius / 90, 0); var minimum = range / separations; var magnitude = Math.Pow(10, Math.Floor(Math.Log(minimum) / Math.Log(10))); diff --git a/src/LiveChartsCore/Kernel/IChartEntity.cs b/src/LiveChartsCore/Kernel/IChartEntity.cs index 9cf6cd3b5..a01c1fc2b 100644 --- a/src/LiveChartsCore/Kernel/IChartEntity.cs +++ b/src/LiveChartsCore/Kernel/IChartEntity.cs @@ -30,7 +30,7 @@ public interface IChartEntity /// /// Gets or sets the meta data, the additional data required by LiveCharts to draw a point. /// - public ChartEntityMetaData? MetaData { get; set; } + ChartEntityMetaData? MetaData { get; set; } /// /// Gets or sets the coordinate, the position of the point in the chart. diff --git a/src/LiveChartsCore/Kernel/LiveChartsSettings.cs b/src/LiveChartsCore/Kernel/LiveChartsSettings.cs index 915549f8e..91d8bcbd7 100644 --- a/src/LiveChartsCore/Kernel/LiveChartsSettings.cs +++ b/src/LiveChartsCore/Kernel/LiveChartsSettings.cs @@ -162,13 +162,13 @@ public class LiveChartsSettings public bool IsRightToLeft { get; set; } /// - /// Adds or replaces a mapping for a given type, the mapper defines how a type is mapped to a instance, - /// then the will be drawn as a point in our chart. + /// Adds or replaces a mapping for a given type, the mapper defines how a type is mapped to a + /// in the chart. /// /// The type of the model. /// The mapper. /// - public LiveChartsSettings HasMap(Action mapper) + public LiveChartsSettings HasMap(Func mapper) { var t = typeof(TModel); _mappers[t] = mapper; @@ -186,14 +186,14 @@ public LiveChartsSettings UseRightToLeftSettings() return this; } - internal Action GetMap() + internal Func GetMap() { return !_mappers.TryGetValue(typeof(TModel), out var mapper) ? throw new NotImplementedException( $"A mapper for type {typeof(TModel)} is not implemented yet, consider using " + $"{nameof(LiveCharts)}.{nameof(LiveCharts.Configure)}() " + $"method to call {nameof(HasMap)}() with the type you are trying to plot.") - : (Action)mapper; + : (Func)mapper; } internal LiveChartsSettings HasProvider(ChartEngine factory) @@ -390,22 +390,17 @@ public Theme GetTheme() public LiveChartsSettings AddDefaultMappers() { return - HasMap((model, point) => point.Coordinate = new(point.Index, model)) - .HasMap((model, point) => point.Coordinate = new(point.Index, model)) - .HasMap((model, point) => point.Coordinate = new(point.Index, model)) - .HasMap((model, point) => point.Coordinate = new(point.Index, model)) - .HasMap((model, point) => point.Coordinate = new(point.Index, model)) - .HasMap((model, point) => point.Coordinate = new(point.Index, (double)model)) - .HasMap((model, point) => - { - // model can not be null at this point. - // LiveCharts will return Coordinate.Empty if the model was null. - point.Coordinate = new(point.Index, model!.Value); - }) - .HasMap((model, point) => point.Coordinate = new(point.Index, model!.Value)) - .HasMap((model, point) => point.Coordinate = new(point.Index, model!.Value)) - .HasMap((model, point) => point.Coordinate = new(point.Index, model!.Value)) - .HasMap((model, point) => point.Coordinate = new(point.Index, model!.Value)) - .HasMap((model, point) => point.Coordinate = new(point.Index, (double)model!.Value)); + HasMap((model, index) => new(index, model)) + .HasMap((model, index) => new(index, model)) + .HasMap((model, index) => new(index, model)) + .HasMap((model, index) => new(index, model)) + .HasMap((model, index) => new(index, model)) + .HasMap((model, index) => new(index, (double)model)) + .HasMap((model, index) => new(index, model!.Value)) + .HasMap((model, index) => new(index, model!.Value)) + .HasMap((model, index) => new(index, model!.Value)) + .HasMap((model, index) => new(index, model!.Value)) + .HasMap((model, index) => new(index, model!.Value)) + .HasMap((model, index) => new(index, (double)model!.Value)); } } diff --git a/src/LiveChartsCore/Kernel/Providers/DataFactory.cs b/src/LiveChartsCore/Kernel/Providers/DataFactory.cs index 94e689477..173a358f2 100644 --- a/src/LiveChartsCore/Kernel/Providers/DataFactory.cs +++ b/src/LiveChartsCore/Kernel/Providers/DataFactory.cs @@ -404,10 +404,9 @@ private IEnumerable EnumerateChartEntities(ISeries series, } point.Context.DataSource = item; + point.Coordinate = mapper(item, index); entity.MetaData.EntityIndex = index++; - mapper(item, point); - yield return entity; } } diff --git a/src/LiveChartsCore/Kernel/SeriesContext.cs b/src/LiveChartsCore/Kernel/SeriesContext.cs index 74786af66..2123f6ee4 100644 --- a/src/LiveChartsCore/Kernel/SeriesContext.cs +++ b/src/LiveChartsCore/Kernel/SeriesContext.cs @@ -61,12 +61,10 @@ public class SeriesContext /// Initializes a new instance of the class. /// /// The series. - /// Indicates whether is the first time the chart is drawn. /// The chart - public SeriesContext(IEnumerable> series, bool isFirstDraw, IChart chart) + public SeriesContext(IEnumerable> series, IChart chart) { _series = series; - IsFirstDraw = isFirstDraw; _chart = chart; } @@ -323,9 +321,4 @@ private void CalculatePieLabelsOuterSpace() } #endregion - - /// - /// Gets or sets a value indicating whether is first draw of the chart. - /// - public bool IsFirstDraw { get; set; } = true; } diff --git a/src/LiveChartsCore/Kernel/Sketches/ICartesianAxis.cs b/src/LiveChartsCore/Kernel/Sketches/ICartesianAxis.cs index a321a196e..efac38520 100644 --- a/src/LiveChartsCore/Kernel/Sketches/ICartesianAxis.cs +++ b/src/LiveChartsCore/Kernel/Sketches/ICartesianAxis.cs @@ -94,6 +94,11 @@ public interface ICartesianAxis : IPlane, INotifyPropertyChanged /// LvcRectangle LabelsDesiredSize { get; set; } + /// + /// Gets or sets the max label size, this value is used internally to measure the axis. + /// + LvcSize PossibleMaxLabelSize { get; } + /// /// Gets or sets the reserved area for the name. /// @@ -237,4 +242,10 @@ public interface ICartesianAxis : ICartesianAxis /// The chart. /// The pointer position void InvalidateCrosshair(Chart chart, LvcPoint pointerPosition); + + /// + /// Clears the crosshair visual. + /// + /// The chart. + void ClearCrosshair(Chart chart); } diff --git a/src/LiveChartsCore/LiveCharts.cs b/src/LiveChartsCore/LiveCharts.cs index 98ad685d8..93fceb50d 100644 --- a/src/LiveChartsCore/LiveCharts.cs +++ b/src/LiveChartsCore/LiveCharts.cs @@ -103,17 +103,6 @@ public static void Configure(Action configuration) configuration(DefaultSettings); } - /// - /// Defines a mapper for the given type. - /// - /// The type of the model. - /// The mapper. - /// - public static LiveChartsSettings HasMapFor(Action mapper) - { - return DefaultSettings.HasMap(mapper); - } - /// /// Converts ticks to Date, and prevents overflow exceptions. /// diff --git a/src/LiveChartsCore/LiveChartsCore.csproj b/src/LiveChartsCore/LiveChartsCore.csproj index 27088ce6d..64c7f75a8 100644 --- a/src/LiveChartsCore/LiveChartsCore.csproj +++ b/src/LiveChartsCore/LiveChartsCore.csproj @@ -17,7 +17,7 @@ LiveChartsCore LiveChartsCore - 2.0.0-rc1.2 + 2.0.0-rc2 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 diff --git a/src/LiveChartsCore/Measure/AxisLimit.cs b/src/LiveChartsCore/Measure/AxisLimit.cs index 213e9edcf..31034e389 100644 --- a/src/LiveChartsCore/Measure/AxisLimit.cs +++ b/src/LiveChartsCore/Measure/AxisLimit.cs @@ -75,6 +75,16 @@ internal static void ValidateLimits(ref double min, ref double max) min is double.MaxValue or double.MinValue || max is double.MaxValue or double.MinValue; + // easy workaround to prevent the axis from crashing + // https://github.com/beto-rodriguez/LiveCharts2/issues/1294 + if (min > max) + { + var temp = max; + + max = min; + min = temp; + } + if (!isMax) return; min = 0; diff --git a/src/LiveChartsCore/PieChart.cs b/src/LiveChartsCore/PieChart.cs index 75f8de307..bfbb00723 100644 --- a/src/LiveChartsCore/PieChart.cs +++ b/src/LiveChartsCore/PieChart.cs @@ -156,7 +156,7 @@ protected internal override void Measure() AnimationsSpeed = _chartView.AnimationsSpeed; EasingFunction = _chartView.EasingFunction; - SeriesContext = new SeriesContext(VisibleSeries, _isFirstDraw, this); + SeriesContext = new SeriesContext(VisibleSeries, this); var isNewTheme = LiveCharts.DefaultSettings.CurrentThemeId != ThemeId; var theme = LiveCharts.DefaultSettings.GetTheme(); @@ -196,6 +196,7 @@ protected internal override void Measure() float ts = 0f, bs = 0f, ls = 0f, rs = 0f; if (title is not null) { + title.ClippingMode = ClipMode.None; var titleSize = title.Measure(this); m.Top = titleSize.Height; ts = titleSize.Height; @@ -234,7 +235,11 @@ protected internal override void Measure() } foreach (var visual in VisualElements) AddVisual(visual); - foreach (var series in VisibleSeries) AddVisual((ChartElement)series); + foreach (var series in VisibleSeries) + { + AddVisual((ChartElement)series); + _drawnSeries.Add(series.SeriesId); + } CollectVisuals(); diff --git a/src/LiveChartsCore/PolarChart.cs b/src/LiveChartsCore/PolarChart.cs index c18af232b..98087cb57 100644 --- a/src/LiveChartsCore/PolarChart.cs +++ b/src/LiveChartsCore/PolarChart.cs @@ -189,7 +189,7 @@ protected internal override void Measure() #endregion - SeriesContext = new SeriesContext(VisibleSeries, _isFirstDraw, this); + SeriesContext = new SeriesContext(VisibleSeries, this); var isNewTheme = LiveCharts.DefaultSettings.CurrentThemeId != ThemeId; // restart axes bounds and meta data @@ -372,6 +372,7 @@ protected internal override void Measure() float ts = 0f, bs = 0f, ls = 0f, rs = 0f; if (View.Title is not null) { + View.Title.ClippingMode = ClipMode.None; var titleSize = View.Title.Measure(this); m.Top = titleSize.Height; ts = titleSize.Height; @@ -495,7 +496,11 @@ protected internal override void Measure() } foreach (var visual in VisualElements) AddVisual(visual); - foreach (var series in VisibleSeries) AddVisual((ChartElement)series); + foreach (var series in VisibleSeries) + { + AddVisual((ChartElement)series); + _drawnSeries.Add(series.SeriesId); + } CollectVisuals(); diff --git a/src/LiveChartsCore/Series.cs b/src/LiveChartsCore/Series.cs index dac401cde..705b2184d 100644 --- a/src/LiveChartsCore/Series.cs +++ b/src/LiveChartsCore/Series.cs @@ -102,7 +102,7 @@ public abstract class Series private readonly CollectionDeepObserver _observer; private IEnumerable? _values; private string? _name; - private Action? _mapping; + private Func? _mapping; private int _zIndex; private Func, string> _dataLabelsFormatter = x => x.Coordinate.PrimaryValue.ToString(); private bool _isVisible = true; @@ -163,11 +163,8 @@ SeriesProperties IInternalSeries.SeriesProperties /// public double Pivot { get => pivot; set => SetProperty(ref pivot, (float)value); } - /// - /// Gets or sets the mapping that defines how a type is mapped to a instance, - /// then the will be drawn as a point in the chart. - /// - public Action? Mapping { get => _mapping; set => SetProperty(ref _mapping, value); } + /// + public Func? Mapping { get => _mapping; set => SetProperty(ref _mapping, value); } /// public string? GeometrySvg diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj index 1da5541ab..dbbab79a0 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj +++ b/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj @@ -6,7 +6,7 @@ netcoreapp2.0;netstandard2.0;net462;net6.0 LiveChartsCore.SkiaSharpView.Avalonia LiveChartsCore.SkiaSharpView.Avalonia - 2.0.0-rc1.2 + 2.0.0-rc2 icon.png Simple, flexible, interactive and powerful data visualization for AvaloniaUI. MIT diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.WPF.csproj b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.WPF.csproj index e5216125f..dbe0f419c 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.WPF.csproj +++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.WPF.csproj @@ -7,7 +7,7 @@ net462;netcoreapp3.1 LiveChartsCore.SkiaSharpView.WPF LiveChartsCore.SkiaSharpView.WPF - 2.0.0-rc1.2 + 2.0.0-rc2 icon.png Simple, flexible, interactive and powerful data visualization for WPF. MIT diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsCore.SkiaSharpView.WinForms.csproj b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsCore.SkiaSharpView.WinForms.csproj index 3280534aa..d16ce0cf1 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsCore.SkiaSharpView.WinForms.csproj +++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsCore.SkiaSharpView.WinForms.csproj @@ -9,7 +9,7 @@ net462;netcoreapp3.1 LiveChartsCore.SkiaSharpView.WinForms LiveChartsCore.SkiaSharpView.WinForms - 2.0.0-rc1.2 + 2.0.0-rc2 icon.png Simple, flexible, interactive and powerful data visualization for WindowsForms. MIT diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.Xamarin.Forms/LiveChartsCore.SkiaSharpView.Xamarin.Forms.csproj b/src/skiasharp/LiveChartsCore.SkiaSharp.Xamarin.Forms/LiveChartsCore.SkiaSharpView.Xamarin.Forms.csproj index b3a415493..15151f9e4 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp.Xamarin.Forms/LiveChartsCore.SkiaSharpView.Xamarin.Forms.csproj +++ b/src/skiasharp/LiveChartsCore.SkiaSharp.Xamarin.Forms/LiveChartsCore.SkiaSharpView.Xamarin.Forms.csproj @@ -6,7 +6,7 @@ netstandard2.0; LiveChartsCore.SkiaSharpView.XamarinForms LiveChartsCore.SkiaSharpView.XamarinForms - 2.0.0-rc1.2 + 2.0.0-rc2 icon.png Simple, flexible, interactive and powerful data visualization for XamarinForms. MIT diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/Axis.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/Axis.cs index d9b352caf..37caab38f 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/Axis.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/Axis.cs @@ -27,5 +27,5 @@ namespace LiveChartsCore.SkiaSharpView; /// -public class Axis : Axis +public class Axis : CoreAxis { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/BoxSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/BoxSeries.cs index 3f9f44e0d..7674c327d 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/BoxSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/BoxSeries.cs @@ -37,7 +37,7 @@ namespace LiveChartsCore.SkiaSharpView; /// or at the series level /// (). /// -public class BoxSeries : BoxSeries +public class BoxSeries : CoreBoxSeries { } /// @@ -53,7 +53,7 @@ public class BoxSeries : BoxSeries /// The type of the geometry of every point of the series. /// -public class BoxSeries : BoxSeries +public class BoxSeries : CoreBoxSeries where TVisual : class, IBoxGeometry, new() { } @@ -73,7 +73,7 @@ public class BoxSeries : BoxSeries /// The type of the data label of every point. /// -public class BoxSeries : BoxSeries +public class BoxSeries : CoreBoxSeries where TVisual : class, IBoxGeometry, new() where TLabel : class, ILabelGeometry, new() { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/CandlesticksSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/CandlesticksSeries.cs index e4bc31c10..c1774069e 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/CandlesticksSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/CandlesticksSeries.cs @@ -73,7 +73,7 @@ public class CandlesticksSeries : CandlesticksSeries /// The type of the data label of every point. /// -public class CandlesticksSeries : FinancialSeries +public class CandlesticksSeries : CoreFinancialSeries where TVisual : class, IFinancialGeometry, new() where TLabel : class, ILabelGeometry, new() { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/ColumnSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/ColumnSeries.cs index c14a01c37..7d43f8edc 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/ColumnSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/ColumnSeries.cs @@ -74,7 +74,7 @@ public class ColumnSeries : ColumnSeries public class ColumnSeries - : ColumnSeries + : CoreColumnSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/Drawing/Geometries/LabelGeometry.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/Drawing/Geometries/LabelGeometry.cs index 350eef609..66769135d 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/Drawing/Geometries/LabelGeometry.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/Drawing/Geometries/LabelGeometry.cs @@ -263,7 +263,9 @@ private IEnumerable GetLinesByMaxWidth(string source, SKPaint paint) _ = sb2.Append(word); _ = paint.MeasureText(sb2.ToString(), ref bounds); - if (bounds.Width > mw) + // if the line has already content and the new word exceeds the max width + // then we create a new line + if (sb.Length > 0 && bounds.Width > mw) { yield return sb.ToString(); _ = sb.Clear(); diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/HeatLandSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/HeatLandSeries.cs index ecc561966..6b36910e4 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/HeatLandSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/HeatLandSeries.cs @@ -25,8 +25,8 @@ namespace LiveChartsCore.SkiaSharpView; -/// -public class HeatLandSeries : HeatLandSeries +/// +public class HeatLandSeries : CoreHeatLandSeries { /// /// Initializes a new instance of the class. diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/HeatSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/HeatSeries.cs index eabf950f8..dbdcf8452 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/HeatSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/HeatSeries.cs @@ -73,7 +73,7 @@ public class HeatSeries : HeatSeries /// The type of the data label of every point. /// -public class HeatSeries : HeatSeries +public class HeatSeries : CoreHeatSeries where TVisual : class, ISizedGeometry, IColoredGeometry, new() where TLabel : class, ILabelGeometry, new() { diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/LineSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/LineSeries.cs index 3d50ad888..c1e4a6885 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/LineSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/LineSeries.cs @@ -74,7 +74,7 @@ public class LineSeries : LineSeries public class LineSeries - : LineSeries + : CoreLineSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj b/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj index 18732a3f9..e30b2adcf 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj @@ -17,7 +17,7 @@ LiveChartsCore.SkiaSharpView LiveChartsCore.SkiaSharpView - 2.0.0-rc1.2 + 2.0.0-rc2 icon.png Simple, flexible, interactive and powerful data visualization for .Net, this package contains the SkiaSharp backend. MIT diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/Painting/Paint.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/Painting/Paint.cs index a6b105d8d..65f466798 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/Painting/Paint.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/Painting/Paint.cs @@ -36,8 +36,8 @@ namespace LiveChartsCore.SkiaSharpView.Painting; public abstract class Paint : Animatable, IDisposable, IPaint { private readonly FloatMotionProperty _strokeMiterTransition; - private readonly Dictionary>> _geometriesByCanvas = new(); - private readonly Dictionary _clipRectangles = new(); + private readonly Dictionary, HashSet>> _geometriesByCanvas = new(); + private readonly Dictionary, LvcRectangle> _clipRectangles = new(); private char? _matchesChar = null; internal SKPaint? _skiaPaint; internal FloatMotionProperty _strokeWidthTransition; @@ -195,7 +195,7 @@ public IEnumerable> GetGeometries(MotionCanva /// public void SetGeometries(MotionCanvas canvas, HashSet> geometries) { - _geometriesByCanvas[canvas.Sync] = geometries; + _geometriesByCanvas[canvas] = geometries; IsValid = false; } @@ -206,7 +206,7 @@ public void AddGeometryToPaintTask(MotionCanvas canvas, if (g is null) { g = new HashSet>(); - _geometriesByCanvas[canvas.Sync] = g; + _geometriesByCanvas[canvas] = g; } _ = g.Add(geometry); IsValid = false; @@ -235,13 +235,13 @@ public void ReleaseCanvas(MotionCanvas canvas) /// public LvcRectangle GetClipRectangle(MotionCanvas canvas) { - return _clipRectangles.TryGetValue(canvas.Sync, out var clip) ? clip : LvcRectangle.Empty; + return _clipRectangles.TryGetValue(canvas, out var clip) ? clip : LvcRectangle.Empty; } /// public void SetClipRectangle(MotionCanvas canvas, LvcRectangle value) { - _clipRectangles[canvas.Sync] = value; + _clipRectangles[canvas] = value; } /// @@ -271,7 +271,7 @@ protected internal SKTypeface GetSKTypeface() // return the defined typeface. if (SKTypeface is not null) return SKTypeface; - // Obsolete method used in older versions of LiveCahrts... + // Obsolete method used in older versions of LiveCharts... if (_matchesChar is not null) return SKFontManager.Default.MatchCharacter(_matchesChar.Value); // create one from the font family. @@ -283,7 +283,7 @@ protected internal SKTypeface GetSKTypeface() private HashSet>? GetGeometriesByCanvas(MotionCanvas canvas) { - return _geometriesByCanvas.TryGetValue(canvas.Sync, out var geometries) + return _geometriesByCanvas.TryGetValue(canvas, out var geometries) ? geometries : null; } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/PieSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/PieSeries.cs index 1eece536d..6ed8eb6df 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/PieSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/PieSeries.cs @@ -101,7 +101,7 @@ public PieSeries(bool isGauge = false, bool isGaugeFill = false) : base(isGauge, /// /// The type of the data label of every point. /// -public class PieSeries : PieSeries +public class PieSeries : CorePieSeries where TVisual : class, IDoughnutGeometry, new() where TLabel : class, ILabelGeometry, new() { diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/PolarAxis.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/PolarAxis.cs index f9cc82839..a48747bb8 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/PolarAxis.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/PolarAxis.cs @@ -27,5 +27,5 @@ namespace LiveChartsCore.SkiaSharpView; /// -public class PolarAxis : PolarAxis +public class PolarAxis : CorePolarAxis { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/PolarLineSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/PolarLineSeries.cs index 2601a9528..5839681db 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/PolarLineSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/PolarLineSeries.cs @@ -74,7 +74,7 @@ public class PolarLineSeries : PolarLineSeries public class PolarLineSeries - : PolarLineSeries + : CorePolarLineSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/RowSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/RowSeries.cs index 4793aed87..ecff7d52c 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/RowSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/RowSeries.cs @@ -74,7 +74,7 @@ public class RowSeries : RowSeries public class RowSeries - : RowSeries + : CoreRowSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/SKCharts/InMemorySkiaSharpChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/SKCharts/InMemorySkiaSharpChart.cs index 36934f765..9e90acd68 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/SKCharts/InMemorySkiaSharpChart.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/SKCharts/InMemorySkiaSharpChart.cs @@ -48,6 +48,8 @@ public InMemorySkiaSharpChart() /// public IChart CoreChart { get; protected set; } = null!; + internal bool ExplicitDisposing { get; set; } + /// /// Gets or sets the background. /// @@ -150,6 +152,6 @@ public virtual void DrawOnCanvas(SKCanvas canvas, SKSurface? surface = null, boo Background, clearCanvasOnBeginDraw)); - skiaChart.Unload(); + if (!ExplicitDisposing) skiaChart.Unload(); } } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/SKCharts/SKDefaultLegend.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/SKCharts/SKDefaultLegend.cs index 4df12b984..b1a0919f8 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/SKCharts/SKDefaultLegend.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/SKCharts/SKDefaultLegend.cs @@ -39,6 +39,7 @@ namespace LiveChartsCore.SkiaSharpView.SKCharts; public class SKDefaultLegend : IChartLegend { private static readonly int s_zIndex = 10050; + private IPaint? _backgroundPaint = null; // marked as internal only for testing purposes internal readonly StackPanel _stackPanel = new() @@ -61,6 +62,22 @@ public SKDefaultLegend() /// public IPaint? FontPaint { get; set; } + /// + /// Gets or sets the background paint. + /// + public IPaint? BackgroundPaint + { + get => _backgroundPaint; + set + { + _backgroundPaint = value; + if (value is not null) + { + value.IsFill = true; + } + } + } + /// /// Gets or sets the fonts size. /// @@ -88,6 +105,7 @@ public LvcSize Measure(Chart chart) private void BuildLayout(Chart chart) { if (chart.View.LegendTextPaint is not null) FontPaint = chart.View.LegendTextPaint; + if (chart.View.LegendBackgroundPaint is not null) BackgroundPaint = chart.View.LegendBackgroundPaint; if (chart.View.LegendTextSize is not null) TextSize = chart.View.LegendTextSize.Value; if (FontPaint is not null) FontPaint.ZIndex = s_zIndex + 1; @@ -107,6 +125,9 @@ private void BuildLayout(Chart chart) _stackPanel.MaxHeight = chart.ControlSize.Height; } + if (BackgroundPaint is not null) BackgroundPaint.ZIndex = s_zIndex; + _stackPanel.BackgroundPaint = BackgroundPaint; + foreach (var visual in _stackPanel.Children.ToArray()) { _ = _stackPanel.Children.Remove(visual); diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/ScatterSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/ScatterSeries.cs index 436498f1c..5225e9b10 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/ScatterSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/ScatterSeries.cs @@ -73,7 +73,7 @@ public class ScatterSeries : ScatterSeries /// The type of the data label of every point. /// -public class ScatterSeries : ScatterSeries +public class ScatterSeries : CoreScatterSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/StackedAreaSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/StackedAreaSeries.cs index 060610e93..26539eeb2 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/StackedAreaSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/StackedAreaSeries.cs @@ -74,7 +74,7 @@ public class StackedAreaSeries : StackedAreaSeries public class StackedAreaSeries - : StackedAreaSeries + : CoreStackedAreaSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/StackedColumnSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/StackedColumnSeries.cs index 474bb670a..d5c32337d 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/StackedColumnSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/StackedColumnSeries.cs @@ -74,7 +74,7 @@ public class StackedColumnSeries : StackedColumnSeries public class StackedColumnSeries - : StackedColumnSeries + : CoreStackedColumnSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/StackedRowSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/StackedRowSeries.cs index 125305552..0d6af70bf 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/StackedRowSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/StackedRowSeries.cs @@ -74,7 +74,7 @@ public class StackedRowSeries : StackedRowSeries public class StackedRowSeries - : StackedRowSeries + : CoreStackedRowSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/StackedStepAreaSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/StackedStepAreaSeries.cs index 3dee56283..c232b98e5 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/StackedStepAreaSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/StackedStepAreaSeries.cs @@ -76,7 +76,7 @@ public class StackedStepAreaSeries /// The type of the data label of every point. /// public class StackedStepAreaSeries - : StackedStepAreaSeries + : CoreStackedStepAreaSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/StepLineSeries.cs b/src/skiasharp/LiveChartsCore.SkiaSharp/StepLineSeries.cs index 30742dfa5..c4b50c87c 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/StepLineSeries.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/StepLineSeries.cs @@ -74,7 +74,7 @@ public class StepLineSeries : StepLineSeries public class StepLineSeries - : StepLineSeries + : CoreStepLineSeries where TVisual : class, ISizedGeometry, new() where TLabel : class, ILabelGeometry, new() { } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveChartsCore.SkiaSharpView.Blazor.csproj b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveChartsCore.SkiaSharpView.Blazor.csproj index c09ea73fb..3b19ece68 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveChartsCore.SkiaSharpView.Blazor.csproj +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveChartsCore.SkiaSharpView.Blazor.csproj @@ -17,7 +17,7 @@ net6.0 enable enable - 2.0.0-rc1.2 + 2.0.0-rc2 icon.png Simple, flexible, interactive and powerful data visualization for Blazor. MIT diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsCore.SkiaSharpView.Eto.csproj b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsCore.SkiaSharpView.Eto.csproj index f43ea487a..3313ed535 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsCore.SkiaSharpView.Eto.csproj +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsCore.SkiaSharpView.Eto.csproj @@ -7,7 +7,7 @@ netstandard2.0 LiveChartsCore.SkiaSharpView.Eto LiveChartsCore.SkiaSharpView.Eto - 2.0.0-rc1.2 + 2.0.0-rc2 icon.png Simple, flexible, interactive and powerful data visualization for Eto.Forms. MIT diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/ChartBehaviour.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/ChartBehaviour.cs index 764bb75bc..67b775bb6 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/ChartBehaviour.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/ChartBehaviour.cs @@ -37,6 +37,9 @@ public void On(Microsoft.Maui.Controls.VisualElement element) { element.HandlerChanged += (sender, e) => { + ScreenSize = new( + (float)DeviceDisplay.MainDisplayInfo.Width, + (float)DeviceDisplay.MainDisplayInfo.Height); Density = DeviceDisplay.MainDisplayInfo.Density; #if ANDROID diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj index bf1c469c2..50a90467e 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj @@ -15,7 +15,7 @@ 10.0.17763.0 6.5 - 2.0.0-rc1.2 + 2.0.0-rc2 icon.png Simple, flexible, interactive and powerful data visualization for Maui. MIT diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.nuspec b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.nuspec index 9f3613124..0617384bb 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.nuspec +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.nuspec @@ -2,7 +2,7 @@ LiveChartsCore.SkiaSharpView.Maui - 2.0.0-rc1.2 + 2.0.0-rc2 LiveChartsCore.SkiaSharpView.Maui BetoRodriguez true @@ -17,23 +17,23 @@ - + - + - + - + - + diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/MotionCanvas.xaml.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/MotionCanvas.xaml.cs index a1843c8cb..3c989d658 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/MotionCanvas.xaml.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/MotionCanvas.xaml.cs @@ -60,6 +60,7 @@ public MotionCanvas() skiaElement.PaintSurface += OnCanvasViewPaintSurface; CanvasCore.Invalidated += OnCanvasCoreInvalidated; Unloaded += MotionCanvas_Unloaded; + Loaded += MotionCanvas_Loaded; } /// @@ -169,6 +170,11 @@ private static void PaintTasksChanged(BindableObject bindable, object oldValue, motionCanvas.CanvasCore.SetPaintTasks(tasks); } + private void MotionCanvas_Loaded(object? sender, EventArgs e) + { + _isLoaded = true; + } + private void MotionCanvas_Unloaded(object? sender, EventArgs e) { _isLoaded = false; diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/ChartBehaviour.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/ChartBehaviour.cs index a2807a3fb..ae0a983d6 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/ChartBehaviour.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/ChartBehaviour.cs @@ -27,7 +27,7 @@ namespace LiveChartsCore.SkiaSharpView.WinUI; /// /// The chart behaviour for Uno Platform. /// -public class ChartBehaviour : Behaviours.ChartBehaviour +public partial class ChartBehaviour : Behaviours.ChartBehaviour { /// /// Attaches the native events on the specified element. @@ -36,7 +36,12 @@ public class ChartBehaviour : Behaviours.ChartBehaviour public void On(FrameworkElement element) { #if HAS_UNO_WINUI - Density = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().LogicalDpi / 96.0f; + var currentView = Windows.Graphics.Display.DisplayInformation.GetForCurrentView(); + + Density = currentView.LogicalDpi / 96.0f; + ScreenSize = new( + currentView.ScreenWidthInRawPixels, + currentView.ScreenHeightInRawPixels); #else Density = element.XamlRoot.RasterizationScale; #endif @@ -46,9 +51,7 @@ public void On(FrameworkElement element) element.Touch += OnAndroidTouched; element.Hover += OnAndroidHover; -#endif - -#if MACCATALYST || IOS +#elif MACCATALYST || IOS element.UserInteractionEnabled = true; element.AddGestureRecognizer(GetMacCatalystHover(element)); @@ -56,9 +59,7 @@ public void On(FrameworkElement element) element.AddGestureRecognizer(GetMacCatalystPinch(element)); element.AddGestureRecognizer(GetMacCatalystOnPan(element)); -#endif - -#if WINDOWS +#elif WINDOWS element.PointerPressed += OnWindowsPointerPressed; element.PointerMoved += OnWindowsPointerMoved; @@ -66,6 +67,14 @@ public void On(FrameworkElement element) element.PointerWheelChanged += OnWindowsPointerWheelChanged; element.PointerExited += OnWindowsPointerExited; +#elif HAS_UNO || HAS_UNO_WINUI + + element.PointerPressed += OnUnoPointerPressed; + element.PointerMoved += OnUnoPointerMoved; + element.PointerReleased += OnUnoPointerReleased; + element.PointerWheelChanged += OnUnoPointerWheelChanged; + element.PointerExited += OnUnoPointerExited; + #endif } } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/ChartBehaviour.uno.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/ChartBehaviour.uno.cs new file mode 100644 index 000000000..9eadfca40 --- /dev/null +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/ChartBehaviour.uno.cs @@ -0,0 +1,107 @@ +// 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. + +#if (HAS_UNO || HAS_UNO_WINUI) && !ANDROID && !IOS && !MACCATALYST && !WINDOWS + +// Work around for Uno (WASM and SKIA), we use the same code as WinUI, but we +// can not call this from the behaviours assembly because it does not have +// a reference to the Uno assembly. So we have to copy the code here. + +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Input; + +namespace LiveChartsCore.SkiaSharpView.WinUI; + +/// +/// The chart behaviour for Uno Platform. +/// +public partial class ChartBehaviour : Behaviours.ChartBehaviour +{ + /// + /// On uno pointer pressed. + /// + /// + /// + protected void OnUnoPointerPressed(object sender, PointerRoutedEventArgs e) + { + var p = e.GetCurrentPoint(sender as UIElement); + if (p is null) return; + + InvokePressed( + sender, + new(new(p.Position.X, p.Position.Y), p.Properties.IsRightButtonPressed, e)); + } + + /// + /// On uno pointer moved. + /// + /// + /// + protected void OnUnoPointerMoved(object sender, PointerRoutedEventArgs e) + { + var p = e.GetCurrentPoint(sender as UIElement); + if (p is null) return; + + InvokeMoved( + sender, + new(new(p.Position.X, p.Position.Y), e)); + } + + /// + /// On uno pointer released. + /// + /// + /// + protected void OnUnoPointerReleased(object sender, PointerRoutedEventArgs e) + { + var p = e.GetCurrentPoint(sender as UIElement); + if (p is null) return; + + InvokeReleased( + sender, + new(new(p.Position.X, p.Position.Y), p.Properties.IsRightButtonPressed, e)); + } + + /// + /// On uno pointer wheel changed. + /// + /// + /// + protected void OnUnoPointerWheelChanged(object sender, PointerRoutedEventArgs e) + { + var p = e.GetCurrentPoint(sender as UIElement); + + InvokeScrolled(sender, new(new(p.Position.X, p.Position.Y), p.Properties.MouseWheelDelta, e)); + } + + /// + /// On uno pointer exited. + /// + /// + /// + protected void OnUnoPointerExited(object sender, PointerRoutedEventArgs e) + { + InvokeExited(sender, new(e)); + } +} + +#endif 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 ce570fc87..a4bf59762 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,13 +1,16 @@ - $(TargetFrameworks);net6.0-windows10.0.19041 - $(TargetFrameworks);net6.0;net6.0-ios;net6.0-maccatalyst;net6.0-android + + $(TargetFrameworks);net7.0-windows10.0.19041 + + $(TargetFrameworks);net7.0;net7.0-ios;net7.0-maccatalyst;net7.0-android true enable 11.0 - 2.0.0-rc1.2 + 2.0.0-rc2 icon.png Simple, flexible, interactive and powerful data visualization for Uno.WinUI. MIT @@ -22,29 +25,25 @@ bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml - - - + + + + + + + + + - - - - - - + + @@ -61,10 +60,6 @@ - - - - diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno/LiveChartsCore.SkiaSharpView.Uno.csproj b/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno/LiveChartsCore.SkiaSharpView.Uno.csproj index 126f9516b..a59c51f93 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno/LiveChartsCore.SkiaSharpView.Uno.csproj +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Uno/LiveChartsCore.SkiaSharpView.Uno.csproj @@ -17,7 +17,7 @@ enable 11.0 - 2.0.0-rc1.2 + 2.0.0-rc2 icon.png Simple, flexible, interactive and powerful data visualization for Uno. MIT diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/CartesianChart.xaml.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/CartesianChart.xaml.cs index 2bedd1359..a7d6165c8 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/CartesianChart.xaml.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/CartesianChart.xaml.cs @@ -37,7 +37,6 @@ using LiveChartsCore.SkiaSharpView.Painting; using LiveChartsCore.SkiaSharpView.SKCharts; using LiveChartsCore.VisualElements; -using Microsoft.UI.Input; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Media; @@ -763,12 +762,19 @@ private void OnLoaded(object sender, RoutedEventArgs e) _core.UpdateStarted += OnCoreUpdateStarted; _core.UpdateFinished += OnCoreUpdateFinished; - PointerWheelChanged += OnWheelChanged; - PointerPressed += OnPointerPressed; - PointerReleased += OnPointerReleased; SizeChanged += OnSizeChanged; - PointerMoved += OnPointerMoved; - PointerExited += OnPointerExited; + + // We use the behaviours assembly to share to support Uno.WinUI + var chartBehaviour = new ChartBehaviour(); + + chartBehaviour.Pressed += OnPressed; + chartBehaviour.Moved += OnMoved; + chartBehaviour.Released += OnReleased; + chartBehaviour.Scrolled += OnScrolled; + chartBehaviour.Pinched += OnPinched; + chartBehaviour.Exited += OnExited; + + chartBehaviour.On(this); } _core.Load(); @@ -791,98 +797,77 @@ private void OnSizeChanged(object sender, SizeChangedEventArgs e) _core.Update(); } - private void OnPointerMoved(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnPressed(object? sender, Behaviours.Events.PressedEventArgs args) { - var p = e.GetCurrentPoint(_canvas); + // is this working on all platforms? + //if (args.KeyModifiers > 0) return; - if (PointerMoveCommand is not null) - { - var args = new PointerCommandArgs(this, new(p.Position.X, p.Position.Y), e); - if (PointerMoveCommand.CanExecute(args)) PointerMoveCommand.Execute(args); - } + var cArgs = new PointerCommandArgs(this, new(args.Location.X, args.Location.Y), args); + if (PointerPressedCommand?.CanExecute(cArgs) == true) PointerPressedCommand.Execute(cArgs); - _core?.InvokePointerMove(new LvcPoint((float)p.Position.X, (float)p.Position.Y)); + _core?.InvokePointerDown(args.Location, args.IsSecondaryPress); } - private void OnCoreUpdateFinished(IChartView chart) + private void OnMoved(object? sender, Behaviours.Events.ScreenEventArgs args) { - UpdateFinished?.Invoke(this); - } + var location = args.Location; - private void OnCoreUpdateStarted(IChartView chart) - { - if (UpdateStartedCommand is not null) - { - var args = new ChartCommandArgs(this); - if (UpdateStartedCommand.CanExecute(args)) UpdateStartedCommand.Execute(args); - } + var cArgs = new PointerCommandArgs(this, new(location.X, location.Y), args.OriginalEvent); + if (PointerMoveCommand?.CanExecute(cArgs) == true) PointerMoveCommand.Execute(cArgs); - UpdateStarted?.Invoke(this); + _core?.InvokePointerMove(location); } - private void OnCoreMeasuring(IChartView chart) + private void OnReleased(object? sender, Behaviours.Events.PressedEventArgs args) { - Measuring?.Invoke(this); + var cArgs = new PointerCommandArgs(this, new(args.Location.X, args.Location.Y), args); + if (PointerReleasedCommand?.CanExecute(cArgs) == true) PointerReleasedCommand.Execute(cArgs); + + _core?.InvokePointerUp(args.Location, args.IsSecondaryPress); } - private void OnPointerExited(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnScrolled(object? sender, Behaviours.Events.ScrollEventArgs args) { - _core?.InvokePointerLeft(); + if (_core is null) throw new Exception("core not found"); + var c = (CartesianChart)_core; + c.Zoom(args.Location, args.ScrollDelta > 0 ? ZoomDirection.ZoomIn : ZoomDirection.ZoomOut); } - private void OnPointerReleased(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnPinched(object? sender, Behaviours.Events.PinchEventArgs args) { - var p = e.GetCurrentPoint(this); - - if (PointerReleasedCommand is not null) - { - var args = new PointerCommandArgs(this, new(p.Position.X, p.Position.Y), e); - if (PointerReleasedCommand.CanExecute(args)) PointerReleasedCommand.Execute(args); - } + if (_core is null) return; - var isRight = false; - if (e.Pointer.PointerDeviceType == PointerDeviceType.Mouse) - { - var properties = e.GetCurrentPoint(this).Properties; - isRight = properties.IsRightButtonPressed; - } + var c = (CartesianChart)_core; + var p = args.PinchStart; + var s = c.ControlSize; + var pivot = new LvcPoint((float)(p.X * s.Width), (float)(p.Y * s.Height)); + c.Zoom(pivot, ZoomDirection.DefinedByScaleFactor, args.Scale, true); + } - _core?.InvokePointerUp(new LvcPoint((float)p.Position.X, (float)p.Position.Y), isRight); - ReleasePointerCapture(e.Pointer); + private void OnExited(object? sender, Behaviours.Events.EventArgs args) + { + _core?.InvokePointerLeft(); } - private void OnPointerPressed(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnCoreUpdateFinished(IChartView chart) { - var p = e.GetCurrentPoint(this); + UpdateFinished?.Invoke(this); + } - if (PointerPressedCommand is not null) + private void OnCoreUpdateStarted(IChartView chart) + { + if (UpdateStartedCommand is not null) { - var args = new PointerCommandArgs(this, new(p.Position.X, p.Position.Y), e); - if (PointerPressedCommand.CanExecute(args)) PointerPressedCommand.Execute(args); + var args = new ChartCommandArgs(this); + if (UpdateStartedCommand.CanExecute(args)) UpdateStartedCommand.Execute(args); } - if (e.KeyModifiers > 0) return; - _ = CapturePointer(e.Pointer); - - var isRight = false; - if (e.Pointer.PointerDeviceType == PointerDeviceType.Mouse) - { - var properties = e.GetCurrentPoint(this).Properties; - isRight = properties.IsRightButtonPressed; - } - _core?.InvokePointerDown(new LvcPoint((float)p.Position.X, (float)p.Position.Y), isRight); + UpdateStarted?.Invoke(this); } - private void OnWheelChanged(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnCoreMeasuring(IChartView chart) { - if (_core == null) throw new Exception("core not found"); - var c = (CartesianChart)_core; - var p = e.GetCurrentPoint(this); - - c.Zoom( - new LvcPoint( - (float)p.Position.X, (float)p.Position.Y), - p.Properties.MouseWheelDelta > 0 ? ZoomDirection.ZoomIn : ZoomDirection.ZoomOut); + Measuring?.Invoke(this); } private void OnUnloaded(object sender, RoutedEventArgs e) diff --git a/samples/UnoPlatformSample/UnoPlatformSample.DataContracts/WeatherForecast.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/ChartBehaviour.cs similarity index 64% rename from samples/UnoPlatformSample/UnoPlatformSample.DataContracts/WeatherForecast.cs rename to src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/ChartBehaviour.cs index ff7bc5598..556e04063 100644 --- a/samples/UnoPlatformSample/UnoPlatformSample.DataContracts/WeatherForecast.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/ChartBehaviour.cs @@ -1,4 +1,4 @@ -// The MIT License(MIT) +// The MIT License(MIT) // // Copyright(c) 2021 Alberto Rodriguez Orozco & LiveCharts Contributors // @@ -20,18 +20,25 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -namespace UnoPlatformSample.DataContracts; +using Microsoft.UI.Xaml; + +namespace LiveChartsCore.SkiaSharpView.WinUI; /// -/// A Weather Forecast for a specific date +/// The chart behaviour for Windows. /// -/// Gets the Date of the Forecast. -/// Gets the Forecast Temperature in Celsius. -/// Get a description of how the weather will feel. -public record WeatherForecast(DateOnly Date, double TemperatureC, string? Summary) +public partial class ChartBehaviour : Behaviours.ChartBehaviour { /// - /// Gets the Forecast Temperature in Fahrenheit + /// Attaches the native events on the specified element. /// - public double TemperatureF => 32 + (TemperatureC * 9 / 5); + /// The element. + public void On(FrameworkElement element) + { + element.PointerPressed += OnWindowsPointerPressed; + element.PointerMoved += OnWindowsPointerMoved; + element.PointerReleased += OnWindowsPointerReleased; + element.PointerWheelChanged += OnWindowsPointerWheelChanged; + element.PointerExited += OnWindowsPointerExited; + } } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.csproj b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.csproj index 54ba26239..3500ed13d 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.csproj +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.csproj @@ -3,13 +3,13 @@ 11.0 enable - net6.0-windows10.0.19041 + net6.0-windows10.0.19041;net7.0-windows10.0.19041 10.0.17763.0 LiveChartsCore.SkiaSharpView.WinUI win10-x86;win10-x64;win10-arm64 true - 2.0.0-rc1.2 + 2.0.0-rc2 icon.png Simple, flexible, interactive and powerful data visualization for WindowsAppSDK. MIT @@ -32,12 +32,13 @@ - + + diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.nuspec b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.nuspec index fcfbc897f..8dc1ad510 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.nuspec +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/LiveChartsCore.SkiaSharpView.WinUI.nuspec @@ -2,7 +2,7 @@ LiveChartsCore.SkiaSharpView.WinUI - 2.0.0-rc1.2 + 2.0.0-rc2 LiveChartsCore.SkiaSharpView.WinUI BetoRodriguez true @@ -18,15 +18,21 @@ - - + + - + + + + + + + @@ -49,5 +55,28 @@ src="bin\Release\net6.0-windows10.0.19041\LiveChartsCore.SkiaSharpView.WinUI\Themes\*.*" target="lib\net6.0-windows10.0.19041\LiveChartsCore.SkiaSharpView.WinUI\Themes"/> + + + + + + + + + diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/PieChart.xaml.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/PieChart.xaml.cs index 8995b9351..ed873aefb 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/PieChart.xaml.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/PieChart.xaml.cs @@ -645,8 +645,6 @@ private void OnLoaded(object sender, RoutedEventArgs e) if (_core is null) { _core = new PieChart(this, config => config.UseDefaults(), canvas.CanvasCore); - //legend = Template.FindName("legend", this) as IChartLegend; - //tooltip = Template.FindName("tooltip", this) as IChartTooltip; if (SyncContext != null) _canvas.CanvasCore.Sync = SyncContext; @@ -659,10 +657,17 @@ private void OnLoaded(object sender, RoutedEventArgs e) _core.UpdateFinished += OnCoreUpdateFinished; SizeChanged += OnSizeChanged; - PointerMoved += OnPointerMoved; - PointerExited += OnPointerExited; - PointerPressed += OnPointerPressed; - PointerReleased += OnPointerReleased; + + // We use the behaviours assembly to share to support Uno.WinUI + var chartBehaviour = new ChartBehaviour(); + + chartBehaviour.Pressed += OnPressed; + chartBehaviour.Moved += OnMoved; + chartBehaviour.Released += OnReleased; + chartBehaviour.Pinched += OnPinched; + chartBehaviour.Exited += OnExited; + + chartBehaviour.On(this); } _core.Load(); @@ -675,69 +680,70 @@ private void OnSizeChanged(object sender, SizeChangedEventArgs e) _core.Update(); } - private void OnPointerMoved(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnPressed(object? sender, Behaviours.Events.PressedEventArgs args) { - var p = e.GetCurrentPoint(_canvas); + // is this working on all platforms? + //if (args.KeyModifiers > 0) return; - if (PointerMoveCommand is not null) - { - var args = new PointerCommandArgs(this, new(p.Position.X, p.Position.Y), e); - if (PointerMoveCommand.CanExecute(args)) PointerMoveCommand.Execute(args); - } + var cArgs = new PointerCommandArgs(this, new(args.Location.X, args.Location.Y), args); + if (PointerPressedCommand?.CanExecute(cArgs) == true) PointerPressedCommand.Execute(cArgs); - _core?.InvokePointerMove(new LvcPoint((float)p.Position.X, (float)p.Position.Y)); + _core?.InvokePointerDown(args.Location, args.IsSecondaryPress); } - private void OnCoreUpdateFinished(IChartView chart) + private void OnMoved(object? sender, Behaviours.Events.ScreenEventArgs args) { - UpdateFinished?.Invoke(this); + var location = args.Location; + + var cArgs = new PointerCommandArgs(this, new(location.X, location.Y), args.OriginalEvent); + if (PointerMoveCommand?.CanExecute(cArgs) == true) PointerMoveCommand.Execute(cArgs); + + _core?.InvokePointerMove(location); } - private void OnCoreUpdateStarted(IChartView chart) + private void OnReleased(object? sender, Behaviours.Events.PressedEventArgs args) { - if (UpdateStartedCommand is not null) - { - var args = new ChartCommandArgs(this); - if (UpdateStartedCommand.CanExecute(args)) UpdateStartedCommand.Execute(args); - } + var cArgs = new PointerCommandArgs(this, new(args.Location.X, args.Location.Y), args); + if (PointerReleasedCommand?.CanExecute(cArgs) == true) PointerReleasedCommand.Execute(cArgs); - UpdateStarted?.Invoke(this); + _core?.InvokePointerUp(args.Location, args.IsSecondaryPress); } - private void OnCoreMeasuring(IChartView chart) + private void OnPinched(object? sender, Behaviours.Events.PinchEventArgs args) { - Measuring?.Invoke(this); + if (_core is null) return; + + var c = (CartesianChart)_core; + var p = args.PinchStart; + var s = c.ControlSize; + var pivot = new LvcPoint((float)(p.X * s.Width), (float)(p.Y * s.Height)); + c.Zoom(pivot, ZoomDirection.DefinedByScaleFactor, args.Scale, true); } - private void OnPointerExited(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnExited(object? sender, Behaviours.Events.EventArgs args) { _core?.InvokePointerLeft(); } - private void OnPointerPressed(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnCoreUpdateFinished(IChartView chart) { - var p = e.GetCurrentPoint(this); + UpdateFinished?.Invoke(this); + } - if (PointerPressedCommand is not null) + private void OnCoreUpdateStarted(IChartView chart) + { + if (UpdateStartedCommand is not null) { - var args = new PointerCommandArgs(this, new(p.Position.X, p.Position.Y), e); - if (PointerPressedCommand.CanExecute(args)) PointerPressedCommand.Execute(args); + var args = new ChartCommandArgs(this); + if (UpdateStartedCommand.CanExecute(args)) UpdateStartedCommand.Execute(args); } - _core?.InvokePointerDown(new LvcPoint((float)p.Position.X, (float)p.Position.Y), false); + UpdateStarted?.Invoke(this); } - private void OnPointerReleased(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnCoreMeasuring(IChartView chart) { - var p = e.GetCurrentPoint(this); - - if (PointerReleasedCommand is not null) - { - var args = new PointerCommandArgs(this, new(p.Position.X, p.Position.Y), e); - if (PointerReleasedCommand.CanExecute(args)) PointerReleasedCommand.Execute(args); - } - - _core?.InvokePointerUp(new LvcPoint((float)p.Position.X, (float)p.Position.Y), false); + Measuring?.Invoke(this); } private void OnUnloaded(object sender, RoutedEventArgs e) diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/PolarChart.xaml.cs b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/PolarChart.xaml.cs index 10fb1d416..77681b194 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/PolarChart.xaml.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.WinUI/PolarChart.xaml.cs @@ -708,12 +708,18 @@ private void OnLoaded(object sender, RoutedEventArgs e) _core.UpdateStarted += OnCoreUpdateStarted; _core.UpdateFinished += OnCoreUpdateFinished; - PointerWheelChanged += OnWheelChanged; - PointerPressed += OnPointerPressed; - PointerReleased += OnPointerReleased; SizeChanged += OnSizeChanged; - PointerMoved += OnPointerMoved; - PointerExited += OnPointerExited; + + // We use the behaviours assembly to share to support Uno.WinUI + var chartBehaviour = new ChartBehaviour(); + + chartBehaviour.Pressed += OnPressed; + chartBehaviour.Moved += OnMoved; + chartBehaviour.Released += OnReleased; + chartBehaviour.Pinched += OnPinched; + chartBehaviour.Exited += OnExited; + + chartBehaviour.On(this); } _core.Load(); @@ -736,81 +742,70 @@ private void OnSizeChanged(object sender, SizeChangedEventArgs e) _core.Update(); } - private void OnPointerMoved(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnPressed(object? sender, Behaviours.Events.PressedEventArgs args) { - var p = e.GetCurrentPoint(_canvas); + // is this working on all platforms? + //if (args.KeyModifiers > 0) return; - if (PointerMoveCommand is not null) - { - var args = new PointerCommandArgs(this, new(p.Position.X, p.Position.Y), e); - if (PointerMoveCommand.CanExecute(args)) PointerMoveCommand.Execute(args); - } + var cArgs = new PointerCommandArgs(this, new(args.Location.X, args.Location.Y), args); + if (PointerPressedCommand?.CanExecute(cArgs) == true) PointerPressedCommand.Execute(cArgs); - _core?.InvokePointerMove(new LvcPoint((float)p.Position.X, (float)p.Position.Y)); + _core?.InvokePointerDown(args.Location, args.IsSecondaryPress); } - private void OnCoreUpdateFinished(IChartView chart) + private void OnMoved(object? sender, Behaviours.Events.ScreenEventArgs args) { - UpdateFinished?.Invoke(this); + var location = args.Location; + + var cArgs = new PointerCommandArgs(this, new(location.X, location.Y), args.OriginalEvent); + if (PointerMoveCommand?.CanExecute(cArgs) == true) PointerMoveCommand.Execute(cArgs); + + _core?.InvokePointerMove(location); } - private void OnCoreUpdateStarted(IChartView chart) + private void OnReleased(object? sender, Behaviours.Events.PressedEventArgs args) { - if (UpdateStartedCommand is not null) - { - var args = new ChartCommandArgs(this); - if (UpdateStartedCommand.CanExecute(args)) UpdateStartedCommand.Execute(args); - } + var cArgs = new PointerCommandArgs(this, new(args.Location.X, args.Location.Y), args); + if (PointerReleasedCommand?.CanExecute(cArgs) == true) PointerReleasedCommand.Execute(cArgs); - UpdateStarted?.Invoke(this); + _core?.InvokePointerUp(args.Location, args.IsSecondaryPress); } - private void OnCoreMeasuring(IChartView chart) + private void OnPinched(object? sender, Behaviours.Events.PinchEventArgs args) { - Measuring?.Invoke(this); + if (_core is null) return; + + var c = (CartesianChart)_core; + var p = args.PinchStart; + var s = c.ControlSize; + var pivot = new LvcPoint((float)(p.X * s.Width), (float)(p.Y * s.Height)); + c.Zoom(pivot, ZoomDirection.DefinedByScaleFactor, args.Scale, true); } - private void OnPointerExited(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnExited(object? sender, Behaviours.Events.EventArgs args) { _core?.InvokePointerLeft(); } - private void OnPointerReleased(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnCoreUpdateFinished(IChartView chart) { - var p = e.GetCurrentPoint(this); - - if (PointerReleasedCommand is not null) - { - var args = new PointerCommandArgs(this, new(p.Position.X, p.Position.Y), e); - if (PointerReleasedCommand.CanExecute(args)) PointerReleasedCommand.Execute(args); - } - - _core?.InvokePointerUp(new LvcPoint((float)p.Position.X, (float)p.Position.Y), false); + UpdateFinished?.Invoke(this); } - private void OnPointerPressed(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnCoreUpdateStarted(IChartView chart) { - var p = e.GetCurrentPoint(this); - - if (PointerPressedCommand is not null) + if (UpdateStartedCommand is not null) { - var args = new PointerCommandArgs(this, new(p.Position.X, p.Position.Y), e); - if (PointerPressedCommand.CanExecute(args)) PointerPressedCommand.Execute(args); + var args = new ChartCommandArgs(this); + if (UpdateStartedCommand.CanExecute(args)) UpdateStartedCommand.Execute(args); } - _core?.InvokePointerDown(new LvcPoint((float)p.Position.X, (float)p.Position.Y), false); + UpdateStarted?.Invoke(this); } - private void OnWheelChanged(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e) + private void OnCoreMeasuring(IChartView chart) { - //if (_core == null) throw new Exception("core not found"); - //var c = (PolarChart)_core; - //var p = e.GetCurrentPoint(this); - - //c.Zoom( - // new LvcPoint( - // (float)p.Position.X, (float)p.Position.Y), - // p.Properties.MouseWheelDelta > 0 ? ZoomDirection.ZoomIn : ZoomDirection.ZoomOut); + Measuring?.Invoke(this); } private void OnUnloaded(object sender, RoutedEventArgs e) diff --git a/tests/LiveChartsCore.UnitTesting/OtherTests/DataProviderTest.cs b/tests/LiveChartsCore.UnitTesting/OtherTests/DataProviderTest.cs index 95b12a3c6..03651e4a2 100644 --- a/tests/LiveChartsCore.UnitTesting/OtherTests/DataProviderTest.cs +++ b/tests/LiveChartsCore.UnitTesting/OtherTests/DataProviderTest.cs @@ -197,45 +197,7 @@ public void FetchCustomType() var sutSeries = new ColumnSeries { Values = new City[] { new(1), new(1), new(1), new(1), new(1) }, - Mapping = (city, point) => - { - point.Coordinate = new(point.Index, city.Population.Value); - } - }; - - var chart = new SKCartesianChart - { - Width = 100, - Height = 100, - Series = new[] { sutSeries } - }; - - _ = chart.GetImage(); - - var datafactory = sutSeries.DataFactory; - var points = datafactory.Fetch(sutSeries, chart.Core).ToArray(); - - for (var i = 0; i < points.Length; i++) - { - var point = points[i]; - var c = point.Coordinate; - Assert.IsTrue(c.SecondaryValue == i && c.PrimaryValue == 1); - } - } - - [TestMethod] - public void FetchCustomTypeObsolete() - { - var sutSeries = new ColumnSeries - { - Values = new City[] { new(1), new(1), new(1), new(1), new(1) }, - Mapping = (city, point) => - { -#pragma warning disable CS0618 // Type or member is obsolete - point.PrimaryValue = city.Population.Value; - point.SecondaryValue = point.Index; -#pragma warning restore CS0618 // Type or member is obsolete - } + Mapping = (city, index) => new(index, city.Population.Value) }; var chart = new SKCartesianChart @@ -265,13 +227,10 @@ public void FetchCoordinateEmpty() var sutSeries = new ColumnSeries { Values = new City[] { new(1), new(null), new(1), new(null), new(1) }, - Mapping = (city, point) => - { - point.Coordinate = - city.Population is null - ? Coordinate.Empty - : new(point.Index, city.Population.Value); - } + Mapping = (city, index) => + city.Population is null + ? Coordinate.Empty + : new(index, city.Population.Value) }; var chart = new SKCartesianChart @@ -313,10 +272,7 @@ public void FetchNull() var sutSeries = new ColumnSeries { Values = new City[] { new(1), null, new(1), null, new(1) }, - Mapping = (city, point) => - { - point.Coordinate = new(point.Index, city.Population.Value); - } + Mapping = (city, index) => new(index, city.Population.Value) }; var chart = new SKCartesianChart diff --git a/tests/LiveChartsCore.UnitTesting/SeriesTests/FinancialSeriesTest.cs b/tests/LiveChartsCore.UnitTesting/SeriesTests/FinancialSeriesTest.cs index 26f80ecc1..a83c6f419 100644 --- a/tests/LiveChartsCore.UnitTesting/SeriesTests/FinancialSeriesTest.cs +++ b/tests/LiveChartsCore.UnitTesting/SeriesTests/FinancialSeriesTest.cs @@ -62,7 +62,8 @@ public void ShouldScale() Height = 1000, Series = new[] { sutSeries }, XAxes = new[] { new Axis { UnitWidth = TimeSpan.FromDays(1).Ticks } }, - YAxes = new[] { new Axis { MinLimit = 0, MaxLimit = 512 } } + YAxes = new[] { new Axis { MinLimit = 0, MaxLimit = 512 } }, + ExplicitDisposing = true }; _ = chart.GetImage();