
ComPtr for stuff like that but i dont have enough experience to know how that works
ComPtr IntPtr swapChainPanelIntPtr = ((IWinRTObject)swapChainPanel).NativeObject.GetRef();
IUnknown iUnknown = (IUnknown)swapChainPanelIntPtr;<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(LibBuildTFMs)</TargetFrameworks>
<Platforms>x64;x86</Platforms>
<AssemblyName>Microsoft.Windows.SDK.NET</AssemblyName>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<ProjectReference Include="..\..\WinRT.Runtime\WinRT.Runtime.csproj" />
<ProjectReference Include="..\..\cswinrt\cswinrt.vcxproj" />
<InternalsVisibleTo Include="UnitTest" />
</ItemGroup>
<PropertyGroup>
<CsWinRTFilters>
-include Windows
# Exclude Windows.UI, Windows.UI.Text, Windows.UI.Xaml per Microsoft.Windows.SDK.WinUI.Contracts NuGet
-include Windows.UI.Popups
-exclude Windows.UI.Colors
-exclude Windows.UI.IColors
-exclude Windows.UI.ColorHelper
-exclude Windows.UI.IColorHelper
#-exclude Windows.UI.Text (must include Windows.UI.Text to work around WinUI nuget issues)
-exclude Windows.UI.Xaml
-exclude Windows.ApplicationModel.Store.Preview
# Allow Windows.UI.Text, Windows.UI.Xaml types used in other namespaces
-include Windows.UI.Text
-include Windows.UI.Text.FontStretch
-include Windows.UI.Text.FontStyle
-include Windows.UI.Text.FontWeight
-include Windows.UI.Text.UnderlineType
-include Windows.UI.Xaml.Media.Animation.ConditionallyIndependentlyAnimatableAttribute
-include Windows.UI.Xaml.Media.dxinterop
</CsWinRTFilters>
</PropertyGroup>
<PropertyGroup>
<DefineConstants>TRACE;MANUAL_IUNKNOWN,UAC_VERSION_15</DefineConstants>
</PropertyGroup>
</Project>