From 5ade906a7b0285dd67b753dd4f4a316a1eff1f9f Mon Sep 17 00:00:00 2001 From: Lavius Motileng <58791731+laviusmotileng-ms@users.noreply.github.com> Date: Mon, 9 Mar 2020 23:55:08 -0700 Subject: [PATCH] archive --- PowerToys.sln | 2 +- .../App.xaml | 4 +- .../App.xaml.cs | 2 +- .../MainWindow.xaml | 7 +- .../MainWindow.xaml.cs | 28 +++- ...osoft.PowerToys.Settings.UI.Runner.csproj} | 7 +- .../Program.cs | 4 +- ...Microsoft.PowerToys.Settings.UI.Lib.csproj | 155 ++++++++++++++++++ .../Properties/AssemblyInfo.cs | 29 ++++ ...Microsoft.PowerToys.Settings.UI.Lib.rd.xml | 33 ++++ .../TempUserControl.xaml | 17 ++ .../TempUserControl.xaml.cs | 29 ++++ .../Microsoft.PowerToys.Settings.UI/App.xaml | 3 + .../Controls/DummyUserControl.xaml | 21 +++ .../Controls/DummyUserControl.xaml.cs | 29 ++++ .../Microsoft.PowerToys.Settings.UI.csproj | 21 ++- 16 files changed, 371 insertions(+), 20 deletions(-) rename src/core/Microsoft.PowerToys.Settings.UI.Island/{Microsoft.PowerToys.Settings.UI.Island.csproj => Microsoft.PowerToys.Settings.UI.Runner.csproj} (80%) create mode 100644 src/core/Microsoft.PowerToys.Settings.UI.Lib/Microsoft.PowerToys.Settings.UI.Lib.csproj create mode 100644 src/core/Microsoft.PowerToys.Settings.UI.Lib/Properties/AssemblyInfo.cs create mode 100644 src/core/Microsoft.PowerToys.Settings.UI.Lib/Properties/Microsoft.PowerToys.Settings.UI.Lib.rd.xml create mode 100644 src/core/Microsoft.PowerToys.Settings.UI.Lib/TempUserControl.xaml create mode 100644 src/core/Microsoft.PowerToys.Settings.UI.Lib/TempUserControl.xaml.cs create mode 100644 src/core/Microsoft.PowerToys.Settings.UI/Controls/DummyUserControl.xaml create mode 100644 src/core/Microsoft.PowerToys.Settings.UI/Controls/DummyUserControl.xaml.cs diff --git a/PowerToys.sln b/PowerToys.sln index b6f9f308a1..54e3f0b26f 100644 --- a/PowerToys.sln +++ b/PowerToys.sln @@ -181,7 +181,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Setting EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.PowerToys.Settings.UI", "src\core\Microsoft.PowerToys.Settings.UI\Microsoft.PowerToys.Settings.UI.csproj", "{A7D5099E-F0FD-4BF3-8522-5A682759F915}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Settings.UI.Island", "src\core\Microsoft.PowerToys.Settings.UI.Island\Microsoft.PowerToys.Settings.UI.Island.csproj", "{AE3EFE25-662D-4987-B24E-30E729701B2E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Settings.UI.Runner", "src\core\Microsoft.PowerToys.Settings.UI.Island\Microsoft.PowerToys.Settings.UI.Runner.csproj", "{AE3EFE25-662D-4987-B24E-30E729701B2E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Island/App.xaml b/src/core/Microsoft.PowerToys.Settings.UI.Island/App.xaml index c9b1541c7e..55f56e9c44 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Island/App.xaml +++ b/src/core/Microsoft.PowerToys.Settings.UI.Island/App.xaml @@ -1,7 +1,7 @@ - diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Island/App.xaml.cs b/src/core/Microsoft.PowerToys.Settings.UI.Island/App.xaml.cs index 2d24abb71e..af812c14de 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Island/App.xaml.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Island/App.xaml.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Threading.Tasks; using System.Windows; -namespace SettingsMain +namespace SettingsRunner { /// /// Interaction logic for App.xaml diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Island/MainWindow.xaml b/src/core/Microsoft.PowerToys.Settings.UI.Island/MainWindow.xaml index 8534fd1cea..4c886ea863 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Island/MainWindow.xaml +++ b/src/core/Microsoft.PowerToys.Settings.UI.Island/MainWindow.xaml @@ -1,15 +1,16 @@ - - + diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Island/MainWindow.xaml.cs b/src/core/Microsoft.PowerToys.Settings.UI.Island/MainWindow.xaml.cs index 63203590fd..9aebb03f60 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Island/MainWindow.xaml.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Island/MainWindow.xaml.cs @@ -1,7 +1,9 @@ -using System.Windows; -using Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT; +using System; +using System.Windows; +using Microsoft.Toolkit.Wpf.UI.XamlHost; +using Microsoft.PowerToys.Settings.UI.Controls; -namespace SettingsMain +namespace SettingsRunner { /// /// Interaction logic for MainWindow.xaml @@ -12,5 +14,25 @@ namespace SettingsMain { InitializeComponent(); } + + private void WindowsXamlHost_ChildChanged(object sender, EventArgs e) + { + // Hook up x:Bind source. + WindowsXamlHost windowsXamlHost = sender as WindowsXamlHost; + DummyUserControl userControl = windowsXamlHost.GetUwpInternalObject() as DummyUserControl; + + if (userControl != null) + { + userControl.XamlIslandMessage = this.WPFMessage; + } + } + + public string WPFMessage + { + get + { + return "Binding from WPF to UWP XAML"; + } + } } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Island/Microsoft.PowerToys.Settings.UI.Island.csproj b/src/core/Microsoft.PowerToys.Settings.UI.Island/Microsoft.PowerToys.Settings.UI.Runner.csproj similarity index 80% rename from src/core/Microsoft.PowerToys.Settings.UI.Island/Microsoft.PowerToys.Settings.UI.Island.csproj rename to src/core/Microsoft.PowerToys.Settings.UI.Island/Microsoft.PowerToys.Settings.UI.Runner.csproj index 18f8248e47..23ea0b3b90 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Island/Microsoft.PowerToys.Settings.UI.Island.csproj +++ b/src/core/Microsoft.PowerToys.Settings.UI.Island/Microsoft.PowerToys.Settings.UI.Runner.csproj @@ -4,7 +4,7 @@ WinExe netcoreapp3.1 true - SettingsMain.Program + SettingsRunner.Program Microsoft Corporation PowerToys Windows system utilities to maximize productivity @@ -20,11 +20,6 @@ - - - - - True diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Island/Program.cs b/src/core/Microsoft.PowerToys.Settings.UI.Island/Program.cs index 261b94f737..566fe1508a 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Island/Program.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Island/Program.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace SettingsMain +namespace SettingsRunner { public class Program { @@ -11,7 +11,7 @@ namespace SettingsMain { using (new SettingsUI.App()) { - SettingsMain.App app = new SettingsMain.App(); + SettingsRunner.App app = new SettingsRunner.App(); app.InitializeComponent(); app.Run(); } diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/Microsoft.PowerToys.Settings.UI.Lib.csproj b/src/core/Microsoft.PowerToys.Settings.UI.Lib/Microsoft.PowerToys.Settings.UI.Lib.csproj new file mode 100644 index 0000000000..13ecc203a7 --- /dev/null +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/Microsoft.PowerToys.Settings.UI.Lib.csproj @@ -0,0 +1,155 @@ + + + + + Debug + AnyCPU + {97FA570D-6FE2-4625-A6C5-9572C81F39AD} + Library + Properties + Microsoft.PowerToys.Settings.UI.Lib + Microsoft.PowerToys.Settings.UI.Lib + en-US + UAP + 10.0.18362.0 + 10.0.18362.0 + 14 + 512 + {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + prompt + 4 + + + x86 + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + false + prompt + + + x86 + bin\x86\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + false + prompt + + + ARM + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + false + prompt + + + ARM + bin\ARM\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + false + prompt + + + ARM64 + true + bin\ARM64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + false + prompt + + + ARM64 + bin\ARM64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + false + prompt + + + x64 + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + false + prompt + + + x64 + bin\x64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + false + prompt + + + PackageReference + + + + + TempUserControl.xaml + + + + + + 6.2.9 + + + + + Designer + MSBuild:Compile + + + + 14.0 + + + false + false + + + + \ No newline at end of file diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/Properties/AssemblyInfo.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..508d5c03a1 --- /dev/null +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/Properties/AssemblyInfo.cs @@ -0,0 +1,29 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Microsoft.PowerToys.Settings.UI.Lib")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Microsoft.PowerToys.Settings.UI.Lib")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/Properties/Microsoft.PowerToys.Settings.UI.Lib.rd.xml b/src/core/Microsoft.PowerToys.Settings.UI.Lib/Properties/Microsoft.PowerToys.Settings.UI.Lib.rd.xml new file mode 100644 index 0000000000..8236fd62d2 --- /dev/null +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/Properties/Microsoft.PowerToys.Settings.UI.Lib.rd.xml @@ -0,0 +1,33 @@ + + + + + + + + + diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/TempUserControl.xaml b/src/core/Microsoft.PowerToys.Settings.UI.Lib/TempUserControl.xaml new file mode 100644 index 0000000000..e6e9e9405f --- /dev/null +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/TempUserControl.xaml @@ -0,0 +1,17 @@ + + + + This is a simple custom UWP control + + + + diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/TempUserControl.xaml.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/TempUserControl.xaml.cs new file mode 100644 index 0000000000..9348f0d95c --- /dev/null +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/TempUserControl.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 + +namespace Microsoft.PowerToys.Settings.UI.Lib +{ + public sealed partial class TempUserControl : UserControl + { + public string XamlIslandMessage { get; set; } + + public TempUserControl() + { + this.InitializeComponent(); + } + } +} diff --git a/src/core/Microsoft.PowerToys.Settings.UI/App.xaml b/src/core/Microsoft.PowerToys.Settings.UI/App.xaml index 9c8ab5980f..a11716c849 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/App.xaml +++ b/src/core/Microsoft.PowerToys.Settings.UI/App.xaml @@ -4,4 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:xaml="using:Microsoft.Toolkit.Win32.UI.XamlHost" xmlns:local="using:SettingsUI"> + + + \ No newline at end of file diff --git a/src/core/Microsoft.PowerToys.Settings.UI/Controls/DummyUserControl.xaml b/src/core/Microsoft.PowerToys.Settings.UI/Controls/DummyUserControl.xaml new file mode 100644 index 0000000000..769343e415 --- /dev/null +++ b/src/core/Microsoft.PowerToys.Settings.UI/Controls/DummyUserControl.xaml @@ -0,0 +1,21 @@ + + + + + This is a simple custom UWP control + + + + + + diff --git a/src/core/Microsoft.PowerToys.Settings.UI/Controls/DummyUserControl.xaml.cs b/src/core/Microsoft.PowerToys.Settings.UI/Controls/DummyUserControl.xaml.cs new file mode 100644 index 0000000000..e543c486a3 --- /dev/null +++ b/src/core/Microsoft.PowerToys.Settings.UI/Controls/DummyUserControl.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 + +namespace Microsoft.PowerToys.Settings.UI.Controls +{ + public sealed partial class DummyUserControl : UserControl + { + public string XamlIslandMessage { get; set; } + + public DummyUserControl() + { + this.InitializeComponent(); + } + } +} diff --git a/src/core/Microsoft.PowerToys.Settings.UI/Microsoft.PowerToys.Settings.UI.csproj b/src/core/Microsoft.PowerToys.Settings.UI/Microsoft.PowerToys.Settings.UI.csproj index 616ba519ee..8440c7ce4a 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/Microsoft.PowerToys.Settings.UI.csproj +++ b/src/core/Microsoft.PowerToys.Settings.UI/Microsoft.PowerToys.Settings.UI.csproj @@ -7,8 +7,8 @@ {A7D5099E-F0FD-4BF3-8522-5A682759F915} AppContainerExe Properties - settingsui - settingsui + Microsoft.PowerToys.Settings.UI + Microsoft.PowerToys.Settings.UI en-US UAP 10.0.18362.0 @@ -119,6 +119,9 @@ App.xaml + + DummyUserControl.xaml + @@ -144,10 +147,24 @@ 6.0.0 + + 2.4.0-prerelease.200203002 + + + + + + Designer + MSBuild:Compile + 14.0 + + false + false +