Skip to content

Commit

Permalink
Merge pull request #858 from Sergio0694/dev/uwp-xaml-sample
Browse files Browse the repository at this point in the history
Add UWP XAML sample app back
  • Loading branch information
Sergio0694 authored Dec 21, 2024
2 parents 012090f + 39eb73c commit 06bfd5f
Show file tree
Hide file tree
Showing 80 changed files with 734 additions and 11 deletions.
23 changes: 23 additions & 0 deletions ComputeSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.D2D1.WinUI.Cod
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.D2D1.Uwp.CodeFixers", "src\ComputeSharp.D2D1.Uwp.CodeFixers\ComputeSharp.D2D1.Uwp.CodeFixers.csproj", "{8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.SwapChain.Uwp", "samples\ComputeSharp.SwapChain.Uwp\ComputeSharp.SwapChain.Uwp.csproj", "{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SwapChain.UI", "samples\ComputeSharp.SwapChain.UI\ComputeSharp.SwapChain.UI.shproj", "{6BC471C6-72F9-43CF-AE1E-F6D3E5ED3129}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -557,6 +561,18 @@ Global
{8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Release|ARM64.Build.0 = Release|Any CPU
{8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Release|x64.ActiveCfg = Release|Any CPU
{8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Release|x64.Build.0 = Release|Any CPU
{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|ARM64.ActiveCfg = Debug|ARM64
{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|ARM64.Build.0 = Debug|ARM64
{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|ARM64.Deploy.0 = Debug|ARM64
{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|x64.ActiveCfg = Debug|x64
{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|x64.Build.0 = Debug|x64
{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|x64.Deploy.0 = Debug|x64
{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|ARM64.ActiveCfg = Release|ARM64
{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|ARM64.Build.0 = Release|ARM64
{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|ARM64.Deploy.0 = Release|ARM64
{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|x64.ActiveCfg = Release|x64
{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|x64.Build.0 = Release|x64
{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|x64.Deploy.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -598,13 +614,16 @@ Global
{551EF4FB-F34F-412A-B3E6-E345797560ED} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
{9FBE070E-A210-4CEF-9F04-61C2B269C600} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
{916331A5-1EA6-41D7-B199-2E50C513EFDE} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
{6BC471C6-72F9-43CF-AE1E-F6D3E5ED3129} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4664C5E3-0340-4E22-BCFD-98AAEDF5F2DC}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
samples\ComputeSharp.SwapChain.Shaders.D2D1\ComputeSharp.SwapChain.Shaders.D2D1.projitems*{0071701e-b9c5-4098-be5f-ef556c4553c6}*SharedItemsImports = 5
samples\ComputeSharp.SwapChain.Shaders\ComputeSharp.SwapChain.Shaders.projitems*{0071701e-b9c5-4098-be5f-ef556c4553c6}*SharedItemsImports = 5
samples\ComputeSharp.SwapChain.UI\ComputeSharp.SwapChain.UI.projitems*{0071701e-b9c5-4098-be5f-ef556c4553c6}*SharedItemsImports = 5
samples\ComputeSharp.SwapChain.Shaders\ComputeSharp.SwapChain.Shaders.projitems*{0800bd51-499d-44c2-9417-fd1f7fdfe9c4}*SharedItemsImports = 13
src\ComputeSharp.UI\ComputeSharp.UI.projitems*{1cd1d9c5-7e00-43fb-a8c3-cfe98a885d3b}*SharedItemsImports = 13
samples\ComputeSharp.SwapChain.Shaders.D2D1\ComputeSharp.SwapChain.Shaders.D2D1.projitems*{209c95a3-fa53-431b-b688-3299ca6c29d2}*SharedItemsImports = 5
Expand All @@ -617,6 +636,10 @@ Global
src\ComputeSharp.CodeFixing\ComputeSharp.CodeFixing.projitems*{54654960-54b5-4e19-b3ed-993591ca39e5}*SharedItemsImports = 5
src\ComputeSharp.D2D1.UI.SourceGenerators\ComputeSharp.D2D1.UI.SourceGenerators.projitems*{690c4014-a06b-44db-b717-aea4cafa9d68}*SharedItemsImports = 5
src\ComputeSharp.SourceGeneration\ComputeSharp.SourceGeneration.projitems*{690c4014-a06b-44db-b717-aea4cafa9d68}*SharedItemsImports = 5
samples\ComputeSharp.SwapChain.Shaders.D2D1\ComputeSharp.SwapChain.Shaders.D2D1.projitems*{6a861d53-2dbd-4b4f-8543-90dc8c0f2dc8}*SharedItemsImports = 5
samples\ComputeSharp.SwapChain.Shaders\ComputeSharp.SwapChain.Shaders.projitems*{6a861d53-2dbd-4b4f-8543-90dc8c0f2dc8}*SharedItemsImports = 5
samples\ComputeSharp.SwapChain.UI\ComputeSharp.SwapChain.UI.projitems*{6a861d53-2dbd-4b4f-8543-90dc8c0f2dc8}*SharedItemsImports = 5
samples\ComputeSharp.SwapChain.UI\ComputeSharp.SwapChain.UI.projitems*{6bc471c6-72f9-43cf-ae1e-f6d3e5ed3129}*SharedItemsImports = 13
src\ComputeSharp.D2D1.UI\ComputeSharp.D2D1.UI.projitems*{716df19e-69ba-4a9c-9ca4-bfd196152f46}*SharedItemsImports = 5
samples\ComputeSharp.SwapChain.Shaders.D2D1\ComputeSharp.SwapChain.Shaders.D2D1.projitems*{73c32d0f-64db-4674-84e9-8fcc41228474}*SharedItemsImports = 5
src\ComputeSharp.D2D1.UI.CodeFixers\ComputeSharp.D2D1.UI.CodeFixers.projitems*{8be73db3-16e0-41f4-a87f-0c2ab43856a2}*SharedItemsImports = 5
Expand Down
1 change: 1 addition & 0 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="toolkit-MainLatest" value="https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-MainLatest/nuget/v3/index.json" />
</packageSources>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.22621.57</WindowsSdkPackageVersion>
<UseUwp>true</UseUwp>
<Platforms>x64;arm64</Platforms>
<Platforms>x64;ARM64</Platforms>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<DefaultLanguage>en-US</DefaultLanguage>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>6bc471c6-72f9-43cf-ae1e-f6d3e5ed3129</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>ComputeSharp.SwapChain.UI</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)Assets\Misc\noise_low.png" />
<Content Include="$(MSBuildThisFileDirectory)..\ComputeSharp.SwapChain\Textures\RustyMetal.png" Link="Assets\Textures\RustyMetal.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\LargeTile.scale-100.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\LargeTile.scale-125.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\LargeTile.scale-150.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\LargeTile.scale-200.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\LargeTile.scale-400.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\LockScreenLogo.scale-200.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\SmallTile.scale-100.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\SmallTile.scale-125.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\SmallTile.scale-150.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\SmallTile.scale-200.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\SmallTile.scale-400.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\SplashScreen.scale-100.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\SplashScreen.scale-125.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\SplashScreen.scale-150.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\SplashScreen.scale-200.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\SplashScreen.scale-400.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square150x150Logo.scale-100.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square150x150Logo.scale-125.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square150x150Logo.scale-150.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square150x150Logo.scale-200.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square150x150Logo.scale-400.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.altform-lightunplated_targetsize-16.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.altform-lightunplated_targetsize-24.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.altform-lightunplated_targetsize-256.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.altform-lightunplated_targetsize-32.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.altform-lightunplated_targetsize-48.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.altform-unplated_targetsize-16.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.altform-unplated_targetsize-256.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.altform-unplated_targetsize-32.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.altform-unplated_targetsize-48.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.scale-100.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.scale-125.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.scale-150.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.scale-200.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.scale-400.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.targetsize-16.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.targetsize-24.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.targetsize-256.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.targetsize-32.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.targetsize-48.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\StoreLogo.backup.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\StoreLogo.scale-100.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\StoreLogo.scale-125.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\StoreLogo.scale-150.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\StoreLogo.scale-200.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\StoreLogo.scale-400.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Wide310x150Logo.scale-100.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Wide310x150Logo.scale-125.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Wide310x150Logo.scale-150.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Wide310x150Logo.scale-200.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Wide310x150Logo.scale-400.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Controls\D2D1AnimatedPixelShaderPanel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Converters\RenderingPauseConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Converters\ResolutionScaleConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Enums\RenderingMode.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Shaders\PixelShaderEffect.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Shaders\Runners\ContouredLayersRunner.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Shaders\Runners\D2D1ContouredLayersRunner.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModels\MainViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModels\ShaderRunnerViewModel.cs" />
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.shproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>6bc471c6-72f9-43cf-ae1e-f6d3e5ed3129</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="ComputeSharp.SwapChain.UI.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
using ComputeSharp.SwapChain.Core.Shaders;
using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.UI.Xaml;
#if WINDOWS_UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
#endif

#if WINDOWS_UWP
namespace ComputeSharp.SwapChain.Uwp.Views;
#else
namespace ComputeSharp.SwapChain.WinUI.Views;
#endif

/// <summary>
/// A custom <see cref="Control"/> that can be used to render animated backgrounds via Win2D.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#if WINDOWS_UWP
using Windows.UI.Xaml.Controls;
#else
using Microsoft.UI.Xaml.Controls;
#endif

namespace ComputeSharp.SwapChain.Core.Converters;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
using System;
using ComputeSharp.D2D1;
using ComputeSharp.D2D1.Descriptors;
#if WINDOWS_UWP
using ComputeSharp.D2D1.Uwp;
#else
using ComputeSharp.D2D1.WinUI;
#endif

namespace ComputeSharp.SwapChain.Core.Shaders;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
using System;
using System.IO;
using ComputeSharp.SwapChain.Shaders;
#if WINDOWS_UWP
using ComputeSharp.Uwp;
#else
using ComputeSharp.WinUI;
#endif
using Windows.ApplicationModel;

namespace ComputeSharp.SwapChain.Core.Shaders.Runners;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
using System.IO;
using ComputeSharp.D2D1;
using ComputeSharp.D2D1.Interop;
#if WINDOWS_UWP
using ComputeSharp.D2D1.Uwp;
#else
using ComputeSharp.D2D1.WinUI;
#endif
using ComputeSharp.SwapChain.Shaders.D2D1;
using Windows.ApplicationModel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
using ComputeSharp.SwapChain.Core.Shaders;
using ComputeSharp.SwapChain.Core.Shaders.Runners;
using ComputeSharp.SwapChain.Shaders;
#if WINDOWS_UWP
using ComputeSharp.Uwp;
#else
using ComputeSharp.WinUI;
#endif

#pragma warning disable IDE0300 // CsWinRT does not support marshalling collection expression (https://github.com/microsoft/CsWinRT/issues/1661)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
using CommunityToolkit.Mvvm.ComponentModel;
using ComputeSharp.SwapChain.Core.Shaders;
#if WINDOWS_UWP
using ComputeSharp.Uwp;
#else
using ComputeSharp.WinUI;
#endif

namespace ComputeSharp.SwapChain.Core.ViewModels;

Expand Down
13 changes: 13 additions & 0 deletions samples/ComputeSharp.SwapChain.Uwp/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Application
x:Class="ComputeSharp.SwapChain.Uwp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<ResourceDictionary Source="Controls/D2D1AnimatedPixelShaderPanel.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
72 changes: 72 additions & 0 deletions samples/ComputeSharp.SwapChain.Uwp/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using ComputeSharp.SwapChain.Uwp.Views;
using Windows.ApplicationModel.Activation;
using Windows.ApplicationModel.Core;
using Windows.UI;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;

namespace ComputeSharp.SwapChain.Uwp;

/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
InitializeComponent();
}

/// <inheritdoc/>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
if (Window.Current.Content is not MainView)
{
StyleTitleBar();
ExpandViewIntoTitleBar();

Window.Current.Content = new MainView();
}

if (!e.PrelaunchActivated)
{
Window.Current.Activate();
}
}

/// <summary>
/// Styles the title bar buttons according to the theme in use
/// </summary>
private static void StyleTitleBar()
{
ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;

// Transparent colors
titleBar.ForegroundColor = Colors.Transparent;
titleBar.BackgroundColor = Colors.Transparent;
titleBar.ButtonBackgroundColor = Colors.Transparent;
titleBar.InactiveBackgroundColor = Colors.Transparent;
titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;

// Theme aware colors
titleBar.ButtonForegroundColor = titleBar.ButtonHoverForegroundColor = titleBar.ButtonPressedForegroundColor = Colors.White;
titleBar.ButtonHoverBackgroundColor = Color.FromArgb(0x20, 0xFF, 0xFF, 0xFF);
titleBar.ButtonPressedBackgroundColor = Color.FromArgb(0x40, 0xFF, 0xFF, 0xFF);
titleBar.ButtonInactiveForegroundColor = Color.FromArgb(0xC0, 0xFF, 0xFF, 0xFF);
titleBar.InactiveForegroundColor = Color.FromArgb(0xA0, 0xA0, 0xA0, 0xA0);
}

/// <summary>
/// Sets up the app UI to be expanded into the title bar
/// </summary>
private static void ExpandViewIntoTitleBar()
{
CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;

coreTitleBar.ExtendViewIntoTitleBar = true;
}
}
Loading

0 comments on commit 06bfd5f

Please sign in to comment.