From c9708f949146bb2c3be63cc809e6f4de0bf6d1c0 Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Tue, 5 Aug 2025 00:35:24 +0100 Subject: [PATCH 1/6] Add wpf islands example --- .../SimpleWpfXamlIsland.sln | 31 ++++++++ .../SimpleWpfXamlIslandApp/App.xaml | 9 +++ .../SimpleWpfXamlIslandApp/App.xaml.cs | 14 ++++ .../SimpleWpfXamlIslandApp/AssemblyInfo.cs | 10 +++ .../SimpleWpfXamlIslandApp/MainWindow.xaml | 27 +++++++ .../SimpleWpfXamlIslandApp/MainWindow.xaml.cs | 44 ++++++++++++ .../SimpleWpfXamlIslandApp.csproj | 30 ++++++++ .../WinUIControlHost.cs | 70 +++++++++++++++++++ .../SimpleWpfXamlIslandApp/XamlApp.cs | 47 +++++++++++++ .../WinUILib/CustomListView.cs | 18 +++++ .../WinUILib/ListViewStyles.xaml | 15 ++++ .../WinUILib/MyCustomButton.cs | 19 +++++ .../WinUILib/WinUILib.csproj | 13 ++++ 13 files changed, 347 insertions(+) create mode 100644 Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIsland.sln create mode 100644 Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/App.xaml create mode 100644 Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/App.xaml.cs create mode 100644 Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/AssemblyInfo.cs create mode 100644 Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/MainWindow.xaml create mode 100644 Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/MainWindow.xaml.cs create mode 100644 Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/SimpleWpfXamlIslandApp.csproj create mode 100644 Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/WinUIControlHost.cs create mode 100644 Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/XamlApp.cs create mode 100644 Samples/Islands/SimpleWpfXamlIsland/WinUILib/CustomListView.cs create mode 100644 Samples/Islands/SimpleWpfXamlIsland/WinUILib/ListViewStyles.xaml create mode 100644 Samples/Islands/SimpleWpfXamlIsland/WinUILib/MyCustomButton.cs create mode 100644 Samples/Islands/SimpleWpfXamlIsland/WinUILib/WinUILib.csproj 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..2e70522d4 --- /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..4cd4cdb09 --- /dev/null +++ b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/App.xaml.cs @@ -0,0 +1,14 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace WpfApp1 +{ + /// + /// 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..198598d82 --- /dev/null +++ b/Samples/Islands/SimpleWpfXamlIsland/SimpleWpfXamlIslandApp/MainWindow.xaml @@ -0,0 +1,27 @@ + + + + + + +