diff --git a/samples/ComputeSharp.WinUI3/App.xaml b/samples/ComputeSharp.WinUI3/App.xaml
index 81de12cf..6429e2e4 100644
--- a/samples/ComputeSharp.WinUI3/App.xaml
+++ b/samples/ComputeSharp.WinUI3/App.xaml
@@ -1,15 +1,12 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
-
-
diff --git a/samples/ComputeSharp.WinUI3/App.xaml.cs b/samples/ComputeSharp.WinUI3/App.xaml.cs
index f6be30ba..014d74cb 100644
--- a/samples/ComputeSharp.WinUI3/App.xaml.cs
+++ b/samples/ComputeSharp.WinUI3/App.xaml.cs
@@ -1,31 +1,18 @@
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Controls.Primitives;
-using Microsoft.UI.Xaml.Data;
-using Microsoft.UI.Xaml.Input;
-using Microsoft.UI.Xaml.Media;
-using Microsoft.UI.Xaml.Navigation;
-using Microsoft.UI.Xaml.Shapes;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
-using Windows.ApplicationModel;
-using Windows.ApplicationModel.Activation;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
+using ComputeSharp.SwapChain.WinUI.Views;
+using Microsoft.UI.Xaml;
-// To learn more about WinUI, the WinUI project structure,
-// and more about our project templates, see: http://aka.ms/winui-project-info.
-
-namespace ComputeSharp.WinUI3
+namespace ComputeSharp.SwapChain.WinUI
{
///
/// Provides application-specific behavior to supplement the default Application class.
///
public partial class App : Application
{
+ ///
+ /// The main application window
+ ///
+ private Window? mainWindow;
+
///
/// 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().
@@ -35,17 +22,12 @@ namespace ComputeSharp.WinUI3
this.InitializeComponent();
}
- ///
- /// Invoked when the application is launched normally by the end user. Other entry points
- /// will be used such as when the application is launched to open a specific file.
- ///
- /// Details about the launch request and process.
- protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
+ ///
+ protected override void OnLaunched(LaunchActivatedEventArgs args)
{
- m_window = new MainWindow();
- m_window.Activate();
+ mainWindow = new MainWindow();
+ mainWindow.Closed += (_, _) => Exit();
+ mainWindow.Activate();
}
-
- private Window m_window;
}
}
diff --git a/samples/ComputeSharp.WinUI3/MainWindow.xaml b/samples/ComputeSharp.WinUI3/MainWindow.xaml
deleted file mode 100644
index 167abb6b..00000000
--- a/samples/ComputeSharp.WinUI3/MainWindow.xaml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.WinUI3/MainWindow.xaml.cs b/samples/ComputeSharp.WinUI3/MainWindow.xaml.cs
deleted file mode 100644
index 5eba807d..00000000
--- a/samples/ComputeSharp.WinUI3/MainWindow.xaml.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Controls.Primitives;
-using Microsoft.UI.Xaml.Data;
-using Microsoft.UI.Xaml.Input;
-using Microsoft.UI.Xaml.Media;
-using Microsoft.UI.Xaml.Navigation;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
-
-// To learn more about WinUI, the WinUI project structure,
-// and more about our project templates, see: http://aka.ms/winui-project-info.
-
-namespace ComputeSharp.WinUI3
-{
- ///
- /// An empty window that can be used on its own or navigated to within a Frame.
- ///
- public sealed partial class MainWindow : Window
- {
- public MainWindow()
- {
- this.InitializeComponent();
- }
-
- private void myButton_Click(object sender, RoutedEventArgs e)
- {
- myButton.Content = "Clicked";
- }
- }
-}
diff --git a/samples/ComputeSharp.WinUI3/Shaders/Runners/ContouredLayersRunner.cs b/samples/ComputeSharp.WinUI3/Shaders/Runners/ContouredLayersRunner.cs
index 9faa0198..6930f5a4 100644
--- a/samples/ComputeSharp.WinUI3/Shaders/Runners/ContouredLayersRunner.cs
+++ b/samples/ComputeSharp.WinUI3/Shaders/Runners/ContouredLayersRunner.cs
@@ -21,7 +21,7 @@ namespace ComputeSharp.SwapChain.WinUI.Shaders.Runners
{
if (this.texture is null)
{
- string filename = Path.Combine(Package.Current.InstalledLocation.Path, "Images", "Textures", "RustyMetal.png");
+ string filename = Path.Combine(Package.Current.InstalledLocation.Path, "Assets", "Textures", "RustyMetal.png");
this.texture = Gpu.Default.LoadReadOnlyTexture2D(filename);
}
diff --git a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml b/samples/ComputeSharp.WinUI3/Views/MainWindow.xaml
similarity index 100%
rename from samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml
rename to samples/ComputeSharp.WinUI3/Views/MainWindow.xaml
diff --git a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs b/samples/ComputeSharp.WinUI3/Views/MainWindow.xaml.cs
similarity index 100%
rename from samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs
rename to samples/ComputeSharp.WinUI3/Views/MainWindow.xaml.cs