diff --git a/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIsland.sln b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIsland.sln
new file mode 100644
index 000000000..c97db9b07
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIsland.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.14.36401.2
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleWpfXamlIslandApp", "SimpleWpfXamlIslandApp\SimpleWpfXamlIslandApp.csproj", "{4B331F0D-098B-D622-EBB0-61D14FA2C621}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUILib", "WinUILib\WinUILib.csproj", "{6CEC863F-D767-463E-9E3E-D955E045CCF8}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4B331F0D-098B-D622-EBB0-61D14FA2C621}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4B331F0D-098B-D622-EBB0-61D14FA2C621}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4B331F0D-098B-D622-EBB0-61D14FA2C621}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4B331F0D-098B-D622-EBB0-61D14FA2C621}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6CEC863F-D767-463E-9E3E-D955E045CCF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6CEC863F-D767-463E-9E3E-D955E045CCF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6CEC863F-D767-463E-9E3E-D955E045CCF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6CEC863F-D767-463E-9E3E-D955E045CCF8}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {613D332E-BCD6-44EA-A02D-11A32EE2469E}
+ EndGlobalSection
+EndGlobal
diff --git a/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/App.xaml b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/App.xaml
new file mode 100644
index 000000000..086b857d4
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/App.xaml.cs b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/App.xaml.cs
new file mode 100644
index 000000000..ea281fe2e
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/App.xaml.cs
@@ -0,0 +1,14 @@
+using System.Configuration;
+using System.Data;
+using System.Windows;
+
+namespace SimpleWpfXamlIslandApp
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+
+}
diff --git a/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/AssemblyInfo.cs b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/AssemblyInfo.cs
new file mode 100644
index 000000000..b0ec82757
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/AssemblyInfo.cs
@@ -0,0 +1,10 @@
+using System.Windows;
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
diff --git a/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/MainWindow.xaml b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/MainWindow.xaml
new file mode 100644
index 000000000..a7790c226
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/MainWindow.xaml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/MainWindow.xaml.cs b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/MainWindow.xaml.cs
new file mode 100644
index 000000000..6941b5e56
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/MainWindow.xaml.cs
@@ -0,0 +1,46 @@
+using Microsoft.UI.Dispatching;
+using SimpleWpfXamlIslandApp;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace SimpleWpfXamlIslandApp
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ DispatcherQueueController _controller;
+ WinUIControlHost _winUIControl;
+
+ public MainWindow()
+ {
+ _controller = Microsoft.UI.Dispatching.DispatcherQueueController.CreateOnCurrentThread();
+
+ // var xamlApp = new XamlApp();
+ // var libXamlApp = new WinUILib.XamlApp();
+ var winUIApp = new WinUILib.XamlApp(new WinUILib.WinUILib_XamlTypeInfo.XamlMetaDataProvider());
+ InitializeComponent();
+ Loaded += MainWindow_Loaded;
+ }
+
+ void MainWindow_Loaded(object sender, RoutedEventArgs e)
+ {
+ _winUIControl = new WinUIControlHost();
+ ControlHostElement.Child = _winUIControl;
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ MessageBox.Show("Hello from WPF!");
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/Properties/launchSettings.json b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/Properties/launchSettings.json
new file mode 100644
index 000000000..a65c79c25
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/Properties/launchSettings.json
@@ -0,0 +1,8 @@
+{
+ "profiles": {
+ "SimpleWpfXamlIslandApp": {
+ "commandName": "Project",
+ "nativeDebugging": false
+ }
+ }
+}
\ No newline at end of file
diff --git a/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/SimpleWpfXamlIslandApp.csproj b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/SimpleWpfXamlIslandApp.csproj
new file mode 100644
index 000000000..174eff9bc
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/SimpleWpfXamlIslandApp.csproj
@@ -0,0 +1,31 @@
+
+
+
+ WinExe
+ net8.0-windows10.0.26100.0
+
+ enable
+ enable
+ true
+ true
+ false
+ None
+
+ true
+
+
+
+
+ win10-x86;win10-x64;win10-arm64
+ true
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/WinUIControlHost.cs b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/WinUIControlHost.cs
new file mode 100644
index 000000000..eadc434c5
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/WinUIControlHost.cs
@@ -0,0 +1,65 @@
+using Microsoft.UI;
+using System.Runtime.InteropServices;
+using System.Windows.Interop;
+using WinUILib;
+
+namespace SimpleWpfXamlIslandApp
+{
+ public class WinUIControlHost : HwndHost
+ {
+ Microsoft.UI.Xaml.Hosting.DesktopWindowXamlSource _xamlSource;
+
+
+ public WinUIControlHost()
+ {
+ _xamlSource = new Microsoft.UI.Xaml.Hosting.DesktopWindowXamlSource();
+ }
+
+ protected override HandleRef BuildWindowCore(HandleRef hwndParent)
+ {
+ var id = new Microsoft.UI.WindowId((ulong)hwndParent.Handle);
+ _xamlSource.Initialize(id);
+
+ InitIslandSampleCode();
+
+ return new HandleRef(null, (nint)_xamlSource.SiteBridge.WindowId.Value);
+ }
+
+ void InitIslandSampleCode()
+ {
+ var grid = new Microsoft.UI.Xaml.Controls.Grid();
+ grid.Background = new Microsoft.UI.Xaml.Media.SolidColorBrush(Colors.LightGray);
+ grid.RowDefinitions.Add(new Microsoft.UI.Xaml.Controls.RowDefinition { Height = new Microsoft.UI.Xaml.GridLength(1, Microsoft.UI.Xaml.GridUnitType.Star) });
+ grid.RowDefinitions.Add(new Microsoft.UI.Xaml.Controls.RowDefinition { Height = new Microsoft.UI.Xaml.GridLength(1, Microsoft.UI.Xaml.GridUnitType.Star) });
+ // grid.RowDefinitions.Add(new Microsoft.UI.Xaml.Controls.RowDefinition { Height = new Microsoft.UI.Xaml.GridLength(1, Microsoft.UI.Xaml.GridUnitType.Star) });
+
+ var winUiButton = new MyCustomButton();
+ winUiButton.Click += (s, e) =>
+ {
+ System.Windows.MessageBox.Show("Hello from WinUI!");
+ };
+ grid.Children.Add(winUiButton);
+
+ //var customUserControl = new CustomUserControl();
+
+ //grid.Children.Add(customUserControl);
+
+ //Microsoft.UI.Xaml.Controls.Grid.SetRow(customUserControl, 1);
+
+ var listView = new CustomListView {
+
+ ItemsSource = new List { "Item 1", "Item 2", "Item 3" },
+ };
+
+ Microsoft.UI.Xaml.Controls.Grid.SetRow(listView, 1);
+ grid.Children.Add(listView);
+
+ _xamlSource.Content = grid;
+ }
+
+ protected override void DestroyWindowCore(HandleRef hwnd)
+ {
+
+ }
+ }
+}
diff --git a/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/XamlApp.cs b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/XamlApp.cs
new file mode 100644
index 000000000..38748ca4a
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/XamlApp.cs
@@ -0,0 +1,47 @@
+using Microsoft.UI.Xaml.Hosting;
+using Microsoft.UI.Xaml.Markup;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SimpleWpfXamlIslandApp
+{
+ internal class XamlApp : Microsoft.UI.Xaml.Application, IXamlMetadataProvider
+ {
+ public XamlApp()
+ {
+ _xamlMetaDataProvider = new Microsoft.UI.Xaml.XamlTypeInfo.XamlControlsXamlMetaDataProvider();
+ _windowsXamlManager = WindowsXamlManager.InitializeForCurrentThread();
+ }
+
+ override protected void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
+ {
+ this.Resources.MergedDictionaries.Add(new Microsoft.UI.Xaml.Controls.XamlControlsResources());
+ this.Resources.MergedDictionaries.Add(new Microsoft.UI.Xaml.ResourceDictionary {
+ Source = new Uri("ms-appx:///WinUILib/ListViewStyles.xbf")
+ });
+ }
+
+ IXamlType IXamlMetadataProvider.GetXamlType(string fullName)
+ {
+ var xamlType = _xamlMetaDataProvider.GetXamlType(fullName);
+ return xamlType;
+ }
+
+ IXamlType IXamlMetadataProvider.GetXamlType(System.Type type)
+ {
+ var xamlType = _xamlMetaDataProvider.GetXamlType(type);
+ return xamlType;
+ }
+
+ XmlnsDefinition[] IXamlMetadataProvider.GetXmlnsDefinitions()
+ {
+ return _xamlMetaDataProvider.GetXmlnsDefinitions();
+ }
+
+ WindowsXamlManager _windowsXamlManager;
+ IXamlMetadataProvider _xamlMetaDataProvider;
+ }
+}
diff --git a/Samples/Islands/SimpleWpfXamlIsland/WinUILib/CustomListView.cs b/Samples/Islands/SimpleWpfXamlIsland/WinUILib/CustomListView.cs
new file mode 100644
index 000000000..f0255367f
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/WinUILib/CustomListView.cs
@@ -0,0 +1,18 @@
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WinUILib
+{
+ public class CustomListView : ListView
+ {
+ public CustomListView()
+ {
+ ItemTemplate = Application.Current.Resources["ListViewItemTemplate"] as Microsoft.UI.Xaml.DataTemplate;
+ }
+ }
+}
diff --git a/Samples/Islands/SimpleWpfXamlIsland/WinUILib/ListViewStyles.xaml b/Samples/Islands/SimpleWpfXamlIsland/WinUILib/ListViewStyles.xaml
new file mode 100644
index 000000000..34a3d3efe
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/WinUILib/ListViewStyles.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Islands/SimpleWpfXamlIsland/WinUILib/MyCustomButton.cs b/Samples/Islands/SimpleWpfXamlIsland/WinUILib/MyCustomButton.cs
new file mode 100644
index 000000000..e0814992a
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/WinUILib/MyCustomButton.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+// To learn more about WinUI, the WinUI project structure,
+// and more about our project templates, see: http://aka.ms/winui-project-info.
+
+namespace WinUILib
+{
+ public partial class MyCustomButton : Microsoft.UI.Xaml.Controls.Button
+ {
+ public MyCustomButton()
+ {
+ Content = "Click Me WinUI";
+ }
+ }
+}
diff --git a/Samples/Islands/SimpleWpfXamlIsland/WinUILib/WinUILib.csproj b/Samples/Islands/SimpleWpfXamlIsland/WinUILib/WinUILib.csproj
new file mode 100644
index 000000000..cffe0e50b
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/WinUILib/WinUILib.csproj
@@ -0,0 +1,14 @@
+
+
+ net8.0-windows10.0.19041.0
+ 10.0.17763.0
+ WinUILib
+ win-x86;win-x64;win-arm64
+ true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Islands/SimpleWpfXamlIsland/WinUILib/XamlApp.cs b/Samples/Islands/SimpleWpfXamlIsland/WinUILib/XamlApp.cs
new file mode 100644
index 000000000..044c20d02
--- /dev/null
+++ b/Samples/Islands/SimpleWpfXamlIsland/WinUILib/XamlApp.cs
@@ -0,0 +1,55 @@
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Hosting;
+using Microsoft.UI.Xaml.Markup;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WinUILib
+{
+ public class XamlApp : Microsoft.UI.Xaml.Application, IXamlMetadataProvider
+ {
+
+ public XamlApp(IXamlMetadataProvider provider)
+ {
+ ResourceManagerRequested += App_ResourceManagerRequested;
+ _xamlMetaDataProvider = provider;
+ _windowsXamlManager = WindowsXamlManager.InitializeForCurrentThread();
+ }
+
+ private void App_ResourceManagerRequested(object sender, ResourceManagerRequestedEventArgs args)
+ {
+ args.CustomResourceManager = new Microsoft.Windows.ApplicationModel.Resources.ResourceManager("WinUILib.pri");
+ }
+
+ override protected void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
+ {
+ this.Resources.MergedDictionaries.Add(new Microsoft.UI.Xaml.Controls.XamlControlsResources());
+ this.Resources.MergedDictionaries.Add(new Microsoft.UI.Xaml.ResourceDictionary {
+ Source = new Uri("ms-appx:///WinUILib/ListViewStyles.xbf")
+ });
+ }
+
+ IXamlType IXamlMetadataProvider.GetXamlType(string fullName)
+ {
+ var xamlType = _xamlMetaDataProvider.GetXamlType(fullName);
+ return xamlType;
+ }
+
+ IXamlType IXamlMetadataProvider.GetXamlType(System.Type type)
+ {
+ var xamlType = _xamlMetaDataProvider.GetXamlType(type);
+ return xamlType;
+ }
+
+ XmlnsDefinition[] IXamlMetadataProvider.GetXmlnsDefinitions()
+ {
+ return _xamlMetaDataProvider.GetXmlnsDefinitions();
+ }
+
+ WindowsXamlManager _windowsXamlManager;
+ IXamlMetadataProvider _xamlMetaDataProvider;
+ }
+}