-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #858 from Sergio0694/dev/uwp-xaml-sample
Add UWP XAML sample app back
- Loading branch information
Showing
80 changed files
with
734 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
78 changes: 78 additions & 0 deletions
78
samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.projitems
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)' < '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
13
samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.shproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
9 changes: 9 additions & 0 deletions
9
.../Controls/D2D1AnimatedPixelShaderPanel.cs → .../Controls/D2D1AnimatedPixelShaderPanel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...nUI/Converters/RenderingPauseConverter.cs → ....UI/Converters/RenderingPauseConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
...pChain.WinUI/Shaders/PixelShaderEffect.cs → ...SwapChain.UI/Shaders/PixelShaderEffect.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
.../Shaders/Runners/ContouredLayersRunner.cs → .../Shaders/Runners/ContouredLayersRunner.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...WinUI/ViewModels/ShaderRunnerViewModel.cs → ...in.UI/ViewModels/ShaderRunnerViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.