<Project Sdk="Microsoft.NET.Sdk">
  <Import Project="..\..\..\Version.props" />
  <PropertyGroup>
    <AssemblyName>PowerToys.Peek.UI</AssemblyName>
    <AssemblyTitle>PowerToys.Peek.UI</AssemblyTitle>
    <AssemblyDescription>PowerToys Peek UI</AssemblyDescription>
    <RootNamespace>Peek.UI</RootNamespace>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
    <TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
    <SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
    <OutputPath>..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps</OutputPath>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <Platforms>x86;x64;ARM64</Platforms>
    <RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
    <UseWinUI>true</UseWinUI>
    <GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
    <EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
    <WindowsPackageType>None</WindowsPackageType>
    <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
    <SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
    <Nullable>Enable</Nullable>
    <ApplicationIcon>Assets\Peek\Icon.ico</ApplicationIcon>
    <!-- MRT from windows app sdk will search for a pri file with the same name of the module before defaulting to resources.pri -->
    <ProjectPriFileName>PowerToys.Peek.UI.pri</ProjectPriFileName>
    <SelfContained>true</SelfContained>
  </PropertyGroup>

  <ItemGroup>
    <Page Remove="PeekXAML\App.xaml" />
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="PeekXAML\App.xaml" />
  </ItemGroup>

  <!-- SelfContained=true requires RuntimeIdentifier to be set -->
  <PropertyGroup Condition="'$(Platform)'=='x64'">
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Platform)'=='ARM64'">
    <RuntimeIdentifier>win-arm64</RuntimeIdentifier>
  </PropertyGroup>

  <!-- See https://learn.microsoft.com/windows/apps/develop/platform/csharp-winrt/net-projection-from-cppwinrt-component for more info -->
  <PropertyGroup>
    <CsWinRTIncludes>PowerToys.GPOWrapper</CsWinRTIncludes>
    <CsWinRTGeneratedFilesDir>$(OutDir)</CsWinRTGeneratedFilesDir>
    <ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
  </PropertyGroup>

  <ItemGroup>
      <Content Include="Assets\Peek\Icon.ico" />
  </ItemGroup>
  <ItemGroup>
    <None Remove="Assets\Peek\AppList.scale-100.png" />
    <None Remove="Assets\Peek\AppList.scale-125.png" />
    <None Remove="Assets\Peek\AppList.scale-150.png" />
    <None Remove="Assets\Peek\AppList.scale-200.png" />
    <None Remove="Assets\Peek\AppList.scale-400.png" />
    <None Remove="Views\TitleBar.xaml" />
    <None Remove="Views\UnsupportedFile.xaml" />
  </ItemGroup>
  <ItemGroup>
    <COMReference Include="Shell32">
      <VersionMinor>0</VersionMinor>
      <VersionMajor>1</VersionMajor>
      <Guid>50a7e9b0-70ef-11d1-b75a-00a0c90564fe</Guid>
      <Lcid>0</Lcid>
      <WrapperTool>tlbimp</WrapperTool>
      <Isolated>false</Isolated>
      <EmbedInteropTypes>true</EmbedInteropTypes>
    </COMReference>
    <COMReference Include="SHDocVw">
      <VersionMinor>1</VersionMinor>
      <VersionMajor>1</VersionMajor>
      <Guid>eab22ac0-30c1-11cf-a7eb-0000c05bae0b</Guid>
      <Lcid>0</Lcid>
      <WrapperTool>tlbimp</WrapperTool>
      <Isolated>false</Isolated>
      <EmbedInteropTypes>true</EmbedInteropTypes>
    </COMReference>
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Hosting" />
	<PackageReference Include="Microsoft.Windows.CsWinRT" />
    <PackageReference Include="Microsoft.Windows.CsWin32">
        <PrivateAssets>all</PrivateAssets>
        <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="CommunityToolkit.Mvvm" />
    <PackageReference Include="Microsoft.WindowsAppSDK" />
    <PackageReference Include="Microsoft.Windows.SDK.BuildTools" />
    <PackageReference Include="WinUIEx" />
    <Manifest Include="$(ApplicationManifest)" />
  </ItemGroup>

  <!-- 
    Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
    Tools extension to be activated for this project even if the Windows App SDK Nuget
    package has not yet been restored.
  -->
  <ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
    <ProjectCapability Include="Msix" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\..\..\common\GPOWrapper\GPOWrapper.vcxproj" />
    <ProjectReference Include="..\..\..\common\interop\PowerToys.Interop.vcxproj" />
    <ProjectReference Include="..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
    <ProjectReference Include="..\Peek.Common\Peek.Common.csproj" />
    <ProjectReference Include="..\Peek.FilePreviewer\Peek.FilePreviewer.csproj" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Assets\Peek\Icon.ico" />
  </ItemGroup>
  <ItemGroup>
    <Page Update="Views\UnsupportedFile.xaml">
      <Generator>MSBuild:Compile</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Update="Views\TitleBar.xaml">
      <Generator>MSBuild:Compile</Generator>
    </Page>
  </ItemGroup>
</Project>
