Skip to content

Commit

Permalink
Merge pull request #256 from Sergio0694/user/sergiopedri/modern-uwp-s…
Browse files Browse the repository at this point in the history
…upport

Add support for UWP on modern .NET
  • Loading branch information
Sergio0694 authored Nov 13, 2024
2 parents 663c0d1 + 60b92f6 commit 7c95cac
Show file tree
Hide file tree
Showing 14 changed files with 503 additions and 40 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/managed-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout XamlBehaviors.git
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install the .NET 8.0.400 SDK
uses: actions/setup-dotnet@v3
- name: Install the .NET 9.0.100 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.400
dotnet-version: 9.0.100

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The [documentation](https://github.com/Microsoft/XamlBehaviors/wiki) explains ho

#### What You Need

- [Visual Studio 2017 w/ Universal Windows Tools](https://visualstudio.microsoft.com/vs/features/universal-windows-platform/)
- [Visual Studio 2022 17.12+ w/ Universal Windows Tools](https://visualstudio.microsoft.com/vs/features/universal-windows-platform/)
- [Multilingual App Toolkit](https://developer.microsoft.com/en-us/windows/develop/multilingual-app-toolkit)

#### Clone the Repository
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ extends:
SourceFolder: out
Contents: '**\'
- task: UseDotNet@2
displayName: Use .NET Core sdk 8.0.400
displayName: Use .NET SDK 9.0.100
inputs:
version: 8.0.400
version: 9.0.100
performMultiLevelLookup: true
- task: NuGetToolInstaller@1
displayName: Use NuGet 6.x
Expand Down
28 changes: 28 additions & 0 deletions scripts/Microsoft.Xaml.Behaviors.Uwp.Managed.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
<iconUrl>http://go.microsoft.com/fwlink/?LinkID=708511</iconUrl>
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
<tags>Behavior Action Behaviors Actions Blend Managed C# Interaction Interactivity Interactions</tags>
<dependencies>
<group targetFramework="net8.0-windows10.0.18362" />
<group targetFramework="uap10.0" />
</dependencies>
<frameworkReferences>
<group targetFramework="net8.0-windows10.0.18362">
<frameworkReference name="Microsoft.Windows.SDK.NET.Ref.Xaml" />
</group>
</frameworkReferences>
</metadata>

<files>
Expand All @@ -25,16 +34,35 @@
<file target="lib\uap10.0\Microsoft.Xaml.Interactions.xml" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.xml" />
<file target="lib\uap10.0\Microsoft.Xaml.Interactions.pri" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.pri" />

<file target="lib\net8.0-windows10.0.18362.0\Microsoft.Xaml.Interactivity.dll" src="..\out\uwp\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.dll" />
<file target="lib\net8.0-windows10.0.18362.0\Microsoft.Xaml.Interactivity.pdb" src="..\out\uwp\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.pdb" />
<file target="lib\net8.0-windows10.0.18362.0\Microsoft.Xaml.Interactivity.xml" src="..\out\uwp\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.xml" />
<file target="lib\net8.0-windows10.0.18362.0\Microsoft.Xaml.Interactivity.pri" src="..\out\uwp\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.pri" />
<file target="lib\net8.0-windows10.0.18362.0\Microsoft.Xaml.Interactions.dll" src="..\out\uwp\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.dll" />
<file target="lib\net8.0-windows10.0.18362.0\Microsoft.Xaml.Interactions.pdb" src="..\out\uwp\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.pdb" />
<file target="lib\net8.0-windows10.0.18362.0\Microsoft.Xaml.Interactions.xml" src="..\out\uwp\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.xml" />
<file target="lib\net8.0-windows10.0.18362.0\Microsoft.Xaml.Interactions.pri" src="..\out\uwp\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.pri" />

<file target="lib\uap10.0\Design\Microsoft.Xaml.Interactivity.Design.dll" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.Design.dll" />
<file target="lib\uap10.0\Design\Microsoft.Xaml.Interactivity.Design.pdb" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.Design.pdb" />
<file target="lib\uap10.0\Design\Microsoft.Xaml.Interactions.Design.dll" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.Design.dll" />
<file target="lib\uap10.0\Design\Microsoft.Xaml.Interactions.Design.pdb" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.Design.pdb" />

<file target="lib\net8.0-windows10.0.18362.0\Design\Microsoft.Xaml.Interactivity.Design.dll" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.Design.dll" />
<file target="lib\net8.0-windows10.0.18362.0\Design\Microsoft.Xaml.Interactivity.Design.pdb" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.Design.pdb" />
<file target="lib\net8.0-windows10.0.18362.0\Design\Microsoft.Xaml.Interactions.Design.dll" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.Design.dll" />
<file target="lib\net8.0-windows10.0.18362.0\Design\Microsoft.Xaml.Interactions.Design.pdb" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.Design.pdb" />

<file target="lib\uap10.0\Design\Microsoft.Xaml.Interactivity.DesignTools.dll" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.DesignTools.dll" />
<file target="lib\uap10.0\Design\Microsoft.Xaml.Interactivity.DesignTools.pdb" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.DesignTools.pdb" />
<file target="lib\uap10.0\Design\Microsoft.Xaml.Interactions.DesignTools.dll" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.DesignTools.dll" />
<file target="lib\uap10.0\Design\Microsoft.Xaml.Interactions.DesignTools.pdb" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.DesignTools.pdb" />

<file target="lib\net8.0-windows10.0.18362.0\Design\Microsoft.Xaml.Interactivity.DesignTools.dll" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.DesignTools.dll" />
<file target="lib\net8.0-windows10.0.18362.0\Design\Microsoft.Xaml.Interactivity.DesignTools.pdb" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactivity.DesignTools.pdb" />
<file target="lib\net8.0-windows10.0.18362.0\Design\Microsoft.Xaml.Interactions.DesignTools.dll" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.DesignTools.dll" />
<file target="lib\net8.0-windows10.0.18362.0\Design\Microsoft.Xaml.Interactions.DesignTools.pdb" src="..\out\BehaviorsSDKManaged\bin\AnyCPU\Release\Microsoft.Xaml.Interactions.DesignTools.pdb" />

<file target="src\BehaviorsSDKManaged\Microsoft.Xaml.Interactions" src="..\src\BehaviorsSDKManaged\Microsoft.Xaml.Interactions\**\*.cs" />
<file target="src\BehaviorsSDKManaged\Microsoft.Xaml.Interactions.Design" src="..\src\BehaviorsSDKManaged\Microsoft.Xaml.Interactions.Design\**\*.cs" />
<file target="src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity" src="..\src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity\**\*.cs" />
Expand Down
75 changes: 63 additions & 12 deletions src/BehaviorsSDKManaged/BehaviorsSDKManaged.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
# Visual Studio Version 17
VisualStudioVersion = 17.10.35027.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Xaml.Interactivity", "Microsoft.Xaml.Interactivity\Microsoft.Xaml.Interactivity.csproj", "{7FFC1385-C3E1-487C-9A81-DE48DD63ECB9}"
EndProject
Expand Down Expand Up @@ -36,9 +36,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Xaml.Interactivit
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WinUI", "WinUI", "{0A3F92B2-BCF6-4456-8C6B-76A7D85F2276}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Xaml.Interactions.WinUI", "Microsoft.Xaml.Interactions.WinUI\Microsoft.Xaml.Interactions.WinUI.csproj", "{53214A0E-68BB-4891-B3C4-55E0FA108661}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Xaml.Interactions.WinUI", "Microsoft.Xaml.Interactions.WinUI\Microsoft.Xaml.Interactions.WinUI.csproj", "{53214A0E-68BB-4891-B3C4-55E0FA108661}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Xaml.Interactivity.WinUI", "Microsoft.Xaml.Interactivity.WinUI\Microsoft.Xaml.Interactivity.WinUI.csproj", "{7119F232-7BEF-42F9-9BA1-52654ADC98B6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Xaml.Interactivity.WinUI", "Microsoft.Xaml.Interactivity.WinUI\Microsoft.Xaml.Interactivity.WinUI.csproj", "{7119F232-7BEF-42F9-9BA1-52654ADC98B6}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.Xaml.Interactions.Shared", "Microsoft.Xaml.Interactions.Shared\Microsoft.Xaml.Interactions.Shared.shproj", "{0B356A23-7184-4E11-9706-2BF6A5FC82EB}"
EndProject
Expand All @@ -52,15 +52,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Legacy", "Legacy", "{67E69A
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Platforms", "Platforms", "{6DC88A28-BB73-411D-A94C-D1D2637289C8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Uwp", "Uwp", "{67B23F04-942D-43D5-B501-8540BF0923B6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Xaml.Interactivity.Uwp", "Microsoft.Xaml.Interactivity.Uwp\Microsoft.Xaml.Interactivity.Uwp.csproj", "{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Xaml.Interactions.Uwp", "Microsoft.Xaml.Interactions.Uwp\Microsoft.Xaml.Interactions.Uwp.csproj", "{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Microsoft.Xaml.Interactions.Shared\Microsoft.Xaml.Interactions.Shared.projitems*{0b356a23-7184-4e11-9706-2bf6a5fc82eb}*SharedItemsImports = 13
Microsoft.Xaml.Interactivity.Shared\Microsoft.Xaml.Interactivity.Shared.projitems*{52e3ed43-3013-4155-ad87-6df52a265d59}*SharedItemsImports = 13
Microsoft.Xaml.Interactions.Shared\Microsoft.Xaml.Interactions.Shared.projitems*{53214a0e-68bb-4891-b3c4-55e0fa108661}*SharedItemsImports = 5
Microsoft.Xaml.Interactivity.Shared\Microsoft.Xaml.Interactivity.Shared.projitems*{7119f232-7bef-42f9-9ba1-52654adc98b6}*SharedItemsImports = 5
Microsoft.Xaml.Interactivity.Shared\Microsoft.Xaml.Interactivity.Shared.projitems*{7ffc1385-c3e1-487c-9a81-de48dd63ecb9}*SharedItemsImports = 4
Microsoft.Xaml.Interactions.Shared\Microsoft.Xaml.Interactions.Shared.projitems*{a338a7f2-9010-477b-8a6e-6c2b2495c33c}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM64 = Debug|ARM64
Expand Down Expand Up @@ -215,6 +213,46 @@ Global
{7119F232-7BEF-42F9-9BA1-52654ADC98B6}.Release|x64.Build.0 = Release|x64
{7119F232-7BEF-42F9-9BA1-52654ADC98B6}.Release|x86.ActiveCfg = Release|x86
{7119F232-7BEF-42F9-9BA1-52654ADC98B6}.Release|x86.Build.0 = Release|x86
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Debug|ARM.ActiveCfg = Debug|Any CPU
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Debug|ARM.Build.0 = Debug|Any CPU
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Debug|ARM64.Build.0 = Debug|Any CPU
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Debug|x64.ActiveCfg = Debug|x64
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Debug|x64.Build.0 = Debug|x64
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Debug|x86.ActiveCfg = Debug|x86
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Debug|x86.Build.0 = Debug|x86
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Release|Any CPU.Build.0 = Release|Any CPU
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Release|ARM.ActiveCfg = Release|Any CPU
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Release|ARM.Build.0 = Release|Any CPU
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Release|ARM64.ActiveCfg = Release|Any CPU
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Release|ARM64.Build.0 = Release|Any CPU
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Release|x64.ActiveCfg = Release|x64
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Release|x64.Build.0 = Release|x64
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Release|x86.ActiveCfg = Release|x86
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD}.Release|x86.Build.0 = Release|x86
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Debug|ARM.ActiveCfg = Debug|Any CPU
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Debug|ARM.Build.0 = Debug|Any CPU
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Debug|ARM64.Build.0 = Debug|Any CPU
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Debug|x64.ActiveCfg = Debug|x64
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Debug|x64.Build.0 = Debug|x64
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Debug|x86.ActiveCfg = Debug|x86
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Debug|x86.Build.0 = Debug|x86
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Release|Any CPU.Build.0 = Release|Any CPU
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Release|ARM.ActiveCfg = Release|Any CPU
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Release|ARM.Build.0 = Release|Any CPU
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Release|ARM64.ActiveCfg = Release|Any CPU
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Release|ARM64.Build.0 = Release|Any CPU
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Release|x64.ActiveCfg = Release|x64
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Release|x64.Build.0 = Release|x64
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Release|x86.ActiveCfg = Release|x86
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -231,8 +269,21 @@ Global
{53214A0E-68BB-4891-B3C4-55E0FA108661} = {0A3F92B2-BCF6-4456-8C6B-76A7D85F2276}
{7119F232-7BEF-42F9-9BA1-52654ADC98B6} = {0A3F92B2-BCF6-4456-8C6B-76A7D85F2276}
{67E69A39-4F60-4F46-98D3-13C8DE05F0E4} = {6DC88A28-BB73-411D-A94C-D1D2637289C8}
{67B23F04-942D-43D5-B501-8540BF0923B6} = {6DC88A28-BB73-411D-A94C-D1D2637289C8}
{E6A328C8-2D9A-459A-86EE-F1C50CC6DADD} = {67B23F04-942D-43D5-B501-8540BF0923B6}
{B1C5E139-C8DF-46B5-9ABC-4515BDECAFA3} = {67B23F04-942D-43D5-B501-8540BF0923B6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5590EAFF-6ECD-427C-A50A-A9ABFD9CDB2B}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Microsoft.Xaml.Interactions.Shared\Microsoft.Xaml.Interactions.Shared.projitems*{0b356a23-7184-4e11-9706-2bf6a5fc82eb}*SharedItemsImports = 13
Microsoft.Xaml.Interactivity.Shared\Microsoft.Xaml.Interactivity.Shared.projitems*{52e3ed43-3013-4155-ad87-6df52a265d59}*SharedItemsImports = 13
Microsoft.Xaml.Interactions.Shared\Microsoft.Xaml.Interactions.Shared.projitems*{53214a0e-68bb-4891-b3c4-55e0fa108661}*SharedItemsImports = 5
Microsoft.Xaml.Interactivity.Shared\Microsoft.Xaml.Interactivity.Shared.projitems*{7119f232-7bef-42f9-9ba1-52654adc98b6}*SharedItemsImports = 5
Microsoft.Xaml.Interactivity.Shared\Microsoft.Xaml.Interactivity.Shared.projitems*{7ffc1385-c3e1-487c-9a81-de48dd63ecb9}*SharedItemsImports = 4
Microsoft.Xaml.Interactions.Shared\Microsoft.Xaml.Interactions.Shared.projitems*{a338a7f2-9010-477b-8a6e-6c2b2495c33c}*SharedItemsImports = 4
Microsoft.Xaml.Interactions.Shared\Microsoft.Xaml.Interactions.Shared.projitems*{b1c5e139-c8df-46b5-9abc-4515bdecafa3}*SharedItemsImports = 5
Microsoft.Xaml.Interactivity.Shared\Microsoft.Xaml.Interactivity.Shared.projitems*{e6a328c8-2d9a-459a-86ee-f1c50cc6dadd}*SharedItemsImports = 5
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<PackageProjectUrl>http://go.microsoft.com/fwlink/?LinkID=651678</PackageProjectUrl>
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=708511</PackageIconUrl>
<NuspecFile>..\..\..\scripts\Microsoft.Xaml.Behaviors.Uwp.Managed.nuspec</NuspecFile>
<PackageOutputPath>..\..\..\scripts</PackageOutputPath>
<PackageOutputPath>..\..\..\out\NuGetPackages</PackageOutputPath>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#else
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#endif
#if WINDOWS_UWP && !NET8_0_OR_GREATER
using System.Runtime.InteropServices.WindowsRuntime;
#endif

Expand Down Expand Up @@ -49,7 +51,7 @@ public sealed class EventTriggerBehavior : Trigger
private object _resolvedSource;
private Delegate _eventHandler;
private bool _isLoadedEventRegistered;
#if !WinUI
#if !NET8_0_OR_GREATER
private bool _isWindowsRuntimeEvent;
private Func<Delegate, EventRegistrationToken> _addEventHandlerMethod;
private Action<EventRegistrationToken> _removeEventHandlerMethod;
Expand Down Expand Up @@ -164,7 +166,7 @@ private void RegisterEvent(string eventName)
MethodInfo methodInfo = typeof(EventTriggerBehavior).GetTypeInfo().GetDeclaredMethod("OnEvent");
this._eventHandler = methodInfo.CreateDelegate(info.EventHandlerType, this);

#if WinUI
#if NET8_0_OR_GREATER
info.AddEventHandler(this._resolvedSource, this._eventHandler);
#else
this._isWindowsRuntimeEvent = EventTriggerBehavior.IsWindowsRuntimeEvent(info);
Expand Down Expand Up @@ -207,7 +209,7 @@ private void UnregisterEvent(string eventName)
}

EventInfo info = this._resolvedSource.GetType().GetRuntimeEvent(eventName);
#if WinUI
#if NET8_0_OR_GREATER
info.RemoveEventHandler(this._resolvedSource, this._eventHandler);
#else
if (this._isWindowsRuntimeEvent)
Expand Down Expand Up @@ -256,7 +258,7 @@ private static void OnEventNameChanged(DependencyObject dependencyObject, Depend
behavior.RegisterEvent(newEventName);
}

#if !WinUI
#if !NET8_0_OR_GREATER
private static bool IsWindowsRuntimeEvent(EventInfo eventInfo)
{
return eventInfo != null &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ namespace Microsoft.Xaml.Interactions.Core

internal static class ResourceHelper
{
#if NET8_0_OR_GREATER
#if NET8_0_OR_GREATER && !MODERN_WINDOWS_UWP
private static ResourceLoader strings = new ResourceLoader(ResourceLoader.GetDefaultResourceFilePath(), "Microsoft.Xaml.Interactions/Strings");
#endif

public static string GetString(string resourceName)
{
#if !NET8_0_OR_GREATER
#if !NET8_0_OR_GREATER || MODERN_WINDOWS_UWP
var strings = ResourceLoader.GetForCurrentView("Microsoft.Xaml.Interactions/Strings");
#endif
return strings.GetString(resourceName);
Expand Down
Loading

0 comments on commit 7c95cac

Please sign in to comment.