From 58f24abad2469ac3aabba0463fb439704734f1da Mon Sep 17 00:00:00 2001 From: michael-hawker <24302614+michael-hawker@users.noreply.github.com> Date: Thu, 15 Dec 2022 16:27:40 -0800 Subject: [PATCH] Create new TransitionHelper experiment --- labs/TransitionHelper/TransitionHelper.sln | 288 ++++++++++++++++++ .../Dependencies.props | 31 ++ .../MultiTarget.props | 9 + .../TransitionHelper.Samples.csproj | 23 ++ .../TransitionHelper.md | 64 ++++ .../TransitionHelperCustomSample.xaml | 21 ++ .../TransitionHelperCustomSample.xaml.cs | 27 ++ .../TransitionHelperTemplatedSample.xaml | 16 + .../TransitionHelperTemplatedSample.xaml.cs | 24 ++ ...itionHelperTemplatedStyleCustomSample.xaml | 26 ++ ...onHelperTemplatedStyleCustomSample.xaml.cs | 24 ++ .../TransitionHelperXbindBackedSample.xaml | 16 + .../TransitionHelperXbindBackedSample.xaml.cs | 24 ++ ...ionHelperXbindBackedStyleCustomSample.xaml | 26 ++ ...HelperXbindBackedStyleCustomSample.xaml.cs | 24 ++ .../TransitionHelper.Uwp/Package.appxmanifest | 49 +++ .../Properties/Default.rd.xml | 31 ++ .../TransitionHelper.Uwp.csproj | 58 ++++ .../samples/TransitionHelper.Wasm/Program.cs | 19 ++ .../Properties/launchSettings.json | 27 ++ .../TransitionHelper.Wasm.csproj | 40 +++ .../WasmScripts/AppManifest.js | 5 + .../TransitionHelper.Wasm/wwwroot/web.config | 78 +++++ .../Package.appxmanifest | 49 +++ .../Properties/launchSettings.json | 10 + .../TransitionHelper.WinAppSdk.csproj | 46 +++ .../TransitionHelper.WinAppSdk/app.manifest | 15 + .../src/AdditionalAssemblyInfo.cs | 13 + ...Toolkit.Labs.WinUI.TransitionHelper.csproj | 25 ++ labs/TransitionHelper/src/Dependencies.props | 31 ++ labs/TransitionHelper/src/MultiTarget.props | 9 + labs/TransitionHelper/src/Themes/Generic.xaml | 10 + labs/TransitionHelper/src/TransitionHelper.cs | 108 +++++++ .../TransitionHelperStyle_ClassicBinding.xaml | 62 ++++ .../src/TransitionHelperStyle_xBind.xaml | 69 +++++ .../src/TransitionHelperStyle_xBind.xaml.cs | 20 ++ .../src/TransitionHelper_ClassicBinding.cs | 94 ++++++ .../src/TransitionHelper_xBind.cs | 71 +++++ .../Package.appxmanifest | 47 +++ .../Properties/Default.rd.xml | 29 ++ .../TransitionHelper.Tests.Uwp.csproj | 60 ++++ .../Package.appxmanifest | 48 +++ .../Properties/launchSettings.json | 10 + .../TransitionHelper.Tests.WinAppSdk.csproj | 43 +++ .../app.manifest | 15 + .../ExampleTransitionHelperTestClass.cs | 132 ++++++++ .../ExampleTransitionHelperTestPage.xaml | 14 + .../ExampleTransitionHelperTestPage.xaml.cs | 16 + .../TransitionHelper.Tests.projitems | 23 ++ .../TransitionHelper.Tests.shproj | 13 + 50 files changed, 2032 insertions(+) create mode 100644 labs/TransitionHelper/TransitionHelper.sln create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/Dependencies.props create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/MultiTarget.props create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelper.Samples.csproj create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelper.md create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperCustomSample.xaml create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperCustomSample.xaml.cs create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedSample.xaml create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedSample.xaml.cs create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedStyleCustomSample.xaml create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedStyleCustomSample.xaml.cs create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedSample.xaml create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedSample.xaml.cs create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedStyleCustomSample.xaml create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedStyleCustomSample.xaml.cs create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Uwp/Package.appxmanifest create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Uwp/Properties/Default.rd.xml create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Uwp/TransitionHelper.Uwp.csproj create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Wasm/Program.cs create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Wasm/Properties/launchSettings.json create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Wasm/TransitionHelper.Wasm.csproj create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Wasm/WasmScripts/AppManifest.js create mode 100644 labs/TransitionHelper/samples/TransitionHelper.Wasm/wwwroot/web.config create mode 100644 labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/Package.appxmanifest create mode 100644 labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/Properties/launchSettings.json create mode 100644 labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/TransitionHelper.WinAppSdk.csproj create mode 100644 labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/app.manifest create mode 100644 labs/TransitionHelper/src/AdditionalAssemblyInfo.cs create mode 100644 labs/TransitionHelper/src/CommunityToolkit.Labs.WinUI.TransitionHelper.csproj create mode 100644 labs/TransitionHelper/src/Dependencies.props create mode 100644 labs/TransitionHelper/src/MultiTarget.props create mode 100644 labs/TransitionHelper/src/Themes/Generic.xaml create mode 100644 labs/TransitionHelper/src/TransitionHelper.cs create mode 100644 labs/TransitionHelper/src/TransitionHelperStyle_ClassicBinding.xaml create mode 100644 labs/TransitionHelper/src/TransitionHelperStyle_xBind.xaml create mode 100644 labs/TransitionHelper/src/TransitionHelperStyle_xBind.xaml.cs create mode 100644 labs/TransitionHelper/src/TransitionHelper_ClassicBinding.cs create mode 100644 labs/TransitionHelper/src/TransitionHelper_xBind.cs create mode 100644 labs/TransitionHelper/tests/TransitionHelper.Tests.Uwp/Package.appxmanifest create mode 100644 labs/TransitionHelper/tests/TransitionHelper.Tests.Uwp/Properties/Default.rd.xml create mode 100644 labs/TransitionHelper/tests/TransitionHelper.Tests.Uwp/TransitionHelper.Tests.Uwp.csproj create mode 100644 labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/Package.appxmanifest create mode 100644 labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/Properties/launchSettings.json create mode 100644 labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/TransitionHelper.Tests.WinAppSdk.csproj create mode 100644 labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/app.manifest create mode 100644 labs/TransitionHelper/tests/TransitionHelper.Tests/ExampleTransitionHelperTestClass.cs create mode 100644 labs/TransitionHelper/tests/TransitionHelper.Tests/ExampleTransitionHelperTestPage.xaml create mode 100644 labs/TransitionHelper/tests/TransitionHelper.Tests/ExampleTransitionHelperTestPage.xaml.cs create mode 100644 labs/TransitionHelper/tests/TransitionHelper.Tests/TransitionHelper.Tests.projitems create mode 100644 labs/TransitionHelper/tests/TransitionHelper.Tests/TransitionHelper.Tests.shproj diff --git a/labs/TransitionHelper/TransitionHelper.sln b/labs/TransitionHelper/TransitionHelper.sln new file mode 100644 index 000000000..92cc9c7ce --- /dev/null +++ b/labs/TransitionHelper/TransitionHelper.sln @@ -0,0 +1,288 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31919.166 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Labs.WinUI.TransitionHelper", "src\CommunityToolkit.Labs.WinUI.TransitionHelper.csproj", "{9E5EF0F9-0114-40F3-BF5F-99A6F515B531}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TransitionHelper.Uwp", "samples\TransitionHelper.Uwp\TransitionHelper.Uwp.csproj", "{B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransitionHelper.Samples", "samples\TransitionHelper.Samples\TransitionHelper.Samples.csproj", "{6ADE6F67-650F-4507-B300-C58333567207}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Platforms", "Platforms", "{D7B43A92-F6D1-4829-A38F-685C8A721203}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransitionHelper.WinAppSdk", "samples\TransitionHelper.WinAppSdk\TransitionHelper.WinAppSdk.csproj", "{383F0C84-4BFA-4278-9154-DD10CCB2C710}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Labs.Core.SourceGenerators", "..\..\common\CommunityToolkit.Labs.Core.SourceGenerators\CommunityToolkit.Labs.Core.SourceGenerators.csproj", "{66E6DA8A-FEFC-4221-A476-4314A4D692F6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Labs.Core.SourceGenerators.XamlNamedPropertyRelay", "..\..\common\CommunityToolkit.Labs.Core.SourceGenerators.XamlNamedPropertyRelay\CommunityToolkit.Labs.Core.SourceGenerators.XamlNamedPropertyRelay.csproj", "{7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{431E0573-D09B-49D1-B118-CB9D8B185556}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TransitionHelper.Tests", "tests\TransitionHelper.Tests\TransitionHelper.Tests.shproj", "{F2D39FE2-BDFC-4E8C-9948-272F5272F936}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransitionHelper.Tests.WinAppSdk", "tests\TransitionHelper.Tests.WinAppSdk\TransitionHelper.Tests.WinAppSdk.csproj", "{D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TransitionHelper.Tests.Uwp", "tests\TransitionHelper.Tests.Uwp\TransitionHelper.Tests.Uwp.csproj", "{EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Labs Dependencies", "Labs Dependencies", "{951E11E2-F28C-4865-8880-3566205F74C6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Labs.Core.SourceGenerators.LabsUITestMethod", "..\..\common\CommunityToolkit.Labs.Core.SourceGenerators.LabsUITestMethod\CommunityToolkit.Labs.Core.SourceGenerators.LabsUITestMethod.csproj", "{79F79471-9947-45F5-81FE-4EBE2B8D0B1D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Debug|ARM.ActiveCfg = Debug|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Debug|ARM.Build.0 = Debug|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Debug|ARM64.Build.0 = Debug|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Debug|x64.ActiveCfg = Debug|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Debug|x64.Build.0 = Debug|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Debug|x86.ActiveCfg = Debug|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Debug|x86.Build.0 = Debug|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Release|Any CPU.Build.0 = Release|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Release|ARM.ActiveCfg = Release|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Release|ARM.Build.0 = Release|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Release|ARM64.ActiveCfg = Release|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Release|ARM64.Build.0 = Release|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Release|x64.ActiveCfg = Release|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Release|x64.Build.0 = Release|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Release|x86.ActiveCfg = Release|Any CPU + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531}.Release|x86.Build.0 = Release|Any CPU + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|Any CPU.ActiveCfg = Debug|x64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|Any CPU.Build.0 = Debug|x64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|Any CPU.Deploy.0 = Debug|x64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|ARM.ActiveCfg = Debug|ARM + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|ARM.Build.0 = Debug|ARM + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|ARM.Deploy.0 = Debug|ARM + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|ARM64.Build.0 = Debug|ARM64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|x64.ActiveCfg = Debug|x64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|x64.Build.0 = Debug|x64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|x64.Deploy.0 = Debug|x64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|x86.ActiveCfg = Debug|x86 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|x86.Build.0 = Debug|x86 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Debug|x86.Deploy.0 = Debug|x86 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|Any CPU.ActiveCfg = Release|x64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|Any CPU.Build.0 = Release|x64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|Any CPU.Deploy.0 = Release|x64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|ARM.ActiveCfg = Release|ARM + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|ARM.Build.0 = Release|ARM + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|ARM.Deploy.0 = Release|ARM + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|ARM64.ActiveCfg = Release|ARM64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|ARM64.Build.0 = Release|ARM64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|ARM64.Deploy.0 = Release|ARM64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|x64.ActiveCfg = Release|x64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|x64.Build.0 = Release|x64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|x64.Deploy.0 = Release|x64 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|x86.ActiveCfg = Release|x86 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|x86.Build.0 = Release|x86 + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662}.Release|x86.Deploy.0 = Release|x86 + {6ADE6F67-650F-4507-B300-C58333567207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Debug|ARM.ActiveCfg = Debug|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Debug|ARM.Build.0 = Debug|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Debug|ARM64.Build.0 = Debug|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Debug|x64.ActiveCfg = Debug|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Debug|x64.Build.0 = Debug|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Debug|x86.ActiveCfg = Debug|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Debug|x86.Build.0 = Debug|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Release|Any CPU.Build.0 = Release|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Release|ARM.ActiveCfg = Release|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Release|ARM.Build.0 = Release|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Release|ARM64.ActiveCfg = Release|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Release|ARM64.Build.0 = Release|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Release|x64.ActiveCfg = Release|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Release|x64.Build.0 = Release|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Release|x86.ActiveCfg = Release|Any CPU + {6ADE6F67-650F-4507-B300-C58333567207}.Release|x86.Build.0 = Release|Any CPU + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|Any CPU.ActiveCfg = Debug|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|Any CPU.Build.0 = Debug|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|Any CPU.Deploy.0 = Debug|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|ARM.ActiveCfg = Debug|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|ARM.Build.0 = Debug|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|ARM.Deploy.0 = Debug|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|ARM64.ActiveCfg = Debug|arm64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|ARM64.Build.0 = Debug|arm64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|ARM64.Deploy.0 = Debug|arm64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|x64.ActiveCfg = Debug|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|x64.Build.0 = Debug|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|x64.Deploy.0 = Debug|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|x86.ActiveCfg = Debug|x86 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|x86.Build.0 = Debug|x86 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Debug|x86.Deploy.0 = Debug|x86 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|Any CPU.ActiveCfg = Release|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|Any CPU.Build.0 = Release|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|Any CPU.Deploy.0 = Release|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|ARM.ActiveCfg = Release|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|ARM.Build.0 = Release|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|ARM.Deploy.0 = Release|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|ARM64.ActiveCfg = Release|arm64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|ARM64.Build.0 = Release|arm64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|ARM64.Deploy.0 = Release|arm64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|x64.ActiveCfg = Release|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|x64.Build.0 = Release|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|x64.Deploy.0 = Release|x64 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|x86.ActiveCfg = Release|x86 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|x86.Build.0 = Release|x86 + {383F0C84-4BFA-4278-9154-DD10CCB2C710}.Release|x86.Deploy.0 = Release|x86 + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Debug|ARM.ActiveCfg = Debug|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Debug|ARM.Build.0 = Debug|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Debug|ARM64.Build.0 = Debug|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Debug|x64.ActiveCfg = Debug|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Debug|x64.Build.0 = Debug|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Debug|x86.ActiveCfg = Debug|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Debug|x86.Build.0 = Debug|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Release|Any CPU.Build.0 = Release|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Release|ARM.ActiveCfg = Release|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Release|ARM.Build.0 = Release|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Release|ARM64.ActiveCfg = Release|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Release|ARM64.Build.0 = Release|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Release|x64.ActiveCfg = Release|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Release|x64.Build.0 = Release|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Release|x86.ActiveCfg = Release|Any CPU + {66E6DA8A-FEFC-4221-A476-4314A4D692F6}.Release|x86.Build.0 = Release|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Debug|ARM.ActiveCfg = Debug|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Debug|ARM.Build.0 = Debug|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Debug|ARM64.Build.0 = Debug|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Debug|x64.ActiveCfg = Debug|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Debug|x64.Build.0 = Debug|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Debug|x86.ActiveCfg = Debug|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Debug|x86.Build.0 = Debug|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Release|Any CPU.Build.0 = Release|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Release|ARM.ActiveCfg = Release|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Release|ARM.Build.0 = Release|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Release|ARM64.ActiveCfg = Release|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Release|ARM64.Build.0 = Release|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Release|x64.ActiveCfg = Release|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Release|x64.Build.0 = Release|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Release|x86.ActiveCfg = Release|Any CPU + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91}.Release|x86.Build.0 = Release|Any CPU + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|Any CPU.ActiveCfg = Debug|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|Any CPU.Build.0 = Debug|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|Any CPU.Deploy.0 = Debug|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|ARM.ActiveCfg = Debug|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|ARM.Build.0 = Debug|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|ARM.Deploy.0 = Debug|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|ARM64.ActiveCfg = Debug|arm64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|ARM64.Build.0 = Debug|arm64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|ARM64.Deploy.0 = Debug|arm64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|x64.ActiveCfg = Debug|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|x64.Build.0 = Debug|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|x64.Deploy.0 = Debug|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|x86.ActiveCfg = Debug|x86 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|x86.Build.0 = Debug|x86 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Debug|x86.Deploy.0 = Debug|x86 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|Any CPU.ActiveCfg = Release|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|Any CPU.Build.0 = Release|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|Any CPU.Deploy.0 = Release|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|ARM.ActiveCfg = Release|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|ARM.Build.0 = Release|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|ARM.Deploy.0 = Release|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|ARM64.ActiveCfg = Release|arm64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|ARM64.Build.0 = Release|arm64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|ARM64.Deploy.0 = Release|arm64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|x64.ActiveCfg = Release|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|x64.Build.0 = Release|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|x64.Deploy.0 = Release|x64 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|x86.ActiveCfg = Release|x86 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|x86.Build.0 = Release|x86 + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6}.Release|x86.Deploy.0 = Release|x86 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|Any CPU.ActiveCfg = Debug|x64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|Any CPU.Build.0 = Debug|x64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|Any CPU.Deploy.0 = Debug|x64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|ARM.ActiveCfg = Debug|ARM + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|ARM.Build.0 = Debug|ARM + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|ARM.Deploy.0 = Debug|ARM + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|ARM64.Build.0 = Debug|ARM64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|x64.ActiveCfg = Debug|x64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|x64.Build.0 = Debug|x64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|x64.Deploy.0 = Debug|x64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|x86.ActiveCfg = Debug|x86 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|x86.Build.0 = Debug|x86 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Debug|x86.Deploy.0 = Debug|x86 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|Any CPU.ActiveCfg = Release|x64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|Any CPU.Build.0 = Release|x64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|Any CPU.Deploy.0 = Release|x64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|ARM.ActiveCfg = Release|ARM + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|ARM.Build.0 = Release|ARM + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|ARM.Deploy.0 = Release|ARM + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|ARM64.ActiveCfg = Release|ARM64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|ARM64.Build.0 = Release|ARM64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|ARM64.Deploy.0 = Release|ARM64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|x64.ActiveCfg = Release|x64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|x64.Build.0 = Release|x64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|x64.Deploy.0 = Release|x64 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|x86.ActiveCfg = Release|x86 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|x86.Build.0 = Release|x86 + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08}.Release|x86.Deploy.0 = Release|x86 + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Debug|ARM.ActiveCfg = Debug|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Debug|ARM.Build.0 = Debug|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Debug|ARM64.Build.0 = Debug|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Debug|x64.ActiveCfg = Debug|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Debug|x64.Build.0 = Debug|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Debug|x86.ActiveCfg = Debug|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Debug|x86.Build.0 = Debug|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Release|Any CPU.Build.0 = Release|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Release|ARM.ActiveCfg = Release|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Release|ARM.Build.0 = Release|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Release|ARM64.ActiveCfg = Release|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Release|ARM64.Build.0 = Release|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Release|x64.ActiveCfg = Release|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Release|x64.Build.0 = Release|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Release|x86.ActiveCfg = Release|Any CPU + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662} = {D7B43A92-F6D1-4829-A38F-685C8A721203} + {383F0C84-4BFA-4278-9154-DD10CCB2C710} = {D7B43A92-F6D1-4829-A38F-685C8A721203} + {66E6DA8A-FEFC-4221-A476-4314A4D692F6} = {951E11E2-F28C-4865-8880-3566205F74C6} + {7A1E5FBF-B51A-4B56-8EA3-6AB56A7E9D91} = {951E11E2-F28C-4865-8880-3566205F74C6} + {D97DEFEA-EBCA-48DF-B23B-9639EA4381B6} = {431E0573-D09B-49D1-B118-CB9D8B185556} + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08} = {431E0573-D09B-49D1-B118-CB9D8B185556} + {79F79471-9947-45F5-81FE-4EBE2B8D0B1D} = {951E11E2-F28C-4865-8880-3566205F74C6} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B859CC05-1635-40E2-B0A1-2FCCEC77630E} + EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\..\common\CommunityToolkit.Labs.Shared\CommunityToolkit.Labs.Shared.projitems*{b782ee06-7a07-49ad-8c9f-9ebceb0e2662}*SharedItemsImports = 4 + tests\TransitionHelper.Tests\TransitionHelper.Tests.projitems*{d97defea-ebca-48df-b23b-9639ea4381b6}*SharedItemsImports = 5 + tests\TransitionHelper.Tests\TransitionHelper.Tests.projitems*{ef89b84d-3963-41aa-a3ca-9b84ce4b5c08}*SharedItemsImports = 4 + tests\TransitionHelper.Tests\TransitionHelper.Tests.projitems*{f2d39fe2-bdfc-4e8c-9948-272f5272f936}*SharedItemsImports = 13 + EndGlobalSection +EndGlobal diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/Dependencies.props b/labs/TransitionHelper/samples/TransitionHelper.Samples/Dependencies.props new file mode 100644 index 000000000..e622e1df4 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/Dependencies.props @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/MultiTarget.props b/labs/TransitionHelper/samples/TransitionHelper.Samples/MultiTarget.props new file mode 100644 index 000000000..da7a3d596 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/MultiTarget.props @@ -0,0 +1,9 @@ + + + + uwp;wasdk + + diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelper.Samples.csproj b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelper.Samples.csproj new file mode 100644 index 000000000..10b2ca7b5 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelper.Samples.csproj @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + TransitionHelperExperiment.Samples + TransitionHelperExperiment.Samples + + + + + + + + diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelper.md b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelper.md new file mode 100644 index 000000000..485b361c9 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelper.md @@ -0,0 +1,64 @@ +--- +title: TransitionHelper +author: githubaccount +description: TODO: Your experiment's description here +keywords: TransitionHelper, Control, Layout +dev_langs: + - csharp +category: Controls +subcategory: Layout +discussion-id: 0 +issue-id: 0 +--- + + + + + + + + + +# TransitionHelper + +TODO: Fill in information about this experiment and how to get started here... + +## Custom Control + +You can inherit from an existing component as well, like `Panel`, this example shows a control without a +XAML Style that will be more light-weight to consume by an app developer: + +> [!Sample TransitionHelperCustomSample] + +## Templated Controls + +The Toolkit is built with templated controls. This provides developers a flexible way to restyle components +easily while still inheriting the general functionality a control provides. The examples below show +how a component can use a default style and then get overridden by the end developer. + +TODO: Two types of templated control building methods are shown. Delete these if you're building a custom component. +Otherwise, pick one method for your component and delete the files related to the unchosen `_ClassicBinding` or `_xBind` +classes (and the custom non-suffixed one as well). Then, rename your component to just be your component name. + +The `_ClassicBinding` class shows the traditional method used to develop components with best practices. + +### Implict style + +> [!SAMPLE TransitionHelperTemplatedSample] + +### Custom style + +> [!SAMPLE TransitionHelperTemplatedStyleCustomSample] + +## Templated Controls with x:Bind + +This is an _experimental_ new way to define components which allows for the use of x:Bind within the style. + +### Implict style + +> [!SAMPLE TransitionHelperXbindBackedSample] + +### Custom style + +> [!SAMPLE TransitionHelperXbindBackedStyleCustomSample] + diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperCustomSample.xaml b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperCustomSample.xaml new file mode 100644 index 000000000..a237bd8fe --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperCustomSample.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperCustomSample.xaml.cs b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperCustomSample.xaml.cs new file mode 100644 index 000000000..01740f754 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperCustomSample.xaml.cs @@ -0,0 +1,27 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace TransitionHelperExperiment.Samples; + +/// +/// An example sample page of a custom control inheriting from Panel. +/// +[ToolkitSampleMultiChoiceOption("LayoutOrientation", title: "Orientation", "Horizontal", "Vertical")] + +[ToolkitSample(id: nameof(TransitionHelperCustomSample), "Custom control", description: $"A sample for showing how to create and use a {nameof(TransitionHelper)} custom control.")] +public sealed partial class TransitionHelperCustomSample : Page +{ + public TransitionHelperCustomSample() + { + this.InitializeComponent(); + } + + // TODO: See https://github.com/CommunityToolkit/Labs-Windows/issues/149 + public static Orientation ConvertStringToOrientation(string orientation) => orientation switch + { + "Vertical" => Orientation.Vertical, + "Horizontal" => Orientation.Horizontal, + _ => throw new System.NotImplementedException(), + }; +} diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedSample.xaml b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedSample.xaml new file mode 100644 index 000000000..00cf16c13 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedSample.xaml @@ -0,0 +1,16 @@ + + + + + + + diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedSample.xaml.cs b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedSample.xaml.cs new file mode 100644 index 000000000..a917a6239 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedSample.xaml.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace TransitionHelperExperiment.Samples; + +[ToolkitSampleBoolOption("IsTextVisible", "IsVisible", true)] +// Single values without a colon are used for both label and value. +// To provide a different label for the value, separate with a colon surrounded by a single space on both sides ("label : value"). +[ToolkitSampleMultiChoiceOption("TextSize", title: "Text size", "Small : 12", "Normal : 16", "Big : 32")] +[ToolkitSampleMultiChoiceOption("TextFontFamily", title: "Font family", "Segoe UI", "Arial", "Consolas")] +[ToolkitSampleMultiChoiceOption("TextForeground", title: "Text foreground", + "Teal : #0ddc8c", + "Sand : #e7a676", + "Dull green : #5d7577")] + +[ToolkitSample(id: nameof(TransitionHelperTemplatedSample), "Templated control", description: "A sample for showing how to create and use a templated control.")] +public sealed partial class TransitionHelperTemplatedSample : Page +{ + public TransitionHelperTemplatedSample() + { + this.InitializeComponent(); + } +} diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedStyleCustomSample.xaml b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedStyleCustomSample.xaml new file mode 100644 index 000000000..477899de8 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedStyleCustomSample.xaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedStyleCustomSample.xaml.cs b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedStyleCustomSample.xaml.cs new file mode 100644 index 000000000..fae83df31 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperTemplatedStyleCustomSample.xaml.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace TransitionHelperExperiment.Samples; + +[ToolkitSampleBoolOption("IsTextVisible", "IsVisible", true)] +// Single values without a colon are used for both label and value. +// To provide a different label for the value, separate with a colon surrounded by a single space on both sides ("label : value"). +[ToolkitSampleMultiChoiceOption("TextSize", title: "Text size", "Small : 12", "Normal : 16", "Big : 32")] +[ToolkitSampleMultiChoiceOption("TextFontFamily", title: "Font family", "Segoe UI", "Arial", "Consolas")] +[ToolkitSampleMultiChoiceOption("TextForeground", title: "Text foreground", + "Teal : #0ddc8c", + "Sand : #e7a676", + "Dull green : #5d7577")] + +[ToolkitSample(id: nameof(TransitionHelperTemplatedStyleCustomSample), "Templated control (restyled)", description: "A sample for showing how to create a use and templated control with a custom style.")] +public sealed partial class TransitionHelperTemplatedStyleCustomSample : Page +{ + public TransitionHelperTemplatedStyleCustomSample() + { + this.InitializeComponent(); + } +} diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedSample.xaml b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedSample.xaml new file mode 100644 index 000000000..f5476a392 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedSample.xaml @@ -0,0 +1,16 @@ + + + + + + + diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedSample.xaml.cs b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedSample.xaml.cs new file mode 100644 index 000000000..e22a4a199 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedSample.xaml.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace TransitionHelperExperiment.Samples; + +[ToolkitSampleBoolOption("IsTextVisible", "IsVisible", true)] +// Single values without a colon are used for both label and value. +// To provide a different label for the value, separate with a colon surrounded by a single space on both sides ("label : value"). +[ToolkitSampleMultiChoiceOption("TextSize", title: "Text size", "Small : 12", "Normal : 16", "Big : 32")] +[ToolkitSampleMultiChoiceOption("TextFontFamily", title: "Font family", "Segoe UI", "Arial", "Consolas")] +[ToolkitSampleMultiChoiceOption("TextForeground", title: "Text foreground", + "Teal : #0ddc8c", + "Sand : #e7a676", + "Dull green : #5d7577")] + +[ToolkitSample(id: nameof(TransitionHelperXbindBackedSample), "Backed templated control", description: "A sample for showing how to create and use a templated control with a backed resource dictionary.")] +public sealed partial class TransitionHelperXbindBackedSample : Page +{ + public TransitionHelperXbindBackedSample() + { + this.InitializeComponent(); + } +} diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedStyleCustomSample.xaml b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedStyleCustomSample.xaml new file mode 100644 index 000000000..1cc8e6630 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedStyleCustomSample.xaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + diff --git a/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedStyleCustomSample.xaml.cs b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedStyleCustomSample.xaml.cs new file mode 100644 index 000000000..a184806db --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Samples/TransitionHelperXbindBackedStyleCustomSample.xaml.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace TransitionHelperExperiment.Samples; + +[ToolkitSampleBoolOption("IsTextVisible", "IsVisible", true)] +// Single values without a colon are used for both label and value. +// To provide a different label for the value, separate with a colon surrounded by a single space on both sides ("label : value"). +[ToolkitSampleMultiChoiceOption("TextSize", title: "Text size", "Small : 12", "Normal : 16", "Big : 32")] +[ToolkitSampleMultiChoiceOption("TextFontFamily", title: "Font family", "Segoe UI", "Arial", "Consolas")] +[ToolkitSampleMultiChoiceOption("TextForeground", title: "Text foreground", + "Teal : #0ddc8c", + "Sand : #e7a676", + "Dull green : #5d7577")] + +[ToolkitSample(id: nameof(TransitionHelperXbindBackedStyleCustomSample), "Backed templated control (restyled)", description: "A sample for showing how to create and use a templated control with a backed resource dictionary and a custom style.")] +public sealed partial class TransitionHelperXbindBackedStyleCustomSample : Page +{ + public TransitionHelperXbindBackedStyleCustomSample() + { + this.InitializeComponent(); + } +} diff --git a/labs/TransitionHelper/samples/TransitionHelper.Uwp/Package.appxmanifest b/labs/TransitionHelper/samples/TransitionHelper.Uwp/Package.appxmanifest new file mode 100644 index 000000000..a77ad8ed6 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Uwp/Package.appxmanifest @@ -0,0 +1,49 @@ + + + + + + + + + + CommunityToolkit Labs: TransitionHelper Samples (UWP) + CommunityToolkit + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/labs/TransitionHelper/samples/TransitionHelper.Uwp/Properties/Default.rd.xml b/labs/TransitionHelper/samples/TransitionHelper.Uwp/Properties/Default.rd.xml new file mode 100644 index 000000000..af00722cd --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Uwp/Properties/Default.rd.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/labs/TransitionHelper/samples/TransitionHelper.Uwp/TransitionHelper.Uwp.csproj b/labs/TransitionHelper/samples/TransitionHelper.Uwp/TransitionHelper.Uwp.csproj new file mode 100644 index 000000000..9b1c4b71c --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Uwp/TransitionHelper.Uwp.csproj @@ -0,0 +1,58 @@ + + + + + + + + true + false + false + false + false + false + false + false + true + false + false + false + false + false + false + false + + + + + + + + + + + TransitionHelperExperiment.Samples + TransitionHelperExperiment.Samples.Uwp + {B782EE06-7A07-49AD-8C9F-9EBCEB0E2662} + + + + + + + Designer + + + + + {9E5EF0F9-0114-40F3-BF5F-99A6F515B531} + CommunityToolkit.Labs.WinUI.TransitionHelper + + + {6ADE6F67-650F-4507-B300-C58333567207} + TransitionHelper.Sample + + + + + \ No newline at end of file diff --git a/labs/TransitionHelper/samples/TransitionHelper.Wasm/Program.cs b/labs/TransitionHelper/samples/TransitionHelper.Wasm/Program.cs new file mode 100644 index 000000000..5c93e1c85 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Wasm/Program.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using CommunityToolkit.Labs.Shared; + +namespace TransitionHelperExperiment.Samples.Wasm; + +public class Program +{ + private static App? _app; + + static int Main(string[] args) + { + Application.Start(_ => _app = new App()); + + return 0; + } +} diff --git a/labs/TransitionHelper/samples/TransitionHelper.Wasm/Properties/launchSettings.json b/labs/TransitionHelper/samples/TransitionHelper.Wasm/Properties/launchSettings.json new file mode 100644 index 000000000..6b19d0ac5 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Wasm/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53947/", + "sslPort": 44324 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "TransitionHelper.Wasm": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} diff --git a/labs/TransitionHelper/samples/TransitionHelper.Wasm/TransitionHelper.Wasm.csproj b/labs/TransitionHelper/samples/TransitionHelper.Wasm/TransitionHelper.Wasm.csproj new file mode 100644 index 000000000..9642ee91d --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Wasm/TransitionHelper.Wasm.csproj @@ -0,0 +1,40 @@ + + + + + true + true + true + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + diff --git a/labs/TransitionHelper/samples/TransitionHelper.Wasm/WasmScripts/AppManifest.js b/labs/TransitionHelper/samples/TransitionHelper.Wasm/WasmScripts/AppManifest.js new file mode 100644 index 000000000..da969030b --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Wasm/WasmScripts/AppManifest.js @@ -0,0 +1,5 @@ +var UnoAppManifest = { + splashScreenImage: "Assets/SplashScreen.png", + splashScreenColor: "#fff", + displayName: "Labs: TransitionHelper" +} diff --git a/labs/TransitionHelper/samples/TransitionHelper.Wasm/wwwroot/web.config b/labs/TransitionHelper/samples/TransitionHelper.Wasm/wwwroot/web.config new file mode 100644 index 000000000..8f5a860f5 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.Wasm/wwwroot/web.config @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/Package.appxmanifest b/labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/Package.appxmanifest new file mode 100644 index 000000000..9fd70b9e2 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/Package.appxmanifest @@ -0,0 +1,49 @@ + + + + + + + + CommunityToolkit Labs: TransitionHelper Samples (WinAppSdk) + CommunityToolkit + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/Properties/launchSettings.json b/labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/Properties/launchSettings.json new file mode 100644 index 000000000..f06823289 --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "Local machine (Packaged)": { + "commandName": "MsixPackage" + }, + "Local machine (Unpackaged)": { + "commandName": "Project" + } + } +} \ No newline at end of file diff --git a/labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/TransitionHelper.WinAppSdk.csproj b/labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/TransitionHelper.WinAppSdk.csproj new file mode 100644 index 000000000..2825d873f --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/TransitionHelper.WinAppSdk.csproj @@ -0,0 +1,46 @@ + + + + + true + false + false + false + false + false + false + false + false + true + false + false + false + false + false + false + + + + + + + + + + + TransitionHelperExperiment.Samples + TransitionHelperExperiment.Samples.WinAppSdk + + + + + + + + + + + + diff --git a/labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/app.manifest b/labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/app.manifest new file mode 100644 index 000000000..04ff2978a --- /dev/null +++ b/labs/TransitionHelper/samples/TransitionHelper.WinAppSdk/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/labs/TransitionHelper/src/AdditionalAssemblyInfo.cs b/labs/TransitionHelper/src/AdditionalAssemblyInfo.cs new file mode 100644 index 000000000..79bbf3e5d --- /dev/null +++ b/labs/TransitionHelper/src/AdditionalAssemblyInfo.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Runtime.CompilerServices; + +// These `InternalsVisibleTo` calls are intended to make it easier for +// for any internal code to be testable in all the different test projects +// used with the Labs infrastructure. +[assembly: InternalsVisibleTo("TransitionHelper.Tests.Uwp")] +[assembly: InternalsVisibleTo("TransitionHelper.Tests.WinAppSdk")] +[assembly: InternalsVisibleTo("CommunityToolkit.Labs.Tests.Uwp")] +[assembly: InternalsVisibleTo("CommunityToolkit.Labs.Tests.WinAppSdk")] diff --git a/labs/TransitionHelper/src/CommunityToolkit.Labs.WinUI.TransitionHelper.csproj b/labs/TransitionHelper/src/CommunityToolkit.Labs.WinUI.TransitionHelper.csproj new file mode 100644 index 000000000..67e392694 --- /dev/null +++ b/labs/TransitionHelper/src/CommunityToolkit.Labs.WinUI.TransitionHelper.csproj @@ -0,0 +1,25 @@ + + + + + + + + + + + + + CommunityToolkit.Labs.WinUI.TransitionHelperRns + + + + CommunityToolkit.Labs.$(PackageIdVariant).TransitionHelper + + This package contains TransitionHelper. + + 0.0.1 + + + + diff --git a/labs/TransitionHelper/src/Dependencies.props b/labs/TransitionHelper/src/Dependencies.props new file mode 100644 index 000000000..e622e1df4 --- /dev/null +++ b/labs/TransitionHelper/src/Dependencies.props @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/labs/TransitionHelper/src/MultiTarget.props b/labs/TransitionHelper/src/MultiTarget.props new file mode 100644 index 000000000..da7a3d596 --- /dev/null +++ b/labs/TransitionHelper/src/MultiTarget.props @@ -0,0 +1,9 @@ + + + + uwp;wasdk + + diff --git a/labs/TransitionHelper/src/Themes/Generic.xaml b/labs/TransitionHelper/src/Themes/Generic.xaml new file mode 100644 index 000000000..b728504c7 --- /dev/null +++ b/labs/TransitionHelper/src/Themes/Generic.xaml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/labs/TransitionHelper/src/TransitionHelper.cs b/labs/TransitionHelper/src/TransitionHelper.cs new file mode 100644 index 000000000..83b65af3b --- /dev/null +++ b/labs/TransitionHelper/src/TransitionHelper.cs @@ -0,0 +1,108 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace CommunityToolkit.Labs.WinUI; + +/// +/// This is an example control based off of the BoxPanel sample here: https://docs.microsoft.com/windows/apps/design/layout/boxpanel-example-custom-panel. If you need this similar sort of layout component for an application, see UniformGrid in the Toolkit. +/// It is provided as an example of how to inherit from another control like . +/// You can choose to start here or from the or example components. Remove unused components and rename as appropriate. +/// +public partial class TransitionHelper : Panel +{ + /// + /// Identifies the property. + /// + public static readonly DependencyProperty OrientationProperty = + DependencyProperty.Register(nameof(Orientation), typeof(Orientation), typeof(TransitionHelper), new PropertyMetadata(null, OnOrientationChanged)); + + /// + /// Gets the preference of the rows/columns when there are a non-square number of children. Defaults to Vertical. + /// + public Orientation Orientation + { + get { return (Orientation)GetValue(OrientationProperty); } + set { SetValue(OrientationProperty, value); } + } + + // Invalidate our layout when the property changes. + private static void OnOrientationChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) + { + if (dependencyObject is TransitionHelper panel) + { + panel.InvalidateMeasure(); + } + } + + // Store calculations we want to use between the Measure and Arrange methods. + int _columnCount; + double _cellWidth, _cellHeight; + + protected override Size MeasureOverride(Size availableSize) + { + // Determine the square that can contain this number of items. + var maxrc = (int)Math.Ceiling(Math.Sqrt(Children.Count)); + // Get an aspect ratio from availableSize, decides whether to trim row or column. + var aspectratio = availableSize.Width / availableSize.Height; + if (Orientation == Orientation.Vertical) { aspectratio = 1 / aspectratio; } + + int rowcount; + + // Now trim this square down to a rect, many times an entire row or column can be omitted. + if (aspectratio > 1) + { + rowcount = maxrc; + _columnCount = (maxrc > 2 && Children.Count <= maxrc * (maxrc - 1)) ? maxrc - 1 : maxrc; + } + else + { + rowcount = (maxrc > 2 && Children.Count <= maxrc * (maxrc - 1)) ? maxrc - 1 : maxrc; + _columnCount = maxrc; + } + + // Now that we have a column count, divide available horizontal, that's our cell width. + _cellWidth = (int)Math.Floor(availableSize.Width / _columnCount); + // Next get a cell height, same logic of dividing available vertical by rowcount. + _cellHeight = Double.IsInfinity(availableSize.Height) ? Double.PositiveInfinity : availableSize.Height / rowcount; + + double maxcellheight = 0; + + foreach (UIElement child in Children) + { + child.Measure(new Size(_cellWidth, _cellHeight)); + maxcellheight = (child.DesiredSize.Height > maxcellheight) ? child.DesiredSize.Height : maxcellheight; + } + + return LimitUnboundedSize(availableSize, maxcellheight); + } + + // This method limits the panel height when no limit is imposed by the panel's parent. + // That can happen to height if the panel is close to the root of main app window. + // In this case, base the height of a cell on the max height from desired size + // and base the height of the panel on that number times the #rows. + Size LimitUnboundedSize(Size input, double maxcellheight) + { + if (Double.IsInfinity(input.Height)) + { + input.Height = maxcellheight * _columnCount; + _cellHeight = maxcellheight; + } + return input; + } + + protected override Size ArrangeOverride(Size finalSize) + { + int count = 1; + double x, y; + foreach (UIElement child in Children) + { + x = (count - 1) % _columnCount * _cellWidth; + y = ((int)(count - 1) / _columnCount) * _cellHeight; + Point anchorPoint = new Point(x, y); + child.Arrange(new Rect(anchorPoint, child.DesiredSize)); + count++; + } + return finalSize; + } +} diff --git a/labs/TransitionHelper/src/TransitionHelperStyle_ClassicBinding.xaml b/labs/TransitionHelper/src/TransitionHelperStyle_ClassicBinding.xaml new file mode 100644 index 000000000..dfa7429fc --- /dev/null +++ b/labs/TransitionHelper/src/TransitionHelperStyle_ClassicBinding.xaml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + 4,4,4,4 + + + + + + + + diff --git a/labs/TransitionHelper/src/TransitionHelperStyle_xBind.xaml b/labs/TransitionHelper/src/TransitionHelperStyle_xBind.xaml new file mode 100644 index 000000000..73272c0be --- /dev/null +++ b/labs/TransitionHelper/src/TransitionHelperStyle_xBind.xaml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + 4,4,4,4 + + + + + + + + diff --git a/labs/TransitionHelper/src/TransitionHelperStyle_xBind.xaml.cs b/labs/TransitionHelper/src/TransitionHelperStyle_xBind.xaml.cs new file mode 100644 index 000000000..07dea2c4a --- /dev/null +++ b/labs/TransitionHelper/src/TransitionHelperStyle_xBind.xaml.cs @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace CommunityToolkit.Labs.WinUI; + +/// +/// Backing code for this resource dictionary. +/// +public sealed partial class TransitionHelperStyle_xBind : ResourceDictionary +{ + // NOTICE + // This file only exists to enable x:Bind in the resource dictionary. + // Do not add code here. + // Instead, add code-behind to your templated control. + public TransitionHelperStyle_xBind() + { + this.InitializeComponent(); + } +} diff --git a/labs/TransitionHelper/src/TransitionHelper_ClassicBinding.cs b/labs/TransitionHelper/src/TransitionHelper_ClassicBinding.cs new file mode 100644 index 000000000..07b452575 --- /dev/null +++ b/labs/TransitionHelper/src/TransitionHelper_ClassicBinding.cs @@ -0,0 +1,94 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace CommunityToolkit.Labs.WinUI; + +/// +/// An example templated control. +/// +[TemplatePart(Name = nameof(PART_HelloWorld), Type = typeof(TextBlock))] +public partial class TransitionHelper_ClassicBinding : Control +{ + /// + /// Creates a new instance of the class. + /// + public TransitionHelper_ClassicBinding() + { + this.DefaultStyleKey = typeof(TransitionHelper_ClassicBinding); + } + + /// + /// The primary text block that displays "Hello world". + /// + protected TextBlock? PART_HelloWorld { get; private set; } + + /// + protected override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + // Detach all attached events when a new template is applied. + if (PART_HelloWorld is not null) + { + PART_HelloWorld.PointerEntered -= Element_PointerEntered; + } + + // Attach events when the template is applied and the control is loaded. + PART_HelloWorld = GetTemplateChild(nameof(PART_HelloWorld)) as TextBlock; + + if (PART_HelloWorld is not null) + { + PART_HelloWorld.PointerEntered += Element_PointerEntered; + } + } + + /// + /// The backing for the property. + /// + public static readonly DependencyProperty ItemPaddingProperty = DependencyProperty.Register( + nameof(ItemPadding), + typeof(Thickness), + typeof(TransitionHelper_ClassicBinding), + new PropertyMetadata(defaultValue: new Thickness(0))); + + /// + /// The backing for the property. + /// + public static readonly DependencyProperty MyPropertyProperty = DependencyProperty.Register( + nameof(MyProperty), + typeof(string), + typeof(TransitionHelper_ClassicBinding), + new PropertyMetadata(defaultValue: string.Empty, (d, e) => ((TransitionHelper_ClassicBinding)d).OnMyPropertyChanged((string)e.OldValue, (string)e.NewValue))); + + /// + /// Gets or sets an example string. A basic DependencyProperty example. + /// + public string MyProperty + { + get => (string)GetValue(MyPropertyProperty); + set => SetValue(MyPropertyProperty, value); + } + + /// + /// Gets or sets a padding for an item. A basic DependencyProperty example. + /// + public Thickness ItemPadding + { + get => (Thickness)GetValue(ItemPaddingProperty); + set => SetValue(ItemPaddingProperty, value); + } + + protected virtual void OnMyPropertyChanged(string oldValue, string newValue) + { + // Do something with the changed value. + } + + public void Element_PointerEntered(object sender, PointerRoutedEventArgs e) + { + if (sender is TextBlock text) + { + text.Opacity = 1; + } + } +} diff --git a/labs/TransitionHelper/src/TransitionHelper_xBind.cs b/labs/TransitionHelper/src/TransitionHelper_xBind.cs new file mode 100644 index 000000000..86ba41222 --- /dev/null +++ b/labs/TransitionHelper/src/TransitionHelper_xBind.cs @@ -0,0 +1,71 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace CommunityToolkit.Labs.WinUI; + +/// +/// An example templated control. +/// +public partial class TransitionHelper_xBind: Control +{ + /// + /// Creates a new instance of the class. + /// + public TransitionHelper_xBind() + { + this.DefaultStyleKey = typeof(TransitionHelper_xBind); + + // Allows directly using this control as the x:DataType in the template. + this.DataContext = this; + } + + /// + /// The backing for the property. + /// + public static readonly DependencyProperty ItemPaddingProperty = DependencyProperty.Register( + nameof(ItemPadding), + typeof(Thickness), + typeof(TransitionHelper_xBind), + new PropertyMetadata(defaultValue: new Thickness(0))); + + /// + /// The backing for the property. + /// + public static readonly DependencyProperty MyPropertyProperty = DependencyProperty.Register( + nameof(MyProperty), + typeof(string), + typeof(TransitionHelper_xBind), + new PropertyMetadata(defaultValue: string.Empty, (d, e) => ((TransitionHelper_xBind)d).OnMyPropertyChanged((string)e.OldValue, (string)e.NewValue))); + + /// + /// Gets or sets an example string. A basic DependencyProperty example. + /// + public string MyProperty + { + get => (string)GetValue(MyPropertyProperty); + set => SetValue(MyPropertyProperty, value); + } + + /// + /// Gets or sets a padding for an item. A basic DependencyProperty example. + /// + public Thickness ItemPadding + { + get => (Thickness)GetValue(ItemPaddingProperty); + set => SetValue(ItemPaddingProperty, value); + } + + protected virtual void OnMyPropertyChanged(string oldValue, string newValue) + { + // Do something with the changed value. + } + + public void Element_PointerEntered(object sender, PointerRoutedEventArgs e) + { + if (sender is TextBlock text) + { + text.Opacity = 1; + } + } +} diff --git a/labs/TransitionHelper/tests/TransitionHelper.Tests.Uwp/Package.appxmanifest b/labs/TransitionHelper/tests/TransitionHelper.Tests.Uwp/Package.appxmanifest new file mode 100644 index 000000000..c7f59c328 --- /dev/null +++ b/labs/TransitionHelper/tests/TransitionHelper.Tests.Uwp/Package.appxmanifest @@ -0,0 +1,47 @@ + + + + + + + + + TransitionHelperExperiment.Tests.Uwp + CommunityToolkit + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/labs/TransitionHelper/tests/TransitionHelper.Tests.Uwp/Properties/Default.rd.xml b/labs/TransitionHelper/tests/TransitionHelper.Tests.Uwp/Properties/Default.rd.xml new file mode 100644 index 000000000..996a8392a --- /dev/null +++ b/labs/TransitionHelper/tests/TransitionHelper.Tests.Uwp/Properties/Default.rd.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/labs/TransitionHelper/tests/TransitionHelper.Tests.Uwp/TransitionHelper.Tests.Uwp.csproj b/labs/TransitionHelper/tests/TransitionHelper.Tests.Uwp/TransitionHelper.Tests.Uwp.csproj new file mode 100644 index 000000000..afbe82d60 --- /dev/null +++ b/labs/TransitionHelper/tests/TransitionHelper.Tests.Uwp/TransitionHelper.Tests.Uwp.csproj @@ -0,0 +1,60 @@ + + + + + + + + true + + + + + + + + + + + {EF89B84D-3963-41AA-A3CA-9B84CE4B5C08} + TransitionHelperExperiment.Tests + TransitionHelperExperiment.Tests.Uwp + $(VisualStudioVersion) + + + + + + Designer + + + + + Assets\LockScreenLogo.png + + + Assets\Square150x150Logo.png + + + Assets\Square44x44Logo.png + + + Assets\Square44x44Logo.targetsize-24_altform-unplated.png + + + Assets\StoreLogo.png + + + + + + + + + + + + + + + diff --git a/labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/Package.appxmanifest b/labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/Package.appxmanifest new file mode 100644 index 000000000..1a561d047 --- /dev/null +++ b/labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/Package.appxmanifest @@ -0,0 +1,48 @@ + + + + + + + + TransitionHelperExperiment.Tests.WinAppSdk + CommunityToolkit + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/Properties/launchSettings.json b/labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/Properties/launchSettings.json new file mode 100644 index 000000000..cd6019287 --- /dev/null +++ b/labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "TransitionHelper.Tests.WinAppSdk (Package)": { + "commandName": "MsixPackage" + }, + "TransitionHelper.Tests.WinAppSdk (Unpackaged)": { + "commandName": "Project" + } + } +} diff --git a/labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/TransitionHelper.Tests.WinAppSdk.csproj b/labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/TransitionHelper.Tests.WinAppSdk.csproj new file mode 100644 index 000000000..43d735dde --- /dev/null +++ b/labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/TransitionHelper.Tests.WinAppSdk.csproj @@ -0,0 +1,43 @@ + + + + + true + + + + + + + + + + + TransitionHelperExperiment.Tests + TransitionHelperExperiment.Tests.WinAppSdk + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/app.manifest b/labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/app.manifest new file mode 100644 index 000000000..da9bfe3b4 --- /dev/null +++ b/labs/TransitionHelper/tests/TransitionHelper.Tests.WinAppSdk/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/labs/TransitionHelper/tests/TransitionHelper.Tests/ExampleTransitionHelperTestClass.cs b/labs/TransitionHelper/tests/TransitionHelper.Tests/ExampleTransitionHelperTestClass.cs new file mode 100644 index 000000000..318d63eb2 --- /dev/null +++ b/labs/TransitionHelper/tests/TransitionHelper.Tests/ExampleTransitionHelperTestClass.cs @@ -0,0 +1,132 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using CommunityToolkit.Labs.Core.SourceGenerators.LabsUITestMethod; +using CommunityToolkit.Labs.Tests; + +namespace TransitionHelperExperiment.Tests; + +[TestClass] +public partial class ExampleTransitionHelperTestClass : VisualUITestBase +{ + // If you don't need access to UI objects directly or async code, use this pattern. + [TestMethod] + public void SimpleSynchronousExampleTest() + { + var assembly = typeof(TransitionHelper).Assembly; + var type = assembly.GetType(typeof(TransitionHelper).FullName ?? string.Empty); + + Assert.IsNotNull(type, "Could not find TransitionHelper type."); + Assert.AreEqual(typeof(TransitionHelper), type, "Type of TransitionHelper does not match expected type."); + } + + // If you don't need access to UI objects directly, use this pattern. + [TestMethod] + public async Task SimpleAsyncExampleTest() + { + await Task.Delay(250); + + Assert.IsTrue(true); + } + + // Example that shows how to check for exception throwing. + [TestMethod] + public void SimpleExceptionCheckTest() + { + // If you need to check exceptions occur for invalid inputs, etc... + // Use Assert.ThrowsException to limit the scope to where you expect the error to occur. + // Otherwise, using the ExpectedException attribute could swallow or + // catch other issues in setup code. + Assert.ThrowsException(() => throw new NotImplementedException()); + } + + // The LabsUITestMethod automatically dispatches to the UI for us to work with UI objects. + [LabsUITestMethod] + public void SimpleUIAttributeExampleTest() + { + var component = new TransitionHelper(); + Assert.IsNotNull(component); + } + + // The LabsUITestMethod can also easily grab a XAML Page for us by passing its type as a parameter. + // This lets us actually test a control as it would behave within an actual application. + // The page will already be loaded by the time your test is called. + [LabsUITestMethod] + public void SimpleUIExamplePageTest(ExampleTransitionHelperTestPage page) + { + // You can use the Toolkit Visual Tree helpers here to find the component by type or name: + var component = page.FindDescendant(); + + Assert.IsNotNull(component); + + var componentByName = page.FindDescendant("TransitionHelperControl"); + + Assert.IsNotNull(componentByName); + } + + // You can still do async work with a LabsUITestMethod as well. + [LabsUITestMethod] + public async Task SimpleAsyncUIExamplePageTest(ExampleTransitionHelperTestPage page) + { + // This helper can be used to wait for a rendering pass to complete. + await CompositionTargetHelper.ExecuteAfterCompositionRenderingAsync(() => { }); + + var component = page.FindDescendant(); + + Assert.IsNotNull(component); + } + + //// ----------------------------- ADVANCED TEST SCENARIOS ----------------------------- + + // If you need to use DataRow, you can use this pattern with the UI dispatch still. + // Otherwise, checkout the LabsUITestMethod attribute above. + // See https://github.com/CommunityToolkit/Labs-Windows/issues/186 + [TestMethod] + public async Task ComplexAsyncUIExampleTest() + { + await EnqueueAsync(() => + { + var component = new TransitionHelper_ClassicBinding(); + Assert.IsNotNull(component); + }); + } + + // If you want to load other content not within a XAML page using the LabsUITestMethod above. + // Then you can do that using the Load/UnloadTestContentAsync methods. + [TestMethod] + public async Task ComplexAsyncLoadUIExampleTest() + { + await EnqueueAsync(async () => + { + var component = new TransitionHelper_ClassicBinding(); + Assert.IsNotNull(component); + Assert.IsFalse(component.IsLoaded); + + await LoadTestContentAsync(component); + + Assert.IsTrue(component.IsLoaded); + + await UnloadTestContentAsync(component); + + Assert.IsFalse(component.IsLoaded); + }); + } + + // You can still use the LabsUITestMethod to remove the extra layer for the dispatcher as well: + [LabsUITestMethod] + public async Task ComplexAsyncLoadUIExampleWithoutDispatcherTest() + { + var component = new TransitionHelper_ClassicBinding(); + Assert.IsNotNull(component); + Assert.IsFalse(component.IsLoaded); + + await LoadTestContentAsync(component); + + Assert.IsTrue(component.IsLoaded); + + await UnloadTestContentAsync(component); + + Assert.IsFalse(component.IsLoaded); + } +} diff --git a/labs/TransitionHelper/tests/TransitionHelper.Tests/ExampleTransitionHelperTestPage.xaml b/labs/TransitionHelper/tests/TransitionHelper.Tests/ExampleTransitionHelperTestPage.xaml new file mode 100644 index 000000000..95de66cd8 --- /dev/null +++ b/labs/TransitionHelper/tests/TransitionHelper.Tests/ExampleTransitionHelperTestPage.xaml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/labs/TransitionHelper/tests/TransitionHelper.Tests/ExampleTransitionHelperTestPage.xaml.cs b/labs/TransitionHelper/tests/TransitionHelper.Tests/ExampleTransitionHelperTestPage.xaml.cs new file mode 100644 index 000000000..bb6ad7b9e --- /dev/null +++ b/labs/TransitionHelper/tests/TransitionHelper.Tests/ExampleTransitionHelperTestPage.xaml.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace TransitionHelperExperiment.Tests; + +/// +/// An empty page that can be used on its own or navigated to within a Frame. +/// +public sealed partial class ExampleTransitionHelperTestPage : Page +{ + public ExampleTransitionHelperTestPage() + { + this.InitializeComponent(); + } +} diff --git a/labs/TransitionHelper/tests/TransitionHelper.Tests/TransitionHelper.Tests.projitems b/labs/TransitionHelper/tests/TransitionHelper.Tests/TransitionHelper.Tests.projitems new file mode 100644 index 000000000..4b8288416 --- /dev/null +++ b/labs/TransitionHelper/tests/TransitionHelper.Tests/TransitionHelper.Tests.projitems @@ -0,0 +1,23 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + F2D39FE2-BDFC-4E8C-9948-272F5272F936 + + + TransitionHelperExperiment.Tests + + + + + ExampleTransitionHelperTestPage.xaml + + + + + Designer + MSBuild:Compile + + + \ No newline at end of file diff --git a/labs/TransitionHelper/tests/TransitionHelper.Tests/TransitionHelper.Tests.shproj b/labs/TransitionHelper/tests/TransitionHelper.Tests/TransitionHelper.Tests.shproj new file mode 100644 index 000000000..e375cccbc --- /dev/null +++ b/labs/TransitionHelper/tests/TransitionHelper.Tests/TransitionHelper.Tests.shproj @@ -0,0 +1,13 @@ + + + + F2D39FE2-BDFC-4E8C-9948-272F5272F936 + 14.0 + + + + + + + +