From d54c6f125e19d330d4f30acaa2f2a514966d706f Mon Sep 17 00:00:00 2001 From: Lamparter <71598437+Lamparter@users.noreply.github.com> Date: Tue, 11 Mar 2025 17:36:46 +0000 Subject: [PATCH 01/10] Added Generic.xaml back for Riverside.Toolkit.Icons --- .../Themes/Generic.xaml | 27 +++++++++++++++++++ .../Riverside.Toolkit.Wpf.Icons.csproj | 3 +++ 2 files changed, 30 insertions(+) create mode 100644 src/core/Riverside.Toolkit.Icons/Themes/Generic.xaml diff --git a/src/core/Riverside.Toolkit.Icons/Themes/Generic.xaml b/src/core/Riverside.Toolkit.Icons/Themes/Generic.xaml new file mode 100644 index 0000000..10cd82e --- /dev/null +++ b/src/core/Riverside.Toolkit.Icons/Themes/Generic.xaml @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/src/platforms/Riverside.Toolkit.Wpf.Icons/Riverside.Toolkit.Wpf.Icons.csproj b/src/platforms/Riverside.Toolkit.Wpf.Icons/Riverside.Toolkit.Wpf.Icons.csproj index 35e3d84..07e992d 100644 --- a/src/platforms/Riverside.Toolkit.Wpf.Icons/Riverside.Toolkit.Wpf.Icons.csproj +++ b/src/platforms/Riverside.Toolkit.Wpf.Icons/Riverside.Toolkit.Wpf.Icons.csproj @@ -1,2 +1,5 @@ + + + From efc8d9b13f621b9214d8a4398815f12152d78b40 Mon Sep 17 00:00:00 2001 From: Lamparter <71598437+Lamparter@users.noreply.github.com> Date: Tue, 11 Mar 2025 17:43:34 +0000 Subject: [PATCH 02/10] Added a filler generic.xaml for wpf (Riverside.Toolkit.Icons) bad practice] kids, don't do this --- .../Themes/Generic.xaml | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/platforms/Riverside.Toolkit.Wpf.Icons/Themes/Generic.xaml diff --git a/src/platforms/Riverside.Toolkit.Wpf.Icons/Themes/Generic.xaml b/src/platforms/Riverside.Toolkit.Wpf.Icons/Themes/Generic.xaml new file mode 100644 index 0000000..5e48122 --- /dev/null +++ b/src/platforms/Riverside.Toolkit.Wpf.Icons/Themes/Generic.xaml @@ -0,0 +1,28 @@ + + + + + \ No newline at end of file From 6539ea91c60050b571b167f80410d1056e36782b Mon Sep 17 00:00:00 2001 From: Lamparter <71598437+Lamparter@users.noreply.github.com> Date: Tue, 11 Mar 2025 18:00:40 +0000 Subject: [PATCH 03/10] Rename Riverside.Toolkit.Brushes to Riverside.Toolkit.Media Preparing for GlowUI (Riverside.GlowUI.Materials will be here) --- CubeKit.slnx | 6 +++--- .../ApplicationBrushes.xaml | 0 .../BackdropKind.cs | 2 +- .../MicaAltBrush.cs | 2 +- .../MicaBrushes.xaml | 2 +- .../Riverside.Toolkit.Media.projitems} | 2 +- .../Riverside.Toolkit.Media.shproj} | 2 +- .../StyleBrushes.xaml | 0 .../Riverside.Toolkit.Uwp.Media.csproj} | 0 .../Riverside.Toolkit.WinUI.Media.csproj} | 0 10 files changed, 8 insertions(+), 8 deletions(-) rename src/core/{Riverside.Toolkit.Brushes => Riverside.Toolkit.Media}/ApplicationBrushes.xaml (100%) rename src/core/{Riverside.Toolkit.Brushes => Riverside.Toolkit.Media}/BackdropKind.cs (67%) rename src/core/{Riverside.Toolkit.Brushes => Riverside.Toolkit.Media}/MicaAltBrush.cs (99%) rename src/core/{Riverside.Toolkit.Brushes => Riverside.Toolkit.Media}/MicaBrushes.xaml (98%) rename src/core/{Riverside.Toolkit.Brushes/Riverside.Toolkit.Brushes.projitems => Riverside.Toolkit.Media/Riverside.Toolkit.Media.projitems} (91%) rename src/core/{Riverside.Toolkit.Brushes/Riverside.Toolkit.Brushes.shproj => Riverside.Toolkit.Media/Riverside.Toolkit.Media.shproj} (92%) rename src/core/{Riverside.Toolkit.Brushes => Riverside.Toolkit.Media}/StyleBrushes.xaml (100%) rename src/platforms/{Riverside.Toolkit.Uwp.Brushes/Riverside.Toolkit.Uwp.Brushes.csproj => Riverside.Toolkit.Uwp.Media/Riverside.Toolkit.Uwp.Media.csproj} (100%) rename src/platforms/{Riverside.Toolkit.WinUI.Brushes/Riverside.Toolkit.WinUI.Brushes.csproj => Riverside.Toolkit.WinUI.Media/Riverside.Toolkit.WinUI.Media.csproj} (100%) diff --git a/CubeKit.slnx b/CubeKit.slnx index 204be4b..f247e43 100644 --- a/CubeKit.slnx +++ b/CubeKit.slnx @@ -33,7 +33,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -87,7 +87,7 @@ - + diff --git a/src/core/Riverside.Toolkit.Brushes/ApplicationBrushes.xaml b/src/core/Riverside.Toolkit.Media/ApplicationBrushes.xaml similarity index 100% rename from src/core/Riverside.Toolkit.Brushes/ApplicationBrushes.xaml rename to src/core/Riverside.Toolkit.Media/ApplicationBrushes.xaml diff --git a/src/core/Riverside.Toolkit.Brushes/BackdropKind.cs b/src/core/Riverside.Toolkit.Media/BackdropKind.cs similarity index 67% rename from src/core/Riverside.Toolkit.Brushes/BackdropKind.cs rename to src/core/Riverside.Toolkit.Media/BackdropKind.cs index fc79f2a..da517fd 100644 --- a/src/core/Riverside.Toolkit.Brushes/BackdropKind.cs +++ b/src/core/Riverside.Toolkit.Media/BackdropKind.cs @@ -1,4 +1,4 @@ -namespace Riverside.Toolkit.Brushes; +namespace Riverside.Toolkit.Media; public enum BackdropKind { diff --git a/src/core/Riverside.Toolkit.Brushes/MicaAltBrush.cs b/src/core/Riverside.Toolkit.Media/MicaAltBrush.cs similarity index 99% rename from src/core/Riverside.Toolkit.Brushes/MicaAltBrush.cs rename to src/core/Riverside.Toolkit.Media/MicaAltBrush.cs index e7e55ad..876f009 100644 --- a/src/core/Riverside.Toolkit.Brushes/MicaAltBrush.cs +++ b/src/core/Riverside.Toolkit.Media/MicaAltBrush.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using Windows.ApplicationModel; -namespace Riverside.Toolkit.Brushes; +namespace Riverside.Toolkit.Media; public class MicaAltBrush : XamlCompositionBrushBase, INotifyPropertyChanged { diff --git a/src/core/Riverside.Toolkit.Brushes/MicaBrushes.xaml b/src/core/Riverside.Toolkit.Media/MicaBrushes.xaml similarity index 98% rename from src/core/Riverside.Toolkit.Brushes/MicaBrushes.xaml rename to src/core/Riverside.Toolkit.Media/MicaBrushes.xaml index f539e88..9dbad50 100644 --- a/src/core/Riverside.Toolkit.Brushes/MicaBrushes.xaml +++ b/src/core/Riverside.Toolkit.Media/MicaBrushes.xaml @@ -1,7 +1,7 @@ diff --git a/src/core/Riverside.Toolkit.Brushes/Riverside.Toolkit.Brushes.projitems b/src/core/Riverside.Toolkit.Media/Riverside.Toolkit.Media.projitems similarity index 91% rename from src/core/Riverside.Toolkit.Brushes/Riverside.Toolkit.Brushes.projitems rename to src/core/Riverside.Toolkit.Media/Riverside.Toolkit.Media.projitems index 92c12b0..6666f4c 100644 --- a/src/core/Riverside.Toolkit.Brushes/Riverside.Toolkit.Brushes.projitems +++ b/src/core/Riverside.Toolkit.Media/Riverside.Toolkit.Media.projitems @@ -6,7 +6,7 @@ bcdc11ec-a933-4b7b-829b-58af5aa5dd14 - Riverside.Toolkit.Brushes + Riverside.Toolkit.Media diff --git a/src/core/Riverside.Toolkit.Brushes/Riverside.Toolkit.Brushes.shproj b/src/core/Riverside.Toolkit.Media/Riverside.Toolkit.Media.shproj similarity index 92% rename from src/core/Riverside.Toolkit.Brushes/Riverside.Toolkit.Brushes.shproj rename to src/core/Riverside.Toolkit.Media/Riverside.Toolkit.Media.shproj index 38d35ea..b22dc55 100644 --- a/src/core/Riverside.Toolkit.Brushes/Riverside.Toolkit.Brushes.shproj +++ b/src/core/Riverside.Toolkit.Media/Riverside.Toolkit.Media.shproj @@ -8,6 +8,6 @@ - + diff --git a/src/core/Riverside.Toolkit.Brushes/StyleBrushes.xaml b/src/core/Riverside.Toolkit.Media/StyleBrushes.xaml similarity index 100% rename from src/core/Riverside.Toolkit.Brushes/StyleBrushes.xaml rename to src/core/Riverside.Toolkit.Media/StyleBrushes.xaml diff --git a/src/platforms/Riverside.Toolkit.Uwp.Brushes/Riverside.Toolkit.Uwp.Brushes.csproj b/src/platforms/Riverside.Toolkit.Uwp.Media/Riverside.Toolkit.Uwp.Media.csproj similarity index 100% rename from src/platforms/Riverside.Toolkit.Uwp.Brushes/Riverside.Toolkit.Uwp.Brushes.csproj rename to src/platforms/Riverside.Toolkit.Uwp.Media/Riverside.Toolkit.Uwp.Media.csproj diff --git a/src/platforms/Riverside.Toolkit.WinUI.Brushes/Riverside.Toolkit.WinUI.Brushes.csproj b/src/platforms/Riverside.Toolkit.WinUI.Media/Riverside.Toolkit.WinUI.Media.csproj similarity index 100% rename from src/platforms/Riverside.Toolkit.WinUI.Brushes/Riverside.Toolkit.WinUI.Brushes.csproj rename to src/platforms/Riverside.Toolkit.WinUI.Media/Riverside.Toolkit.WinUI.Media.csproj From 606d4f4f18628f44380de06d744d3bb22fae7820 Mon Sep 17 00:00:00 2001 From: Lamparter <71598437+Lamparter@users.noreply.github.com> Date: Tue, 11 Mar 2025 18:05:14 +0000 Subject: [PATCH 04/10] Reorder SLN and remove WPF icons generic.xaml --- CubeKit.slnx | 10 +++---- .../Themes/Generic.xaml | 28 ------------------- 2 files changed, 5 insertions(+), 33 deletions(-) delete mode 100644 src/platforms/Riverside.Toolkit.Wpf.Icons/Themes/Generic.xaml diff --git a/CubeKit.slnx b/CubeKit.slnx index f247e43..a4da1da 100644 --- a/CubeKit.slnx +++ b/CubeKit.slnx @@ -33,13 +33,13 @@ - + @@ -65,9 +65,6 @@ - - - @@ -83,17 +80,20 @@ + + + - + diff --git a/src/platforms/Riverside.Toolkit.Wpf.Icons/Themes/Generic.xaml b/src/platforms/Riverside.Toolkit.Wpf.Icons/Themes/Generic.xaml deleted file mode 100644 index 5e48122..0000000 --- a/src/platforms/Riverside.Toolkit.Wpf.Icons/Themes/Generic.xaml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - \ No newline at end of file From 9efc37e25271a3df325d61bd4368dbf1c1585110 Mon Sep 17 00:00:00 2001 From: Lamparter <71598437+Lamparter@users.noreply.github.com> Date: Tue, 11 Mar 2025 18:24:54 +0000 Subject: [PATCH 05/10] Added `Riverside.Toolkit.Media` (Riverside.GlowUI.Materials) --- .../Riverside.Toolkit.Media/AuroraLite.xaml | 741 ++++++++++++++ .../AuroraLite.xaml.cs | 9 + src/core/Riverside.Toolkit.Media/Bloom.html | 917 ++++++++++++++++++ .../Riverside.Toolkit.Media/BloomView.xaml | 18 + .../Riverside.Toolkit.Media/BloomView.xaml.cs | 25 + .../Riverside.Toolkit.Media.projitems | 4 + .../Windows11Danger.html | 908 +++++++++++++++++ 7 files changed, 2622 insertions(+) create mode 100644 src/core/Riverside.Toolkit.Media/AuroraLite.xaml create mode 100644 src/core/Riverside.Toolkit.Media/AuroraLite.xaml.cs create mode 100644 src/core/Riverside.Toolkit.Media/Bloom.html create mode 100644 src/core/Riverside.Toolkit.Media/BloomView.xaml create mode 100644 src/core/Riverside.Toolkit.Media/BloomView.xaml.cs create mode 100644 src/core/Riverside.Toolkit.Media/Windows11Danger.html diff --git a/src/core/Riverside.Toolkit.Media/AuroraLite.xaml b/src/core/Riverside.Toolkit.Media/AuroraLite.xaml new file mode 100644 index 0000000..ae18033 --- /dev/null +++ b/src/core/Riverside.Toolkit.Media/AuroraLite.xaml @@ -0,0 +1,741 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/core/Riverside.Toolkit.Media/AuroraLite.xaml.cs b/src/core/Riverside.Toolkit.Media/AuroraLite.xaml.cs new file mode 100644 index 0000000..d65f342 --- /dev/null +++ b/src/core/Riverside.Toolkit.Media/AuroraLite.xaml.cs @@ -0,0 +1,9 @@ +namespace Riverside.Toolkit.Media; + +public sealed partial class AuroraLite : UserControl +{ + public AuroraLite() + { + this.InitializeComponent(); + } +} \ No newline at end of file diff --git a/src/core/Riverside.Toolkit.Media/Bloom.html b/src/core/Riverside.Toolkit.Media/Bloom.html new file mode 100644 index 0000000..d9a9cb1 --- /dev/null +++ b/src/core/Riverside.Toolkit.Media/Bloom.html @@ -0,0 +1,917 @@ + + + + + + + + + + + + + + + [ ] + + + + + + + [After your PC is ready] + + + [Swipe in from any edge] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [After your PC is ready] + + + [With mouse, go to corners] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [After your PC is ready] + + + [With touch, swipe in from any edge] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [After your PC is ready] + + + [With mouse, go to corners] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Installing apps] + + + + [This might take a few minutes] + + + + [Getting your apps ready] + + + + + + + + + + [Don't turn off your PC] + + + [Getting your PC ready] + + + + + [Almost ready] + + + + + + + + + + [ZDP Installing Updates] + + + + [ZDP Don't turn off your PC] + + + + + + + + + + + + [Let's start] + + + + + + \ No newline at end of file diff --git a/src/core/Riverside.Toolkit.Media/BloomView.xaml b/src/core/Riverside.Toolkit.Media/BloomView.xaml new file mode 100644 index 0000000..c199bc3 --- /dev/null +++ b/src/core/Riverside.Toolkit.Media/BloomView.xaml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/src/core/Riverside.Toolkit.Media/BloomView.xaml.cs b/src/core/Riverside.Toolkit.Media/BloomView.xaml.cs new file mode 100644 index 0000000..1f903ed --- /dev/null +++ b/src/core/Riverside.Toolkit.Media/BloomView.xaml.cs @@ -0,0 +1,25 @@ +namespace Riverside.Toolkit.Media; + +public sealed partial class BloomView : UserControl +{ + public BloomView() + { + this.InitializeComponent(); + BloomWebView.Height = Window.Current.Bounds.Height; + BloomWebView.Width = Window.Current.Bounds.Width; +#if Uwp + BloomWebView.Source = new("ms-appx-web:///Riverside.Toolkit.Uwp.Media/Bloom.html"); +#elif WinUI + BloomWebView.Source = new("ms-appx-web:///Riverside.Toolkit.WinUI.Media/Bloom.html"); +#endif +#if WinUI + BloomWebView.DefaultBackgroundColor = Colors.Transparent; +#endif + } + + private void Bloom_SizeChanged(object sender, SizeChangedEventArgs e) + { + BloomWebView.Height = Window.Current.Bounds.Height; + BloomWebView.Width = Window.Current.Bounds.Width; + } +} \ No newline at end of file diff --git a/src/core/Riverside.Toolkit.Media/Riverside.Toolkit.Media.projitems b/src/core/Riverside.Toolkit.Media/Riverside.Toolkit.Media.projitems index 6666f4c..eb5b849 100644 --- a/src/core/Riverside.Toolkit.Media/Riverside.Toolkit.Media.projitems +++ b/src/core/Riverside.Toolkit.Media/Riverside.Toolkit.Media.projitems @@ -16,4 +16,8 @@ Designer + + + + \ No newline at end of file diff --git a/src/core/Riverside.Toolkit.Media/Windows11Danger.html b/src/core/Riverside.Toolkit.Media/Windows11Danger.html new file mode 100644 index 0000000..a8feaa0 --- /dev/null +++ b/src/core/Riverside.Toolkit.Media/Windows11Danger.html @@ -0,0 +1,908 @@ + + + + + + + + + + + + + + [ ] + + + + + + + [After your PC is ready] + + + [Swipe in from any edge] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [After your PC is ready] + + + [With mouse, go to corners] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [After your PC is ready] + + + [With touch, swipe in from any edge] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [After your PC is ready] + + + [With mouse, go to corners] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Installing apps] + + + + [This might take a few minutes] + + + + [Getting your apps ready] + + + + + + + + + + [Don't turn off your PC] + + + [Getting your PC ready] + + + + + [Almost ready] + + + + + + + + + + [ZDP Installing Updates] + + + + [ZDP Don't turn off your PC] + + + + + + + + + + + + + [Let's start] + + + + + \ No newline at end of file From a45522ff93e996e62227ee7dd6cba729cf3c45a7 Mon Sep 17 00:00:00 2001 From: Lamparter <71598437+Lamparter@users.noreply.github.com> Date: Tue, 11 Mar 2025 18:31:42 +0000 Subject: [PATCH 06/10] Add back `Generic.xaml` for TitleBarEx --- .../Themes/Generic.xaml | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 src/core/Riverside.Toolkit.Controls.TitleBar/Themes/Generic.xaml diff --git a/src/core/Riverside.Toolkit.Controls.TitleBar/Themes/Generic.xaml b/src/core/Riverside.Toolkit.Controls.TitleBar/Themes/Generic.xaml new file mode 100644 index 0000000..94c8e0a --- /dev/null +++ b/src/core/Riverside.Toolkit.Controls.TitleBar/Themes/Generic.xaml @@ -0,0 +1,148 @@ + + + \ No newline at end of file From f724550c95b5982a382ce9d454129c2b3d3ad8c8 Mon Sep 17 00:00:00 2001 From: Lamparter <71598437+Lamparter@users.noreply.github.com> Date: Tue, 11 Mar 2025 19:43:02 +0000 Subject: [PATCH 07/10] Add GlowUI --- CubeKit.slnx | 10 + Directory.Packages.props | 1 + .../Riverside.GlowUI.Styles/ComboBox.xaml | 1095 +++++ .../CubeThemeDictionary.xaml | 175 + src/core/Riverside.GlowUI.Styles/CubeUI.xaml | 591 +++ .../Riverside.GlowUI.Styles/FlipView.xaml | 259 ++ src/core/Riverside.GlowUI.Styles/Flyout.xaml | 69 + .../GlowGradientUI.xaml | 3761 +++++++++++++++++ src/core/Riverside.GlowUI.Styles/InfoBar.xaml | 234 + .../NavigationView.xaml | 1653 ++++++++ src/core/Riverside.GlowUI.Styles/Pivot.xaml | 590 +++ src/core/Riverside.GlowUI.Styles/Radio.xaml | 370 ++ .../Riverside.GlowUI.Styles/RichEditBox.xaml | 217 + .../Riverside.GlowUI.Styles.projitems | 19 + .../Riverside.GlowUI.Styles.shproj | 13 + src/core/Riverside.GlowUI.Styles/Slider.xaml | 542 +++ .../Riverside.GlowUI.Styles/SplitView.xaml | 743 ++++ src/core/Riverside.GlowUI.Styles/TabView.xaml | 856 ++++ src/core/Riverside.GlowUI.Styles/TextBox.xaml | 343 ++ .../ToggleSwitches.xaml | 1328 ++++++ src/core/Riverside.GlowUI.Styles/ToolTip.xaml | 58 + .../Riverside.GlowUI.Styles/WindowChrome.xaml | 558 +++ .../GlowBall.xaml | 23 + .../GlowBall.xaml.cs | 18 + .../GlowLine.xaml | 23 + .../GlowLine.xaml.cs | 9 + ...verside.Toolkit.Controls.Crimson.projitems | 19 + .../Riverside.Toolkit.Controls.Crimson.shproj | 13 + .../Riverside.GlowUI.Uwp.Styles.csproj | 13 + .../Riverside.GlowUI.WinUI.Styles.csproj | 11 + ...erside.Toolkit.Uwp.Controls.Crimson.csproj | 7 + ...side.Toolkit.WinUI.Controls.Crimson.csproj | 5 + 32 files changed, 13626 insertions(+) create mode 100644 src/core/Riverside.GlowUI.Styles/ComboBox.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/CubeThemeDictionary.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/CubeUI.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/FlipView.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/Flyout.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/GlowGradientUI.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/InfoBar.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/NavigationView.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/Pivot.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/Radio.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/RichEditBox.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/Riverside.GlowUI.Styles.projitems create mode 100644 src/core/Riverside.GlowUI.Styles/Riverside.GlowUI.Styles.shproj create mode 100644 src/core/Riverside.GlowUI.Styles/Slider.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/SplitView.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/TabView.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/TextBox.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/ToggleSwitches.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/ToolTip.xaml create mode 100644 src/core/Riverside.GlowUI.Styles/WindowChrome.xaml create mode 100644 src/core/Riverside.Toolkit.Controls.Crimson/GlowBall.xaml create mode 100644 src/core/Riverside.Toolkit.Controls.Crimson/GlowBall.xaml.cs create mode 100644 src/core/Riverside.Toolkit.Controls.Crimson/GlowLine.xaml create mode 100644 src/core/Riverside.Toolkit.Controls.Crimson/GlowLine.xaml.cs create mode 100644 src/core/Riverside.Toolkit.Controls.Crimson/Riverside.Toolkit.Controls.Crimson.projitems create mode 100644 src/core/Riverside.Toolkit.Controls.Crimson/Riverside.Toolkit.Controls.Crimson.shproj create mode 100644 src/platforms/Riverside.GlowUI.Uwp.Styles/Riverside.GlowUI.Uwp.Styles.csproj create mode 100644 src/platforms/Riverside.GlowUI.WinUI.Styles/Riverside.GlowUI.WinUI.Styles.csproj create mode 100644 src/platforms/Riverside.Toolkit.Uwp.Controls.Crimson/Riverside.Toolkit.Uwp.Controls.Crimson.csproj create mode 100644 src/platforms/Riverside.Toolkit.WinUI.Controls.Crimson/Riverside.Toolkit.WinUI.Controls.Crimson.csproj diff --git a/CubeKit.slnx b/CubeKit.slnx index a4da1da..c7eb810 100644 --- a/CubeKit.slnx +++ b/CubeKit.slnx @@ -32,7 +32,9 @@ + + @@ -56,6 +58,10 @@ + + + + @@ -65,6 +71,9 @@ + + + @@ -87,6 +96,7 @@ + diff --git a/Directory.Packages.props b/Directory.Packages.props index 5d00f37..bfeb8c9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -8,6 +8,7 @@ + diff --git a/src/core/Riverside.GlowUI.Styles/ComboBox.xaml b/src/core/Riverside.GlowUI.Styles/ComboBox.xaml new file mode 100644 index 0000000..f841c06 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/ComboBox.xaml @@ -0,0 +1,1095 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visible + + + + + + + + + + + + + + + + + + diff --git a/src/core/Riverside.GlowUI.Styles/CubeThemeDictionary.xaml b/src/core/Riverside.GlowUI.Styles/CubeThemeDictionary.xaml new file mode 100644 index 0000000..58ece32 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/CubeThemeDictionary.xaml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + White + + + + + + + + + + + + + + + + + + + + + + + + Black + + + + + + + + + + + + + + + + + + + + + White + + + + + + + + + + + + + + + + + diff --git a/src/core/Riverside.GlowUI.Styles/CubeUI.xaml b/src/core/Riverside.GlowUI.Styles/CubeUI.xaml new file mode 100644 index 0000000..197bbbd --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/CubeUI.xaml @@ -0,0 +1,591 @@ + + + + + + + + + + + diff --git a/src/core/Riverside.GlowUI.Styles/FlipView.xaml b/src/core/Riverside.GlowUI.Styles/FlipView.xaml new file mode 100644 index 0000000..e5ed47b --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/FlipView.xaml @@ -0,0 +1,259 @@ + + + diff --git a/src/core/Riverside.GlowUI.Styles/Flyout.xaml b/src/core/Riverside.GlowUI.Styles/Flyout.xaml new file mode 100644 index 0000000..4003b59 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/Flyout.xaml @@ -0,0 +1,69 @@ + + + + + diff --git a/src/core/Riverside.GlowUI.Styles/GlowGradientUI.xaml b/src/core/Riverside.GlowUI.Styles/GlowGradientUI.xaml new file mode 100644 index 0000000..3351c0a --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/GlowGradientUI.xaml @@ -0,0 +1,3761 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visible + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visible + + + + + + + + + + + + + + + + + + + + + diff --git a/src/core/Riverside.GlowUI.Styles/InfoBar.xaml b/src/core/Riverside.GlowUI.Styles/InfoBar.xaml new file mode 100644 index 0000000..ecf5612 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/InfoBar.xaml @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/core/Riverside.GlowUI.Styles/NavigationView.xaml b/src/core/Riverside.GlowUI.Styles/NavigationView.xaml new file mode 100644 index 0000000..37c4690 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/NavigationView.xaml @@ -0,0 +1,1653 @@ + + + + + #003A3A3A + #4C3A3A3A + #403A3A3A + + + + + + + + + + + #00FFFFFF + #B0FFFFFF + #80FFFFFF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/core/Riverside.GlowUI.Styles/Pivot.xaml b/src/core/Riverside.GlowUI.Styles/Pivot.xaml new file mode 100644 index 0000000..68bf00e --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/Pivot.xaml @@ -0,0 +1,590 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/core/Riverside.GlowUI.Styles/Radio.xaml b/src/core/Riverside.GlowUI.Styles/Radio.xaml new file mode 100644 index 0000000..ff614d5 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/Radio.xaml @@ -0,0 +1,370 @@ + + + + diff --git a/src/core/Riverside.GlowUI.Styles/RichEditBox.xaml b/src/core/Riverside.GlowUI.Styles/RichEditBox.xaml new file mode 100644 index 0000000..88bb631 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/RichEditBox.xaml @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visible + + + + + + + + + + + + + + diff --git a/src/core/Riverside.GlowUI.Styles/Riverside.GlowUI.Styles.projitems b/src/core/Riverside.GlowUI.Styles/Riverside.GlowUI.Styles.projitems new file mode 100644 index 0000000..bef5ed9 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/Riverside.GlowUI.Styles.projitems @@ -0,0 +1,19 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + 0c0c40c2-ce7b-4478-a571-fd5595511996 + + + Riverside.GlowUI.Styles + + + + + $(DefaultXamlRuntime) + MSBuild:Compile + Designer + + + \ No newline at end of file diff --git a/src/core/Riverside.GlowUI.Styles/Riverside.GlowUI.Styles.shproj b/src/core/Riverside.GlowUI.Styles/Riverside.GlowUI.Styles.shproj new file mode 100644 index 0000000..0ee1d42 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/Riverside.GlowUI.Styles.shproj @@ -0,0 +1,13 @@ + + + + 0c0c40c2-ce7b-4478-a571-fd5595511996 + 14.0 + + + + + + + + diff --git a/src/core/Riverside.GlowUI.Styles/Slider.xaml b/src/core/Riverside.GlowUI.Styles/Slider.xaml new file mode 100644 index 0000000..8a63338 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/Slider.xaml @@ -0,0 +1,542 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/core/Riverside.GlowUI.Styles/SplitView.xaml b/src/core/Riverside.GlowUI.Styles/SplitView.xaml new file mode 100644 index 0000000..89d3d84 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/SplitView.xaml @@ -0,0 +1,743 @@ + + + diff --git a/src/core/Riverside.GlowUI.Styles/TabView.xaml b/src/core/Riverside.GlowUI.Styles/TabView.xaml new file mode 100644 index 0000000..6483dbb --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/TabView.xaml @@ -0,0 +1,856 @@ + + + + + + + + + + + + + diff --git a/src/core/Riverside.GlowUI.Styles/TextBox.xaml b/src/core/Riverside.GlowUI.Styles/TextBox.xaml new file mode 100644 index 0000000..41ce19c --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/TextBox.xaml @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visible + + + + + + + + + + + + + + + + diff --git a/src/core/Riverside.GlowUI.Styles/ToggleSwitches.xaml b/src/core/Riverside.GlowUI.Styles/ToggleSwitches.xaml new file mode 100644 index 0000000..f062dd0 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/ToggleSwitches.xaml @@ -0,0 +1,1328 @@ + + + + + diff --git a/src/core/Riverside.GlowUI.Styles/ToolTip.xaml b/src/core/Riverside.GlowUI.Styles/ToolTip.xaml new file mode 100644 index 0000000..52b6196 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/ToolTip.xaml @@ -0,0 +1,58 @@ + + + + diff --git a/src/core/Riverside.GlowUI.Styles/WindowChrome.xaml b/src/core/Riverside.GlowUI.Styles/WindowChrome.xaml new file mode 100644 index 0000000..991eff0 --- /dev/null +++ b/src/core/Riverside.GlowUI.Styles/WindowChrome.xaml @@ -0,0 +1,558 @@ + + + + + #202020 + + + + #f3f3f3 + + + Transparent + Transparent + + + + + + + + + \ No newline at end of file diff --git a/src/core/Riverside.Toolkit.Controls.Crimson/GlowBall.xaml b/src/core/Riverside.Toolkit.Controls.Crimson/GlowBall.xaml new file mode 100644 index 0000000..6d63e6a --- /dev/null +++ b/src/core/Riverside.Toolkit.Controls.Crimson/GlowBall.xaml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/src/core/Riverside.Toolkit.Controls.Crimson/GlowBall.xaml.cs b/src/core/Riverside.Toolkit.Controls.Crimson/GlowBall.xaml.cs new file mode 100644 index 0000000..d5229fd --- /dev/null +++ b/src/core/Riverside.Toolkit.Controls.Crimson/GlowBall.xaml.cs @@ -0,0 +1,18 @@ +namespace Riverside.Toolkit.Controls; + +public sealed partial class GlowBall : UserControl +{ + public Color Color + { + get { return (Color)GetValue(ColorProperty); } + set { SetValue(ColorProperty, value); } + } + + public static readonly DependencyProperty ColorProperty = + DependencyProperty.Register("Color", typeof(Color), typeof(UserControl), null); + + public GlowBall() + { + this.InitializeComponent(); + } +} \ No newline at end of file diff --git a/src/core/Riverside.Toolkit.Controls.Crimson/GlowLine.xaml b/src/core/Riverside.Toolkit.Controls.Crimson/GlowLine.xaml new file mode 100644 index 0000000..cffc8dc --- /dev/null +++ b/src/core/Riverside.Toolkit.Controls.Crimson/GlowLine.xaml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/src/core/Riverside.Toolkit.Controls.Crimson/GlowLine.xaml.cs b/src/core/Riverside.Toolkit.Controls.Crimson/GlowLine.xaml.cs new file mode 100644 index 0000000..946bfa7 --- /dev/null +++ b/src/core/Riverside.Toolkit.Controls.Crimson/GlowLine.xaml.cs @@ -0,0 +1,9 @@ +namespace Riverside.Toolkit.Controls; + +public sealed partial class GlowLine : UserControl +{ + public GlowLine() + { + this.InitializeComponent(); + } +} \ No newline at end of file diff --git a/src/core/Riverside.Toolkit.Controls.Crimson/Riverside.Toolkit.Controls.Crimson.projitems b/src/core/Riverside.Toolkit.Controls.Crimson/Riverside.Toolkit.Controls.Crimson.projitems new file mode 100644 index 0000000..432dd8e --- /dev/null +++ b/src/core/Riverside.Toolkit.Controls.Crimson/Riverside.Toolkit.Controls.Crimson.projitems @@ -0,0 +1,19 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + f2ca66e2-ab46-45c2-88f1-a2ad68cf8c66 + + + Riverside.Toolkit.Controls.Crimson + + + + + $(DefaultXamlRuntime) + MSBuild:Compile + Designer + + + \ No newline at end of file diff --git a/src/core/Riverside.Toolkit.Controls.Crimson/Riverside.Toolkit.Controls.Crimson.shproj b/src/core/Riverside.Toolkit.Controls.Crimson/Riverside.Toolkit.Controls.Crimson.shproj new file mode 100644 index 0000000..9e035d5 --- /dev/null +++ b/src/core/Riverside.Toolkit.Controls.Crimson/Riverside.Toolkit.Controls.Crimson.shproj @@ -0,0 +1,13 @@ + + + + f2ca66e2-ab46-45c2-88f1-a2ad68cf8c66 + 14.0 + + + + + + + + diff --git a/src/platforms/Riverside.GlowUI.Uwp.Styles/Riverside.GlowUI.Uwp.Styles.csproj b/src/platforms/Riverside.GlowUI.Uwp.Styles/Riverside.GlowUI.Uwp.Styles.csproj new file mode 100644 index 0000000..d94c98e --- /dev/null +++ b/src/platforms/Riverside.GlowUI.Uwp.Styles/Riverside.GlowUI.Uwp.Styles.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/platforms/Riverside.GlowUI.WinUI.Styles/Riverside.GlowUI.WinUI.Styles.csproj b/src/platforms/Riverside.GlowUI.WinUI.Styles/Riverside.GlowUI.WinUI.Styles.csproj new file mode 100644 index 0000000..6046407 --- /dev/null +++ b/src/platforms/Riverside.GlowUI.WinUI.Styles/Riverside.GlowUI.WinUI.Styles.csproj @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/platforms/Riverside.Toolkit.Uwp.Controls.Crimson/Riverside.Toolkit.Uwp.Controls.Crimson.csproj b/src/platforms/Riverside.Toolkit.Uwp.Controls.Crimson/Riverside.Toolkit.Uwp.Controls.Crimson.csproj new file mode 100644 index 0000000..e9bd4f2 --- /dev/null +++ b/src/platforms/Riverside.Toolkit.Uwp.Controls.Crimson/Riverside.Toolkit.Uwp.Controls.Crimson.csproj @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/platforms/Riverside.Toolkit.WinUI.Controls.Crimson/Riverside.Toolkit.WinUI.Controls.Crimson.csproj b/src/platforms/Riverside.Toolkit.WinUI.Controls.Crimson/Riverside.Toolkit.WinUI.Controls.Crimson.csproj new file mode 100644 index 0000000..10cfead --- /dev/null +++ b/src/platforms/Riverside.Toolkit.WinUI.Controls.Crimson/Riverside.Toolkit.WinUI.Controls.Crimson.csproj @@ -0,0 +1,5 @@ + + + + + From b09a3e937a124e9cbd294254bfb22cdc804d03f6 Mon Sep 17 00:00:00 2001 From: Lamparter <71598437+Lamparter@users.noreply.github.com> Date: Tue, 11 Mar 2025 19:47:14 +0000 Subject: [PATCH 08/10] Add GlowUI projects build to CI --- .github/scripts/BuildProject.ps1 | 8 ++++++-- .github/workflows/ci.yml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/scripts/BuildProject.ps1 b/.github/scripts/BuildProject.ps1 index b881691..0137ee2 100644 --- a/.github/scripts/BuildProject.ps1 +++ b/.github/scripts/BuildProject.ps1 @@ -7,8 +7,12 @@ param ( # Calculate the fully qualified project name if ($Project -eq "Riverside.Extensions.WinUI") { $FullyQualifiedName = "Riverside.Extensions.$Head" -} else { +} elseif ($Project -like "Riverside.Toolkit.*") { $FullyQualifiedName = "$($Project -replace '\.Toolkit\.', ".Toolkit.$Head.")" +} elseif ($Project -like "Riverside.GlowUI.*") { + $FullyQualifiedName = "$($Project -replace '\.GlowUI\.', ".GlowUI.$Head.")" +} else { + $FullyQualifiedName = $Project } # Define the project directory @@ -19,7 +23,7 @@ $ProjectDirectory = Join-Path -Path $ProjectRoot -ChildPath "src\platforms\$Full # Check if the project directory exists if (-Not (Test-Path -Path $ProjectDirectory)) { # Check in src\extensions if not found in src\platforms - $ProjectDirectory = Join-Path -Path $ProjectRoot -ChildPath "src\extensions\$Project" + $ProjectDirectory = Join-Path -Path $ProjectRoot -ChildPath "src\extensions\$FullyQualifiedName" if (-Not (Test-Path -Path $ProjectDirectory)) { Write-Output "Project directory '$ProjectDirectory' does not exist, skipping build." exit 0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4d887a..430cc58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,7 @@ jobs: fail-fast: false matrix: configuration: [Debug, Release] - core: [Riverside.Extensions.Accountability, Riverside.Extensions.PInvoke, Riverside.Extensions.Primitives, Riverside.Extensions.UAP, Riverside.Extensions.Versioning, Riverside.Extensions.WinUI, Riverside.Toolkit.Animations, Riverside.Toolkit.Brushes, Riverside.Toolkit.Controls.Primitives, Riverside.Toolkit.Controls.TitleBar, Riverside.Toolkit.Converters, Riverside.Toolkit.Extensions, Riverside.Toolkit.Helpers, Riverside.Toolkit.Icons, Riverside.Toolkit.Services] + core: [Riverside.Extensions.Accountability, Riverside.Extensions.PInvoke, Riverside.Extensions.Primitives, Riverside.Extensions.UAP, Riverside.Extensions.Versioning, Riverside.GlowUI.Styles, Riverside.Extensions.WinUI, Riverside.Toolkit.Animations, Riverside.Toolkit.Media, Riverside.Toolkit.Controls.Primitives, Riverside.Toolkit.Controls.TitleBar, Riverside.Toolkit.Controls.Crimson, Riverside.Toolkit.Converters, Riverside.Toolkit.Extensions, Riverside.Toolkit.Helpers, Riverside.Toolkit.Icons, Riverside.Toolkit.Services] head: [Uno, Wpf, WinUI, Uwp] exclude: # Exclude known failing configurations - core: Riverside.Toolkit.Controls.TitleBar From 452c759ad8a84e076198133e187664afadf1e9d3 Mon Sep 17 00:00:00 2001 From: Lamparter <71598437+Lamparter@users.noreply.github.com> Date: Tue, 11 Mar 2025 19:58:10 +0000 Subject: [PATCH 09/10] Format XAML --- src/core/Riverside.GlowUI.Styles/CubeUI.xaml | 6 +++--- src/core/Riverside.GlowUI.Styles/WindowChrome.xaml | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/Riverside.GlowUI.Styles/CubeUI.xaml b/src/core/Riverside.GlowUI.Styles/CubeUI.xaml index 197bbbd..57d4b7d 100644 --- a/src/core/Riverside.GlowUI.Styles/CubeUI.xaml +++ b/src/core/Riverside.GlowUI.Styles/CubeUI.xaml @@ -108,7 +108,7 @@ ContentTransitions="{TemplateBinding ContentTransitions}" CornerRadius="4" /> @@ -236,7 +236,7 @@ ContentTransitions="{TemplateBinding ContentTransitions}" CornerRadius="{TemplateBinding CornerRadius}" /> @@ -246,7 +246,7 @@ @@ -290,7 +290,7 @@ @@ -437,7 +437,7 @@ From 3e8095703cc222d0337a1f0b729ba51fe7043ad8 Mon Sep 17 00:00:00 2001 From: Lamparter <71598437+Lamparter@users.noreply.github.com> Date: Wed, 12 Mar 2025 06:59:09 +0000 Subject: [PATCH 10/10] Removed legacy GlowUI projects --- .../AuroraLite.xaml | 600 ---- .../AuroraLite.xaml.cs | 13 - dev/Riverside.GlowUI.Materials/Bloom.html | 917 ------ dev/Riverside.GlowUI.Materials/BloomView.xaml | 14 - .../BloomView.xaml.cs | 23 - .../Mica10DeepBackground.xaml | 18 - .../Mica10DeepBackground.xaml.cs | 56 - .../Riverside.GlowUI.Materials.csproj | 21 - .../Windows11Danger.html | 885 ----- .../Buttons/AnimatedButton.xaml | 134 - .../Buttons/AnimatedButton.xaml.cs | 36 - dev/Riverside.GlowUI/Buttons/Buttons.xaml | 1006 ------ dev/Riverside.GlowUI/Buttons/FlyoutButton.cs | 29 - .../Buttons/FlyoutButton.xaml | 282 -- dev/Riverside.GlowUI/Buttons/RefreshButton.cs | 48 - .../Buttons/RefreshButton.xaml | 167 - dev/Riverside.GlowUI/Buttons/TileButton.cs | 37 - dev/Riverside.GlowUI/Buttons/TileButton.xaml | 107 - .../Buttons/ToolbarButtons.xaml | 632 ---- dev/Riverside.GlowUI/Riverside.GlowUI.csproj | 14 - dev/Riverside.GlowUI/Styles/ActionStyles.xaml | 269 -- dev/Riverside.GlowUI/Styles/ComboBox.xaml | 1095 ------- .../Styles/CubeThemeDictionary.xaml | 97 - dev/Riverside.GlowUI/Styles/CubeUI.xaml | 425 --- dev/Riverside.GlowUI/Styles/FlipView.xaml | 259 -- dev/Riverside.GlowUI/Styles/Flyout.xaml | 69 - .../Styles/GlowGradientUI.xaml | 2914 ----------------- dev/Riverside.GlowUI/Styles/InfoBar.xaml | 234 -- .../Styles/NavigationView.xaml | 1653 ---------- dev/Riverside.GlowUI/Styles/Pivot.xaml | 590 ---- dev/Riverside.GlowUI/Styles/Radio.xaml | 370 --- dev/Riverside.GlowUI/Styles/RichEditBox.xaml | 217 -- dev/Riverside.GlowUI/Styles/Slider.xaml | 542 --- dev/Riverside.GlowUI/Styles/SplitView.xaml | 743 ----- dev/Riverside.GlowUI/Styles/TabView.xaml | 856 ----- dev/Riverside.GlowUI/Styles/TextBox.xaml | 343 -- .../Styles/ToggleSwitches.xaml | 1328 -------- dev/Riverside.GlowUI/Styles/ToolTip.xaml | 58 - dev/Riverside.GlowUI/Styles/WindowChrome.xaml | 445 --- dev/Riverside.Toolkit.Flyouts/BaseWindow.xaml | 21 - .../BaseWindow.xaml.cs | 46 - .../FlyoutWindow.xaml | 17 - .../FlyoutWindow.xaml.cs | 61 - .../Helpers/NativeHelper.cs | 39 - .../Helpers/PositionHelper.cs | 35 - .../Interfaces/IFlyoutWindow.cs | 6 - .../Interfaces/IIconManager.cs | 12 - .../Interfaces/IPositionHelper.cs | 6 - .../NativeMethods.txt | 4 - .../Riverside.Toolkit.Flyouts.csproj | 57 - .../Styles/FlyoutTheme.xaml | 73 - .../Transparency/TransparentBackdrop.cs | 25 - .../WindowsSystemDispatcherQueueHelper.cs | 36 - .../Widgets/LegacyTransparentWindow.xaml | 30 - .../Widgets/LegacyTransparentWindow.xaml.cs | 854 ----- .../Widgets/TestWidget.xaml | 17 - .../Widgets/TestWidget.xaml.cs | 303 -- 57 files changed, 19188 deletions(-) delete mode 100644 dev/Riverside.GlowUI.Materials/AuroraLite.xaml delete mode 100644 dev/Riverside.GlowUI.Materials/AuroraLite.xaml.cs delete mode 100644 dev/Riverside.GlowUI.Materials/Bloom.html delete mode 100644 dev/Riverside.GlowUI.Materials/BloomView.xaml delete mode 100644 dev/Riverside.GlowUI.Materials/BloomView.xaml.cs delete mode 100644 dev/Riverside.GlowUI.Materials/Mica10DeepBackground.xaml delete mode 100644 dev/Riverside.GlowUI.Materials/Mica10DeepBackground.xaml.cs delete mode 100644 dev/Riverside.GlowUI.Materials/Riverside.GlowUI.Materials.csproj delete mode 100644 dev/Riverside.GlowUI.Materials/Windows11Danger.html delete mode 100644 dev/Riverside.GlowUI/Buttons/AnimatedButton.xaml delete mode 100644 dev/Riverside.GlowUI/Buttons/AnimatedButton.xaml.cs delete mode 100644 dev/Riverside.GlowUI/Buttons/Buttons.xaml delete mode 100644 dev/Riverside.GlowUI/Buttons/FlyoutButton.cs delete mode 100644 dev/Riverside.GlowUI/Buttons/FlyoutButton.xaml delete mode 100644 dev/Riverside.GlowUI/Buttons/RefreshButton.cs delete mode 100644 dev/Riverside.GlowUI/Buttons/RefreshButton.xaml delete mode 100644 dev/Riverside.GlowUI/Buttons/TileButton.cs delete mode 100644 dev/Riverside.GlowUI/Buttons/TileButton.xaml delete mode 100644 dev/Riverside.GlowUI/Buttons/ToolbarButtons.xaml delete mode 100644 dev/Riverside.GlowUI/Riverside.GlowUI.csproj delete mode 100644 dev/Riverside.GlowUI/Styles/ActionStyles.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/ComboBox.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/CubeThemeDictionary.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/CubeUI.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/FlipView.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/Flyout.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/GlowGradientUI.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/InfoBar.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/NavigationView.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/Pivot.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/Radio.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/RichEditBox.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/Slider.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/SplitView.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/TabView.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/TextBox.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/ToggleSwitches.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/ToolTip.xaml delete mode 100644 dev/Riverside.GlowUI/Styles/WindowChrome.xaml delete mode 100644 dev/Riverside.Toolkit.Flyouts/BaseWindow.xaml delete mode 100644 dev/Riverside.Toolkit.Flyouts/BaseWindow.xaml.cs delete mode 100644 dev/Riverside.Toolkit.Flyouts/FlyoutWindow.xaml delete mode 100644 dev/Riverside.Toolkit.Flyouts/FlyoutWindow.xaml.cs delete mode 100644 dev/Riverside.Toolkit.Flyouts/Helpers/NativeHelper.cs delete mode 100644 dev/Riverside.Toolkit.Flyouts/Helpers/PositionHelper.cs delete mode 100644 dev/Riverside.Toolkit.Flyouts/Interfaces/IFlyoutWindow.cs delete mode 100644 dev/Riverside.Toolkit.Flyouts/Interfaces/IIconManager.cs delete mode 100644 dev/Riverside.Toolkit.Flyouts/Interfaces/IPositionHelper.cs delete mode 100644 dev/Riverside.Toolkit.Flyouts/NativeMethods.txt delete mode 100644 dev/Riverside.Toolkit.Flyouts/Riverside.Toolkit.Flyouts.csproj delete mode 100644 dev/Riverside.Toolkit.Flyouts/Styles/FlyoutTheme.xaml delete mode 100644 dev/Riverside.Toolkit.Flyouts/Transparency/TransparentBackdrop.cs delete mode 100644 dev/Riverside.Toolkit.Flyouts/Transparency/WindowsSystemDispatcherQueueHelper.cs delete mode 100644 dev/Riverside.Toolkit.Flyouts/Widgets/LegacyTransparentWindow.xaml delete mode 100644 dev/Riverside.Toolkit.Flyouts/Widgets/LegacyTransparentWindow.xaml.cs delete mode 100644 dev/Riverside.Toolkit.Flyouts/Widgets/TestWidget.xaml delete mode 100644 dev/Riverside.Toolkit.Flyouts/Widgets/TestWidget.xaml.cs diff --git a/dev/Riverside.GlowUI.Materials/AuroraLite.xaml b/dev/Riverside.GlowUI.Materials/AuroraLite.xaml deleted file mode 100644 index b794363..0000000 --- a/dev/Riverside.GlowUI.Materials/AuroraLite.xaml +++ /dev/null @@ -1,600 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/Riverside.GlowUI.Materials/AuroraLite.xaml.cs b/dev/Riverside.GlowUI.Materials/AuroraLite.xaml.cs deleted file mode 100644 index fa899dc..0000000 --- a/dev/Riverside.GlowUI.Materials/AuroraLite.xaml.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.UI.Xaml.Controls; - -// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 - -namespace Riverside.GlowUI.Materials; - -public sealed partial class AuroraLite : UserControl -{ - public AuroraLite() - { - this.InitializeComponent(); - } -} diff --git a/dev/Riverside.GlowUI.Materials/Bloom.html b/dev/Riverside.GlowUI.Materials/Bloom.html deleted file mode 100644 index 7f9d6ad..0000000 --- a/dev/Riverside.GlowUI.Materials/Bloom.html +++ /dev/null @@ -1,917 +0,0 @@ - - - - - - - - - - - - - - - [ ] - - - - - - - [After your PC is ready] - - - [Swipe in from any edge] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [After your PC is ready] - - - [With mouse, go to corners] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [After your PC is ready] - - - [With touch, swipe in from any edge] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [After your PC is ready] - - - [With mouse, go to corners] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Installing apps] - - - - [This might take a few minutes] - - - - [Getting your apps ready] - - - - - - - - - - [Don't turn off your PC] - - - [Getting your PC ready] - - - - - [Almost ready] - - - - - - - - - - [ZDP Installing Updates] - - - - [ZDP Don't turn off your PC] - - - - - - - - - - - - [Let's start] - - - - - - \ No newline at end of file diff --git a/dev/Riverside.GlowUI.Materials/BloomView.xaml b/dev/Riverside.GlowUI.Materials/BloomView.xaml deleted file mode 100644 index 04a70b8..0000000 --- a/dev/Riverside.GlowUI.Materials/BloomView.xaml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - diff --git a/dev/Riverside.GlowUI.Materials/BloomView.xaml.cs b/dev/Riverside.GlowUI.Materials/BloomView.xaml.cs deleted file mode 100644 index 9287380..0000000 --- a/dev/Riverside.GlowUI.Materials/BloomView.xaml.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; - -// To learn more about WinUI, the WinUI project structure, -// and more about our project templates, see: http://aka.ms/winui-project-info. - -namespace Riverside.GlowUI.Materials; - -public sealed partial class BloomView : UserControl -{ - public BloomView() - { - this.InitializeComponent(); - BloomWebView.Height = this.Height; - BloomWebView.Width = this.Width; - } - - private void Bloom_SizeChanged(object sender, SizeChangedEventArgs e) - { - BloomWebView.Height = e.NewSize.Height; - BloomWebView.Width = e.NewSize.Width; - } -} diff --git a/dev/Riverside.GlowUI.Materials/Mica10DeepBackground.xaml b/dev/Riverside.GlowUI.Materials/Mica10DeepBackground.xaml deleted file mode 100644 index eff53dd..0000000 --- a/dev/Riverside.GlowUI.Materials/Mica10DeepBackground.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - diff --git a/dev/Riverside.GlowUI.Materials/Mica10DeepBackground.xaml.cs b/dev/Riverside.GlowUI.Materials/Mica10DeepBackground.xaml.cs deleted file mode 100644 index 36f2166..0000000 --- a/dev/Riverside.GlowUI.Materials/Mica10DeepBackground.xaml.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Windows.System.Profile; - -// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 - -namespace Cube.UI.Materials; - -/// -/// An empty page that can be used on its own or navigated to within a Frame. -/// -public sealed partial class Mica10DeepBackground : Page -{ - public Mica10DeepBackground() - { - this.InitializeComponent(); - string deviceFamilyVersion = AnalyticsInfo.VersionInfo.DeviceFamilyVersion; - ulong version = ulong.Parse(deviceFamilyVersion); - ulong build = (version & 0x00000000FFFF0000L) >> 16; - - if (build >= 22000) - { - MicaDeepLayer.Visibility = Visibility.Visible; - TenMicaLayer.Visibility = Visibility.Collapsed; - - var m = new MicaAltBrush(); - m.Kind = (int)BackdropKind.BaseAlt; - m.Theme = Application.Current.RequestedTheme == ApplicationTheme.Light ? ElementTheme.Light : ElementTheme.Default; - this.Background = m; - } - else - { - MicaDeepLayer.Visibility = Visibility.Collapsed; - TenMicaLayer.Visibility = Visibility.Visible; - } - - var Listener = new ThemeListener(); - Listener.ThemeChanged += Listener_ThemeChanged; - } - - private void Listener_ThemeChanged(ThemeListener sender) - { - string deviceFamilyVersion = AnalyticsInfo.VersionInfo.DeviceFamilyVersion; - ulong version = ulong.Parse(deviceFamilyVersion); - ulong build = (version & 0x00000000FFFF0000L) >> 16; - - if (build >= 22000) - { - MicaDeepLayer.Visibility = Visibility.Visible; - TenMicaLayer.Visibility = Visibility.Collapsed; - - var m = new MicaAltBrush(); - m.Kind = (int)BackdropKind.BaseAlt; - m.Theme = Application.Current.RequestedTheme == ApplicationTheme.Light ? ElementTheme.Light : ElementTheme.Default; - this.Background = m; - } - } -} diff --git a/dev/Riverside.GlowUI.Materials/Riverside.GlowUI.Materials.csproj b/dev/Riverside.GlowUI.Materials/Riverside.GlowUI.Materials.csproj deleted file mode 100644 index d0144f6..0000000 --- a/dev/Riverside.GlowUI.Materials/Riverside.GlowUI.Materials.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - net8.0-windows10.0.19041.0 - 10.0.17763.0 - win-x86;win-x64;win-arm64 - true - - - - - - - Always - - - - - - - - \ No newline at end of file diff --git a/dev/Riverside.GlowUI.Materials/Windows11Danger.html b/dev/Riverside.GlowUI.Materials/Windows11Danger.html deleted file mode 100644 index 9cde6c0..0000000 --- a/dev/Riverside.GlowUI.Materials/Windows11Danger.html +++ /dev/null @@ -1,885 +0,0 @@ - - - - - - - - - - - - - -[ ] - - - - - - -[After your PC is ready] - - -[Swipe in from any edge] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[After your PC is ready] - - -[With mouse, go to corners] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[After your PC is ready] - - -[With touch, swipe in from any edge] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[After your PC is ready] - - -[With mouse, go to corners] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Installing apps] - - - -[This might take a few minutes] - - - -[Getting your apps ready] - - - - - - - - - -[Don't turn off your PC] - - -[Getting your PC ready] - - - - -[Almost ready] - - - - - - - - - -[ZDP Installing Updates] - - - -[ZDP Don't turn off your PC] - - - - - - - - - - - - -[Let's start] - - - - - diff --git a/dev/Riverside.GlowUI/Buttons/AnimatedButton.xaml b/dev/Riverside.GlowUI/Buttons/AnimatedButton.xaml deleted file mode 100644 index 9012a49..0000000 --- a/dev/Riverside.GlowUI/Buttons/AnimatedButton.xaml +++ /dev/null @@ -1,134 +0,0 @@ - - - diff --git a/dev/Riverside.GlowUI/Buttons/AnimatedButton.xaml.cs b/dev/Riverside.GlowUI/Buttons/AnimatedButton.xaml.cs deleted file mode 100644 index 74281ea..0000000 --- a/dev/Riverside.GlowUI/Buttons/AnimatedButton.xaml.cs +++ /dev/null @@ -1,36 +0,0 @@ -using CommunityToolkit.Mvvm.ComponentModel; -using Microsoft.UI.Xaml.Controls; - -namespace Cube.UI.Buttons; - -[INotifyPropertyChanged] -public partial class AnimatedButton : Button -{ - private IAnimatedVisualSource icon; - - public IAnimatedVisualSource AnimatedIcon - { - get => icon; - set - { - SetProperty(ref icon, value); - if (Player is not null) - Player.Source = value; - } - } - - protected AnimatedVisualPlayer Player - { - get { return (AnimatedVisualPlayer)GetTemplateChild("Icon"); } - } - - public AnimatedButton() => this.DefaultStyleKey = typeof(AnimatedButton); - - protected async override void OnApplyTemplate() - { - base.OnApplyTemplate(); - this.Click += async delegate { await Player.PlayAsync(0, 1, false); }; - if (AnimatedIcon is not null) - Player.Source = AnimatedIcon; - } -} diff --git a/dev/Riverside.GlowUI/Buttons/Buttons.xaml b/dev/Riverside.GlowUI/Buttons/Buttons.xaml deleted file mode 100644 index 6c94992..0000000 --- a/dev/Riverside.GlowUI/Buttons/Buttons.xaml +++ /dev/null @@ -1,1006 +0,0 @@ - - - - - - - - - - - - - diff --git a/dev/Riverside.GlowUI/Buttons/FlyoutButton.cs b/dev/Riverside.GlowUI/Buttons/FlyoutButton.cs deleted file mode 100644 index f222ed4..0000000 --- a/dev/Riverside.GlowUI/Buttons/FlyoutButton.cs +++ /dev/null @@ -1,29 +0,0 @@ -using CommunityToolkit.Mvvm.ComponentModel; - -// The Templated Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234235 - -namespace Cube.UI.Buttons; - -[INotifyPropertyChanged] -public partial class FlyoutButton : ToggleButton -{ - private FlyoutBase flyout; - - public FlyoutBase Flyout - { - get => flyout; - set - { - SetProperty(ref flyout, value); - value.ShouldConstrainToRootBounds = false; - value.Closed += delegate { this.IsChecked = false; }; - value.Opened += delegate { this.IsChecked = true; }; - } - } - - public FlyoutButton() - { - this.DefaultStyleKey = typeof(FlyoutButton); - this.Click += delegate { Flyout.ShowAt(this); }; - } -} diff --git a/dev/Riverside.GlowUI/Buttons/FlyoutButton.xaml b/dev/Riverside.GlowUI/Buttons/FlyoutButton.xaml deleted file mode 100644 index 83e2f84..0000000 --- a/dev/Riverside.GlowUI/Buttons/FlyoutButton.xaml +++ /dev/null @@ -1,282 +0,0 @@ - - - diff --git a/dev/Riverside.GlowUI/Buttons/RefreshButton.cs b/dev/Riverside.GlowUI/Buttons/RefreshButton.cs deleted file mode 100644 index 00aaa53..0000000 --- a/dev/Riverside.GlowUI/Buttons/RefreshButton.cs +++ /dev/null @@ -1,48 +0,0 @@ -// The Templated Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234235 - -namespace Cube.UI.Buttons; - -public partial class RefreshButton : AnimatedButton -{ - protected bool isRefreshing = false; - public event EventHandler RefreshClicked; - public event EventHandler CancelClicked; - - protected UIElement CancelIcon - { - get { return (UIElement)GetTemplateChild("CancelIcon"); } - } - - public RefreshButton() - { - this.DefaultStyleKey = typeof(RefreshButton); - this.AnimatedIcon = new RefreshAnimation(); - this.Click += RefreshButton_Click; - } - - private async void RefreshButton_Click(object sender, RoutedEventArgs e) => Refresh(); - - protected virtual async void Refresh() - { - if (isRefreshing) // Cancel refresh - { - CancelIcon.Visibility = Visibility.Collapsed; - Player.Opacity = 1; - if (CancelClicked is not null) - CancelClicked(this, new EventArgs()); - isRefreshing = false; - } - else - { - if (RefreshClicked is not null) - RefreshClicked(this, new EventArgs()); - isRefreshing = true; - await Task.Delay(500); // wait for refresh animation to finish - if (isRefreshing) - { - CancelIcon.Visibility = Visibility.Visible; - Player.Opacity = 0; - } - } - } -} diff --git a/dev/Riverside.GlowUI/Buttons/RefreshButton.xaml b/dev/Riverside.GlowUI/Buttons/RefreshButton.xaml deleted file mode 100644 index 71c829a..0000000 --- a/dev/Riverside.GlowUI/Buttons/RefreshButton.xaml +++ /dev/null @@ -1,167 +0,0 @@ - - - - diff --git a/dev/Riverside.GlowUI/Buttons/TileButton.cs b/dev/Riverside.GlowUI/Buttons/TileButton.cs deleted file mode 100644 index 828903e..0000000 --- a/dev/Riverside.GlowUI/Buttons/TileButton.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; - -// The Templated Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234235 - -namespace CubeKit.UI.Controls.Buttons; - -public partial class TileButton : Button -{ - protected Border AnimatingBorder - { - get { return (Border)GetTemplateChild("AnimatingBorder"); } - } - - protected UIElement Root - { - get { return (UIElement)GetTemplateChild("RootGrid"); } - } - - public TileButton() - { - this.DefaultStyleKey = typeof(TileButton); - this.Loaded += TileButton_Loaded; - } - - public void StartPulse() => VisualStateManager.GoToState(this, "PointerOver", true); - - public void StopPulse() => VisualStateManager.GoToState(this, "Normal", true); - - private async void TileButton_Loaded(object sender, RoutedEventArgs e) - { - /* AnimatingBorder.BorderBrush = (IsEnabled ? Application.Current.Resources["AccentRadialGradientBrush"] : Application.Current.Resources["RedRadialGradientBrush"]) as Brush; - VisualStateManager.GoToState(this, "PointerOver", true); - await Task.Delay(500); - VisualStateManager.GoToState(this, "Normal", true);*/ - } -} diff --git a/dev/Riverside.GlowUI/Buttons/TileButton.xaml b/dev/Riverside.GlowUI/Buttons/TileButton.xaml deleted file mode 100644 index 5463368..0000000 --- a/dev/Riverside.GlowUI/Buttons/TileButton.xaml +++ /dev/null @@ -1,107 +0,0 @@ - - - - diff --git a/dev/Riverside.GlowUI/Buttons/ToolbarButtons.xaml b/dev/Riverside.GlowUI/Buttons/ToolbarButtons.xaml deleted file mode 100644 index 637514d..0000000 --- a/dev/Riverside.GlowUI/Buttons/ToolbarButtons.xaml +++ /dev/null @@ -1,632 +0,0 @@ - - - - - - diff --git a/dev/Riverside.GlowUI/Riverside.GlowUI.csproj b/dev/Riverside.GlowUI/Riverside.GlowUI.csproj deleted file mode 100644 index 51b5f7a..0000000 --- a/dev/Riverside.GlowUI/Riverside.GlowUI.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - net8.0-windows10.0.19041.0 - 10.0.17763.0 - Riverside.GlowUI - win-x86;win-x64;win-arm64 - true - - - - - - - \ No newline at end of file diff --git a/dev/Riverside.GlowUI/Styles/ActionStyles.xaml b/dev/Riverside.GlowUI/Styles/ActionStyles.xaml deleted file mode 100644 index 1db466f..0000000 --- a/dev/Riverside.GlowUI/Styles/ActionStyles.xaml +++ /dev/null @@ -1,269 +0,0 @@ - - - - diff --git a/dev/Riverside.GlowUI/Styles/ComboBox.xaml b/dev/Riverside.GlowUI/Styles/ComboBox.xaml deleted file mode 100644 index 84eec69..0000000 --- a/dev/Riverside.GlowUI/Styles/ComboBox.xaml +++ /dev/null @@ -1,1095 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Visible - - - - - - - - - - - - - - - - - - diff --git a/dev/Riverside.GlowUI/Styles/CubeThemeDictionary.xaml b/dev/Riverside.GlowUI/Styles/CubeThemeDictionary.xaml deleted file mode 100644 index 8afec86..0000000 --- a/dev/Riverside.GlowUI/Styles/CubeThemeDictionary.xaml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - White - - - - - - - - - - - - - - - - - - - - - - - - Black - - - - - - - - - - - - - - - - - - - - - White - - - - - - - - - - - - - - - - - diff --git a/dev/Riverside.GlowUI/Styles/CubeUI.xaml b/dev/Riverside.GlowUI/Styles/CubeUI.xaml deleted file mode 100644 index 0b6c518..0000000 --- a/dev/Riverside.GlowUI/Styles/CubeUI.xaml +++ /dev/null @@ -1,425 +0,0 @@ - - - - - - - - - - - diff --git a/dev/Riverside.GlowUI/Styles/FlipView.xaml b/dev/Riverside.GlowUI/Styles/FlipView.xaml deleted file mode 100644 index e5ed47b..0000000 --- a/dev/Riverside.GlowUI/Styles/FlipView.xaml +++ /dev/null @@ -1,259 +0,0 @@ - - - diff --git a/dev/Riverside.GlowUI/Styles/Flyout.xaml b/dev/Riverside.GlowUI/Styles/Flyout.xaml deleted file mode 100644 index 4003b59..0000000 --- a/dev/Riverside.GlowUI/Styles/Flyout.xaml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - diff --git a/dev/Riverside.GlowUI/Styles/GlowGradientUI.xaml b/dev/Riverside.GlowUI/Styles/GlowGradientUI.xaml deleted file mode 100644 index ed934df..0000000 --- a/dev/Riverside.GlowUI/Styles/GlowGradientUI.xaml +++ /dev/null @@ -1,2914 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Visible - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Visible - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/Riverside.GlowUI/Styles/InfoBar.xaml b/dev/Riverside.GlowUI/Styles/InfoBar.xaml deleted file mode 100644 index 9f2fbb7..0000000 --- a/dev/Riverside.GlowUI/Styles/InfoBar.xaml +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/Riverside.GlowUI/Styles/NavigationView.xaml b/dev/Riverside.GlowUI/Styles/NavigationView.xaml deleted file mode 100644 index 37c4690..0000000 --- a/dev/Riverside.GlowUI/Styles/NavigationView.xaml +++ /dev/null @@ -1,1653 +0,0 @@ - - - - - #003A3A3A - #4C3A3A3A - #403A3A3A - - - - - - - - - - - #00FFFFFF - #B0FFFFFF - #80FFFFFF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dev/Riverside.GlowUI/Styles/Pivot.xaml b/dev/Riverside.GlowUI/Styles/Pivot.xaml deleted file mode 100644 index 28b5136..0000000 --- a/dev/Riverside.GlowUI/Styles/Pivot.xaml +++ /dev/null @@ -1,590 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/Riverside.GlowUI/Styles/Radio.xaml b/dev/Riverside.GlowUI/Styles/Radio.xaml deleted file mode 100644 index 4a14a6f..0000000 --- a/dev/Riverside.GlowUI/Styles/Radio.xaml +++ /dev/null @@ -1,370 +0,0 @@ - - - - diff --git a/dev/Riverside.GlowUI/Styles/RichEditBox.xaml b/dev/Riverside.GlowUI/Styles/RichEditBox.xaml deleted file mode 100644 index 88bb631..0000000 --- a/dev/Riverside.GlowUI/Styles/RichEditBox.xaml +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Visible - - - - - - - - - - - - - - diff --git a/dev/Riverside.GlowUI/Styles/Slider.xaml b/dev/Riverside.GlowUI/Styles/Slider.xaml deleted file mode 100644 index 083b3a9..0000000 --- a/dev/Riverside.GlowUI/Styles/Slider.xaml +++ /dev/null @@ -1,542 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/Riverside.GlowUI/Styles/SplitView.xaml b/dev/Riverside.GlowUI/Styles/SplitView.xaml deleted file mode 100644 index 7fd298a..0000000 --- a/dev/Riverside.GlowUI/Styles/SplitView.xaml +++ /dev/null @@ -1,743 +0,0 @@ - - - diff --git a/dev/Riverside.GlowUI/Styles/TabView.xaml b/dev/Riverside.GlowUI/Styles/TabView.xaml deleted file mode 100644 index d4c0dba..0000000 --- a/dev/Riverside.GlowUI/Styles/TabView.xaml +++ /dev/null @@ -1,856 +0,0 @@ - - - - - - - - - - - - - diff --git a/dev/Riverside.GlowUI/Styles/TextBox.xaml b/dev/Riverside.GlowUI/Styles/TextBox.xaml deleted file mode 100644 index 5036618..0000000 --- a/dev/Riverside.GlowUI/Styles/TextBox.xaml +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Visible - - - - - - - - - - - - - - - - diff --git a/dev/Riverside.GlowUI/Styles/ToggleSwitches.xaml b/dev/Riverside.GlowUI/Styles/ToggleSwitches.xaml deleted file mode 100644 index 1d69011..0000000 --- a/dev/Riverside.GlowUI/Styles/ToggleSwitches.xaml +++ /dev/null @@ -1,1328 +0,0 @@ - - - - - diff --git a/dev/Riverside.GlowUI/Styles/ToolTip.xaml b/dev/Riverside.GlowUI/Styles/ToolTip.xaml deleted file mode 100644 index 52b6196..0000000 --- a/dev/Riverside.GlowUI/Styles/ToolTip.xaml +++ /dev/null @@ -1,58 +0,0 @@ - - - - diff --git a/dev/Riverside.GlowUI/Styles/WindowChrome.xaml b/dev/Riverside.GlowUI/Styles/WindowChrome.xaml deleted file mode 100644 index 47eca48..0000000 --- a/dev/Riverside.GlowUI/Styles/WindowChrome.xaml +++ /dev/null @@ -1,445 +0,0 @@ - - - - - #202020 - - - - #f3f3f3 - - - Transparent - Transparent - - - - - - - - - \ No newline at end of file diff --git a/dev/Riverside.Toolkit.Flyouts/BaseWindow.xaml b/dev/Riverside.Toolkit.Flyouts/BaseWindow.xaml deleted file mode 100644 index a30f373..0000000 --- a/dev/Riverside.Toolkit.Flyouts/BaseWindow.xaml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - diff --git a/dev/Riverside.Toolkit.Flyouts/BaseWindow.xaml.cs b/dev/Riverside.Toolkit.Flyouts/BaseWindow.xaml.cs deleted file mode 100644 index e6cb683..0000000 --- a/dev/Riverside.Toolkit.Flyouts/BaseWindow.xaml.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Riverside.Toolkit.Flyouts.Transparency; -using Windows.Win32; -using Windows.Win32.Foundation; -using Windows.Win32.UI.WindowsAndMessaging; -using WinRT.Interop; -using WinUIEx; -using WinUIEx.Messaging; - -// To learn more about WinUI, the WinUI project structure, -// and more about our project templates, see: http://aka.ms/winui-project-info. - -namespace Riverside.Toolkit.Flyouts; - -/// -/// An empty window that can be used on its own or navigated to within a Frame. -/// -public partial class BaseWindow : WindowEx -{ - WindowMessageMonitor m; - HWND Handle; - WINDOW_EX_STYLE ExStyle - { - get => (WINDOW_EX_STYLE)PInvoke.GetWindowLong(Handle, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE); - set => _ = PInvoke.SetWindowLong(Handle, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE, (int)value); - } - - public BaseWindow() - { - this.InitializeComponent(); - m = new(this); - Handle = new HWND(WindowNative.GetWindowHandle(this)); - ExStyle |= WINDOW_EX_STYLE.WS_EX_LAYERED; - m.WindowMessageReceived += WindowMessageReceived; - - SystemBackdrop = new TransparentBackdrop(); - } - - private void WindowMessageReceived(object? sender, WindowMessageEventArgs e) - { - if (e.Message.MessageId == PInvoke.WM_ERASEBKGND) - { - e.Handled = true; - e.Result = 1; - } - } -} diff --git a/dev/Riverside.Toolkit.Flyouts/FlyoutWindow.xaml b/dev/Riverside.Toolkit.Flyouts/FlyoutWindow.xaml deleted file mode 100644 index 333197b..0000000 --- a/dev/Riverside.Toolkit.Flyouts/FlyoutWindow.xaml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/dev/Riverside.Toolkit.Flyouts/FlyoutWindow.xaml.cs b/dev/Riverside.Toolkit.Flyouts/FlyoutWindow.xaml.cs deleted file mode 100644 index 1bbcd14..0000000 --- a/dev/Riverside.Toolkit.Flyouts/FlyoutWindow.xaml.cs +++ /dev/null @@ -1,61 +0,0 @@ -using H.NotifyIcon.Core; -using Microsoft.UI; -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls.Primitives; -using Riverside.Toolkit.Flyouts.Helpers; -using Riverside.Toolkit.Flyouts.Interfaces; -using WinUIEx; -// To learn more about WinUI, the WinUI project structure, -// and more about our project templates, see: http://aka.ms/winui-project-info. - -namespace Riverside.Toolkit.Flyouts; - -/// -/// A flyout window -/// -public partial class FlyoutWindow : BaseWindow, IFlyoutWindow -{ - public IPositionHelper FlyoutPositionHelper = new PositionHelper(); - - - public FlyoutWindow() - { - FlyoutPositionHelper.Positionflyout(this); - this.InitializeComponent(); - this.SetTitleBarBackgroundColors(Colors.Transparent); - this.Activated += Flyout_Activated; - this.Show(); - this.BringToFront(); - this.SetForegroundWindow(); - // Icon.Create(); - // Icon.MessageWindow.MouseEventReceived += MessageWindow_MouseEventReceived; - } - - private void MessageWindow_MouseEventReceived(object sender, MessageWindow.MouseEventReceivedEventArgs e) - { - if (e.MouseEvent is MouseEvent.IconLeftMouseUp) - { - this.Show(); - this.BringToFront(); - this.SetForegroundWindow(); - FlyoutBase.ShowAttachedFlyout(FlyoutGrid); - } - } - - private void Flyout_Activated(object sender, Microsoft.UI.Xaml.WindowActivatedEventArgs args) - { - // if (args.WindowActivationState == WindowActivationState.Deactivated) - // this.Hide(); - } - - private void Flyout_Closed(object sender, object e) - { - FlyoutBase.ShowAttachedFlyout(FlyoutGrid); - // this.Hide(); - } - - private void Button_Click(object sender, RoutedEventArgs e) - { - FlyoutBase.ShowAttachedFlyout(FlyoutGrid); - } -} diff --git a/dev/Riverside.Toolkit.Flyouts/Helpers/NativeHelper.cs b/dev/Riverside.Toolkit.Flyouts/Helpers/NativeHelper.cs deleted file mode 100644 index 9d3f1d2..0000000 --- a/dev/Riverside.Toolkit.Flyouts/Helpers/NativeHelper.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Riverside.Toolkit.Flyouts.Helpers; - -public static class NativeHelper -{ - public const int MONITOR_DEFAULTTOPRIMARY = 1; - public const int MONITOR_DEFAULTTONEAREST = 2; - - [DllImport("user32.dll", SetLastError = true)] - public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); - - [DllImport("user32.dll")] - public static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags); - - [DllImport("shcore.dll")] - public static extern IntPtr GetScaleFactorForMonitor(IntPtr hwnd, out DeviceScaleFactor dwFlags); - - public enum DeviceScaleFactor - { - DEVICE_SCALE_FACTOR_INVALID = 0, - SCALE_100_PERCENT = 100, - SCALE_120_PERCENT = 120, - SCALE_125_PERCENT = 125, - SCALE_140_PERCENT = 140, - SCALE_150_PERCENT = 150, - SCALE_160_PERCENT = 160, - SCALE_175_PERCENT = 175, - SCALE_180_PERCENT = 180, - SCALE_200_PERCENT = 200, - SCALE_225_PERCENT = 225, - SCALE_250_PERCENT = 250, - SCALE_300_PERCENT = 300, - SCALE_350_PERCENT = 350, - SCALE_400_PERCENT = 400, - SCALE_450_PERCENT = 450, - SCALE_500_PERCENT = 500, - } -} diff --git a/dev/Riverside.Toolkit.Flyouts/Helpers/PositionHelper.cs b/dev/Riverside.Toolkit.Flyouts/Helpers/PositionHelper.cs deleted file mode 100644 index 2d7d964..0000000 --- a/dev/Riverside.Toolkit.Flyouts/Helpers/PositionHelper.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.UI.Windowing; -using Riverside.Toolkit.Flyouts.Interfaces; -using WinUIEx; - -namespace Riverside.Toolkit.Flyouts.Helpers; - -public class PositionHelper : IPositionHelper -{ - public void Positionflyout(BaseWindow Flyout) - { - double Scale = GetScale(); - double DisplayHeight = DisplayArea.Primary.OuterBounds.Height; - double DisplayWidth = DisplayArea.Primary.OuterBounds.Width; - - double W = Flyout.Width; - double H = Flyout.Height; - - Flyout.MoveAndResize((DisplayWidth / 1.17) - (W / 2), (DisplayHeight / 1.17) - (H / 2), W, H); - // Flyout.MoveAndResize(DisplayWidth - W , DisplayHeight - H , Flyout.Width, Flyout.Height); - } - - private double GetScale() - { - var progmanWindow = NativeHelper.FindWindow("Shell_TrayWnd", null); - var monitor = NativeHelper.MonitorFromWindow(progmanWindow, NativeHelper.MONITOR_DEFAULTTOPRIMARY); - - NativeHelper.DeviceScaleFactor scale; - NativeHelper.GetScaleFactorForMonitor(monitor, out scale); - - if (scale == NativeHelper.DeviceScaleFactor.DEVICE_SCALE_FACTOR_INVALID) - scale = NativeHelper.DeviceScaleFactor.SCALE_100_PERCENT; - - return Convert.ToDouble(scale) / 100; - } -} diff --git a/dev/Riverside.Toolkit.Flyouts/Interfaces/IFlyoutWindow.cs b/dev/Riverside.Toolkit.Flyouts/Interfaces/IFlyoutWindow.cs deleted file mode 100644 index 726f600..0000000 --- a/dev/Riverside.Toolkit.Flyouts/Interfaces/IFlyoutWindow.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Riverside.Toolkit.Flyouts.Interfaces; - -public interface IFlyoutWindow -{ - -} diff --git a/dev/Riverside.Toolkit.Flyouts/Interfaces/IIconManager.cs b/dev/Riverside.Toolkit.Flyouts/Interfaces/IIconManager.cs deleted file mode 100644 index 2ea3afd..0000000 --- a/dev/Riverside.Toolkit.Flyouts/Interfaces/IIconManager.cs +++ /dev/null @@ -1,12 +0,0 @@ -using H.NotifyIcon.Core; - -namespace Riverside.Toolkit.Flyouts.Interfaces; - -public interface IIconManager -{ - public TrayIcon FlyoutIcon { get; set; } - - public bool Initialize(); - - public void Dispose(); -} diff --git a/dev/Riverside.Toolkit.Flyouts/Interfaces/IPositionHelper.cs b/dev/Riverside.Toolkit.Flyouts/Interfaces/IPositionHelper.cs deleted file mode 100644 index 2213466..0000000 --- a/dev/Riverside.Toolkit.Flyouts/Interfaces/IPositionHelper.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Riverside.Toolkit.Flyouts.Interfaces; - -public interface IPositionHelper -{ - void Positionflyout(BaseWindow Flyout); -} diff --git a/dev/Riverside.Toolkit.Flyouts/NativeMethods.txt b/dev/Riverside.Toolkit.Flyouts/NativeMethods.txt deleted file mode 100644 index 5be548a..0000000 --- a/dev/Riverside.Toolkit.Flyouts/NativeMethods.txt +++ /dev/null @@ -1,4 +0,0 @@ -WINDOW_EX_STYLE -GetWindowLong -WM_ERASEBKGND -SetWindowLong \ No newline at end of file diff --git a/dev/Riverside.Toolkit.Flyouts/Riverside.Toolkit.Flyouts.csproj b/dev/Riverside.Toolkit.Flyouts/Riverside.Toolkit.Flyouts.csproj deleted file mode 100644 index 1f83541..0000000 --- a/dev/Riverside.Toolkit.Flyouts/Riverside.Toolkit.Flyouts.csproj +++ /dev/null @@ -1,57 +0,0 @@ - - - net6.0-windows10.0.19041.0 - 10.0.17763.0 - Riverside.Toolkit.Flyouts - win10-x86;win10-x64;win10-arm64 - true - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - MSBuild:Compile - - - - - - MSBuild:Compile - - - - - - MSBuild:Compile - - - - - - MSBuild:Compile - - - $(DefaultXamlRuntime) - Designer - - - diff --git a/dev/Riverside.Toolkit.Flyouts/Styles/FlyoutTheme.xaml b/dev/Riverside.Toolkit.Flyouts/Styles/FlyoutTheme.xaml deleted file mode 100644 index 474c9b3..0000000 --- a/dev/Riverside.Toolkit.Flyouts/Styles/FlyoutTheme.xaml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - White - - - - - - - - - - - - - - - - - - - - - - - - Black - - - - - - - - - - - - - - - - - - - - - White - - - - - - - - - - - - - - - - - diff --git a/dev/Riverside.Toolkit.Flyouts/Transparency/TransparentBackdrop.cs b/dev/Riverside.Toolkit.Flyouts/Transparency/TransparentBackdrop.cs deleted file mode 100644 index b6676f1..0000000 --- a/dev/Riverside.Toolkit.Flyouts/Transparency/TransparentBackdrop.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.UI.Xaml.Media; -using Compositor = Windows.UI.Composition.Compositor; -using ICompositionSupportsSystemBackdrop = Microsoft.UI.Composition.ICompositionSupportsSystemBackdrop; - -namespace Riverside.Toolkit.Flyouts.Transparency; - -internal class TransparentBackdrop : SystemBackdrop -{ - static readonly Lazy _Compositor = new(() => - { - WindowsSystemDispatcherQueueHelper.EnsureWindowsSystemDispatcherQueueController(); - return new(); - }); - static Compositor Compositor => _Compositor.Value; - protected override void OnTargetConnected(ICompositionSupportsSystemBackdrop connectedTarget, Microsoft.UI.Xaml.XamlRoot xamlRoot) - { - connectedTarget.SystemBackdrop = Compositor.CreateColorBrush( - Windows.UI.Color.FromArgb(0, 255, 255, 255) - ); - } - protected override void OnTargetDisconnected(ICompositionSupportsSystemBackdrop disconnectedTarget) - { - disconnectedTarget.SystemBackdrop = null; - } -} diff --git a/dev/Riverside.Toolkit.Flyouts/Transparency/WindowsSystemDispatcherQueueHelper.cs b/dev/Riverside.Toolkit.Flyouts/Transparency/WindowsSystemDispatcherQueueHelper.cs deleted file mode 100644 index a1ea626..0000000 --- a/dev/Riverside.Toolkit.Flyouts/Transparency/WindowsSystemDispatcherQueueHelper.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Runtime.InteropServices; -using Windows.System; - -namespace Riverside.Toolkit.Flyouts.Transparency; - -public static class WindowsSystemDispatcherQueueHelper -{ - [StructLayout(LayoutKind.Sequential)] - struct DispatcherQueueOptions - { - internal int dwSize; - internal int threadType; - internal int apartmentType; - } - - [DllImport("CoreMessaging.dll")] - private static extern int CreateDispatcherQueueController([In] DispatcherQueueOptions options, [In, Out, MarshalAs(UnmanagedType.IUnknown)] ref object? dispatcherQueueController); - - static object? m_dispatcherQueueController = null; - public static void EnsureWindowsSystemDispatcherQueueController() - { - if (DispatcherQueue.GetForCurrentThread() != null) - // one already exists, so we'll just use it. - return; - - if (m_dispatcherQueueController == null) - { - DispatcherQueueOptions options; - options.dwSize = Marshal.SizeOf(typeof(DispatcherQueueOptions)); - options.threadType = 2; // DQTYPE_THREAD_CURRENT - options.apartmentType = 2; // DQTAT_COM_STA - - _ = CreateDispatcherQueueController(options, ref m_dispatcherQueueController); - } - } -} diff --git a/dev/Riverside.Toolkit.Flyouts/Widgets/LegacyTransparentWindow.xaml b/dev/Riverside.Toolkit.Flyouts/Widgets/LegacyTransparentWindow.xaml deleted file mode 100644 index 1d034ab..0000000 --- a/dev/Riverside.Toolkit.Flyouts/Widgets/LegacyTransparentWindow.xaml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Click Me - - - - - - - - - - diff --git a/dev/Riverside.Toolkit.Flyouts/Widgets/LegacyTransparentWindow.xaml.cs b/dev/Riverside.Toolkit.Flyouts/Widgets/LegacyTransparentWindow.xaml.cs deleted file mode 100644 index 20e6e2f..0000000 --- a/dev/Riverside.Toolkit.Flyouts/Widgets/LegacyTransparentWindow.xaml.cs +++ /dev/null @@ -1,854 +0,0 @@ -using Microsoft.UI; -using Microsoft.UI.Windowing; -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Input; -using System.Runtime.InteropServices; - -// To learn more about WinUI, the WinUI project structure, -// and more about our project templates, see: http://aka.ms/winui-project-info. - -namespace Riverside.Toolkit.Flyouts; - -/// -/// An empty window that can be used on its own or navigated to within a Frame. -/// -public sealed partial class LegacyTransparentWindow : Window -{ - public const int WM_CREATE = 0x0001; - public const int WM_NCHITTEST = 0x0084; - public const int WM_COMMAND = 0x0111; - public const int WM_NCLBUTTONDOWN = 0x00A1; - public const int WM_NCLBUTTONUP = 0x00A2; - public const int WM_NCLBUTTONDBLCLK = 0x00A3; - public const int WM_NCRBUTTONDOWN = 0x00A4; - public const int WM_NCRBUTTONUP = 0x00A5; - public const int WM_MOUSEMOVE = 0x0200; - public const int WM_LBUTTONDOWN = 0x0201; - public const int WM_LBUTTONUP = 0x0202; - public const int WM_LBUTTONDBLCLK = 0x0203; - public const int WM_RBUTTONDOWN = 0x0204; - public const int WM_RBUTTONUP = 0x0205; - public const int WM_RBUTTONDBLCLK = 0x0206; - public const int WM_MOUSEFIRST = 0x0200; - public const int WM_MOUSELAST = 0x020E; - public const int WM_SYSCOMMAND = 0x0112; - public const int WM_MOVE = 0x0003; - public const int WM_NCPOINTERDOWN = 0x0242; - public const int WM_NCPOINTERUP = 0x0243; - public const int WM_POINTERUPDATE = 0x0245; - public const int WM_POINTERDOWN = 0x0246; - public const int WM_POINTERUP = 0x0247; - public const int WM_DESTROY = 2; - public const int WM_PAINT = 0x0f; - - public const int WS_THICKFRAME = 0x00040000; - public const int WS_CHILD = 0x40000000; - public const int WS_POPUP = unchecked((int)0x80000000); - - public const int SC_MOVE = 0xF010; - public const int SC_MOUSEMOVE = SC_MOVE + 0x02; - - public const int HTERROR = (-2); - public const int HTTRANSPARENT = (-1); - public const int HTNOWHERE = 0; - public const int HTCLIENT = 1; - public const int HTCAPTION = 2; - public const int HTSYSMENU = 3; - public const int HTGROWBOX = 4; - public const int HTLEFT = 10; - public const int HTRIGHT = 11; - public const int HTTOP = 12; - public const int HTTOPLEFT = 13; - public const int HTTOPRIGHT = 14; - public const int HTBOTTOM = 15; - public const int HTBOTTOMLEFT = 16; - public const int HTBOTTOMRIGHT = 17; - - public const int WS_EX_DLGMODALFRAME = 0x00000001; - public const int WS_EX_NOPARENTNOTIFY = 0x00000004; - public const int WS_EX_TOPMOST = 0x00000008; - public const int WS_EX_ACCEPTFILES = 0x00000010; - public const int WS_EX_TRANSPARENT = 0x00000020; - public const int WS_EX_MDICHILD = 0x00000040; - public const int WS_EX_TOOLWINDOW = 0x00000080; - public const int WS_EX_WINDOWEDGE = 0x00000100; - public const int WS_EX_CLIENTEDGE = 0x00000200; - public const int WS_EX_CONTEXTHELP = 0x00000400; - public const int WS_EX_RIGHT = 0x00001000; - public const int WS_EX_LEFT = 0x00000000; - public const int WS_EX_RTLREADING = 0x00002000; - public const int WS_EX_LTRREADING = 0x00000000; - public const int WS_EX_LEFTSCROLLBAR = 0x00004000; - public const int WS_EX_RIGHTSCROLLBAR = 0x00000000; - public const int WS_EX_CONTROLPARENT = 0x00010000; - public const int WS_EX_STATICEDGE = 0x00020000; - public const int WS_EX_APPWINDOW = 0x00040000; - public const int WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE); - public const int WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST); - public const int WS_EX_LAYERED = 0x00080000; - public const int WS_EX_NOINHERITLAYOUT = 0x00100000; // Disable inheritence of mirroring by children - public const int WS_EX_NOREDIRECTIONBITMAP = 0x00200000; - public const int WS_EX_LAYOUTRTL = 0x00400000; // Right to left mirroring - public const int WS_EX_COMPOSITED = 0x02000000; - public const int WS_EX_NOACTIVATE = 0x08000000; - - public const uint LWA_COLORKEY = 0x00000001; - public const uint LWA_ALPHA = 0x00000002; - - [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - public static extern bool SetLayeredWindowAttributes(IntPtr hwnd, uint crKey, byte bAlpha, uint dwFlags); - - private static long MakeArgb(byte alpha, byte red, byte green, byte blue) - { - return (long)(((ulong)((((red << 0x10) | (green << 8)) | blue) | (alpha << 0x18))) & 0xffffffffL); - } - - const int GWL_STYLE = (-16); - const int GWL_EXSTYLE = (-20); - public static IntPtr SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong) - { - if (IntPtr.Size == 4) - { - return SetWindowLongPtr32(hWnd, nIndex, dwNewLong); - } - return SetWindowLongPtr64(hWnd, nIndex, dwNewLong); - } - - [DllImport("User32.dll", CharSet = CharSet.Auto, EntryPoint = "SetWindowLong")] - public static extern IntPtr SetWindowLongPtr32(IntPtr hWnd, int nIndex, IntPtr dwNewLong); - - [DllImport("User32.dll", CharSet = CharSet.Auto, EntryPoint = "SetWindowLongPtr")] - public static extern IntPtr SetWindowLongPtr64(IntPtr hWnd, int nIndex, IntPtr dwNewLong); - - // public static IntPtr GetWindowLong(HandleRef hWnd, int nIndex) - public static long GetWindowLong(IntPtr hWnd, int nIndex) - { - if (IntPtr.Size == 4) - { - return GetWindowLong32(hWnd, nIndex); - } - return GetWindowLongPtr64(hWnd, nIndex); - } - - [DllImport("User32.dll", EntryPoint = "GetWindowLong", CharSet = CharSet.Auto)] - public static extern long GetWindowLong32(IntPtr hWnd, int nIndex); - - [DllImport("User32.dll", EntryPoint = "GetWindowLongPtr", CharSet = CharSet.Auto)] - public static extern long GetWindowLongPtr64(IntPtr hWnd, int nIndex); - - [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - public static extern bool DestroyWindow(IntPtr hWnd); - - [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Auto)] - public static extern bool ShowWindow(IntPtr hWnd, int nShowCmd); - - public const int SW_HIDE = 0; - public const int SW_SHOWNORMAL = 1; - public const int SW_SHOWMINIMIZED = 2; - public const int SW_SHOWMAXIMIZED = 3; - public const int SW_SHOWNOACTIVATE = 4; - public const int SW_SHOW = 5; - - [DllImport("User32.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern int SendMessage(IntPtr hWnd, uint msg, int wParam, IntPtr lParam); - - [DllImport("User32.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern int PostMessage(IntPtr hWnd, uint msg, int wParam, IntPtr lParam); - - [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Auto)] - public static extern int DefWindowProc(IntPtr hWnd, uint uMsg, int wParam, IntPtr lParam); - - [DllImport("Gdi32.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern IntPtr CreateRectRgn(int x1, int y1, int x2, int y2); - - [DllImport("Gdi32.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern int CombineRgn(IntPtr hrgnDest, IntPtr hrgnSrc1, IntPtr hrgnSrc2, int iMode); - - [DllImport("User32.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern int SetWindowRgn(IntPtr hWnd, IntPtr hRgn, bool bRedraw); - - [DllImport("Gdi32.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern IntPtr CreateRoundRectRgn(int x1, int y1, int x2, int y2, int cx, int cy); - - public const int RGN_AND = 1; - public const int RGN_OR = 2; - public const int RGN_XOR = 3; - public const int RGN_DIFF = 4; - public const int RGN_COPY = 5; - public const int RGN_MIN = RGN_AND; - public const int RGN_MAX = RGN_COPY; - - public const int ERROR = 0; - public const int NULLREGION = 1; - public const int SIMPLEREGION = 2; - public const int COMPLEXREGION = 3; - - [DllImport("Gdi32.dll", SetLastError = true)] - public static extern bool DeleteObject(IntPtr hObject); - - public delegate int SUBCLASSPROC(IntPtr hWnd, uint uMsg, IntPtr wParam, IntPtr lParam, IntPtr uIdSubclass, uint dwRefData); - - [DllImport("Comctl32.dll", SetLastError = true)] - public static extern bool SetWindowSubclass(IntPtr hWnd, SUBCLASSPROC pfnSubclass, uint uIdSubclass, uint dwRefData); - - [DllImport("Comctl32.dll", SetLastError = true)] - public static extern int DefSubclassProc(IntPtr hWnd, uint uMsg, IntPtr wParam, IntPtr lParam); - - [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); - - [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); - - [DllImport("User32.dll", SetLastError = true)] - public static extern bool ScreenToClient(IntPtr hWnd, ref POINT lpPoint); - - [DllImport("User32.dll", SetLastError = true)] - public static extern bool ClientToScreen(IntPtr hWnd, ref POINT lpPoint); - - [DllImport("User32.dll", SetLastError = true)] - public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect); - - [StructLayout(LayoutKind.Sequential)] - public struct RECT - { - public int left; - public int top; - public int right; - public int bottom; - public RECT(int Left, int Top, int Right, int Bottom) - { - left = Left; - top = Top; - right = Right; - bottom = Bottom; - } - } - - public static int GET_X_LPARAM(IntPtr lParam) - { - return LOWORD(lParam.ToInt32()); - } - - public static int GET_Y_LPARAM(IntPtr lParam) - { - return HIWORD(lParam.ToInt32()); - } - public static int HIWORD(int i) - { - return (short)(i >> 16); - } - public static int LOWORD(int i) - { - return (short)(i & 0xFFFF); - } - - private static int MakeLParam(int LoWord, int HiWord) - { - int res = (int)((HiWord << 16) | (LoWord & 0xffff)); - return res; - } - - [StructLayout(LayoutKind.Sequential)] - public struct POINT - { - public int x; - public int y; - - public POINT(int X, int Y) - { - this.x = X; - this.y = Y; - } - } - - [DllImport("User32.dll", SetLastError = true)] - public static extern bool PtInRect(ref RECT lprc, POINT pt); - - [DllImport("User32.dll", SetLastError = true)] - public static extern bool ReleaseCapture(); - - [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Auto)] - public static extern bool MoveWindow(IntPtr hWnd, int x, int y, int cx, int cy, bool repaint); - - public const int SWP_NOSIZE = 0x0001; - public const int SWP_NOMOVE = 0x0002; - public const int SWP_NOZORDER = 0x0004; - public const int SWP_NOREDRAW = 0x0008; - public const int SWP_NOACTIVATE = 0x0010; - public const int SWP_FRAMECHANGED = 0x0020; /* The frame changed: send WM_NCCALCSIZE */ - public const int SWP_SHOWWINDOW = 0x0040; - public const int SWP_HIDEWINDOW = 0x0080; - public const int SWP_NOCOPYBITS = 0x0100; - public const int SWP_NOOWNERZORDER = 0x0200; /* Don't do owner Z ordering */ - public const int SWP_NOSENDCHANGING = 0x0400; /* Don't send WM_WINDOWPOSCHANGING */ - public const int SWP_DRAWFRAME = SWP_FRAMECHANGED; - public const int SWP_NOREPOSITION = SWP_NOOWNERZORDER; - public const int SWP_DEFERERASE = 0x2000; - public const int SWP_ASYNCWINDOWPOS = 0x4000; - - [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); - - [DllImport("User32.dll", SetLastError = true)] - public static extern bool RedrawWindow(IntPtr hWnd, IntPtr lprcUpdate, IntPtr hrgnUpdate, uint flags); - - public const int RDW_INVALIDATE = 0x0001; - public const int RDW_INTERNALPAINT = 0x0002; - public const int RDW_ERASE = 0x0004; - - public const int RDW_VALIDATE = 0x0008; - public const int RDW_NOINTERNALPAINT = 0x0010; - public const int RDW_NOERASE = 0x0020; - - public const int RDW_NOCHILDREN = 0x0040; - public const int RDW_ALLCHILDREN = 0x0080; - - public const int RDW_UPDATENOW = 0x0100; - public const int RDW_ERASENOW = 0x0200; - - public const int RDW_FRAME = 0x0400; - public const int RDW_NOFRAME = 0x0800; - - [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - public static extern int MessageBox(IntPtr hWnd, string lpText, string lpCaption, uint uType); - - [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - public static extern short GetAsyncKeyState(int nVirtKey); - - public const int VK_LBUTTON = 0x01; - public const int VK_RBUTTON = 0x02; - - [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Auto)] - public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, uint dwExtraInfo); - - public const int MOUSEEVENTF_MOVE = 0x0001; /* mouse move */ - public const int MOUSEEVENTF_LEFTDOWN = 0x0002; /* left button down */ - public const int MOUSEEVENTF_LEFTUP = 0x0004; /* left button up */ - public const int MOUSEEVENTF_RIGHTDOWN = 0x0008; /* right button down */ - public const int MOUSEEVENTF_RIGHTUP = 0x0010; /* right button up */ - public const int MOUSEEVENTF_MIDDLEDOWN = 0x0020; /* middle button down */ - public const int MOUSEEVENTF_MIDDLEUP = 0x0040; /* middle button up */ - public const int MOUSEEVENTF_XDOWN = 0x0080; /* x button down */ - public const int MOUSEEVENTF_XUP = 0x0100; /* x button down */ - public const int MOUSEEVENTF_WHEEL = 0x0800; /* wheel button rolled */ - public const int MOUSEEVENTF_HWHEEL = 0x01000; /* hwheel button rolled */ - public const int MOUSEEVENTF_MOVE_NOCOALESCE = 0x2000; /* do not coalesce mouse moves */ - public const int MOUSEEVENTF_VIRTUALDESK = 0x4000; /* map to entire virtual desktop */ - public const int MOUSEEVENTF_ABSOLUTE = 0x8000; /* absolute move */ - - [DllImport("User32.dll", SetLastError = true)] - public static extern int SendInput(int nInputs, [MarshalAs(UnmanagedType.LPArray)] INPUT[] pInput, int cbSize); - - public const int INPUT_MOUSE = 0; - public const int INPUT_KEYBOARD = 1; - public const int INPUT_HARDWARE = 2; - - public const int KEYEVENTF_EXTENDEDKEY = 0x0001; - public const int KEYEVENTF_KEYUP = 0x0002; - public const int KEYEVENTF_UNICODE = 0x0004; - - [StructLayout(LayoutKind.Sequential)] - public struct MOUSEINPUT - { - public int dx; - public int dy; - public int mouseData; - public int dwFlags; - public int time; - public IntPtr dwExtraInfo; - } - - [StructLayout(LayoutKind.Sequential)] - public struct KEYBDINPUT - { - public short wVk; - public short wScan; - public int dwFlags; - public int time; - public IntPtr dwExtraInfo; - } - - [StructLayout(LayoutKind.Sequential)] - public struct HARDWAREINPUT - { - public int uMsg; - public short wParamL; - public short wParamH; - } - - [StructLayout(LayoutKind.Sequential)] - public struct INPUT - { - public int type; - public INPUTUNION inputUnion; - } - - [StructLayout(LayoutKind.Explicit)] - public struct INPUTUNION - { - [FieldOffset(0)] - public MOUSEINPUT mi; - [FieldOffset(0)] - public KEYBDINPUT ki; - [FieldOffset(0)] - public HARDWAREINPUT hi; - } - - [DllImport("User32.dll", SetLastError = true)] - public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); - - [DllImport("User32.dll", SetLastError = true)] - public static extern IntPtr GetCapture(); - - [DllImport("User32.dll", SetLastError = true)] - public static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName); - - [DllImport("User32.dll", CharSet = CharSet.Auto)] - public static extern IntPtr CallWindowProc(IntPtr wndProc, IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam); - - //[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] - [DllImport("User32.dll", SetLastError = true, EntryPoint = "RegisterClassW")] - public static extern short RegisterClass(ref WNDCLASS wc); - - [DllImport("User32.dll", SetLastError = true, EntryPoint = "RegisterClassExW")] - public static extern short RegisterClassEx(ref WNDCLASSEX lpwcx); - - public delegate int WNDPROC(IntPtr hwnd, uint uMsg, int wParam, IntPtr lParam); - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct WNDCLASS - { - [MarshalAs(UnmanagedType.U4)] - public uint style; - public WNDPROC lpfnWndProc; - public int cbClsExtra; - public int cbWndExtra; - public IntPtr hInstance; - public IntPtr hIcon; - public IntPtr hCursor; - public IntPtr hbrBackground; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string lpszMenuName; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string lpszClassName; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - public struct WNDCLASSEX - { - [MarshalAs(UnmanagedType.U4)] - public int cbSize; - [MarshalAs(UnmanagedType.U4)] - public int style; - public WNDPROC lpfnWndProc; - public int cbClsExtra; - public int cbWndExtra; - public IntPtr hInstance; - public IntPtr hIcon; - public IntPtr hCursor; - public IntPtr hbrBackground; - public string lpszMenuName; - public string lpszClassName; - public IntPtr hIconSm; - } - - public const int WS_OVERLAPPEDWINDOW = 0xcf0000; - public const int WS_VISIBLE = 0x10000000; - public const int CS_USEDEFAULT = unchecked((int)0x80000000); - public const int CS_DBLCLKS = 8; - public const int CS_VREDRAW = 1; - public const int CS_HREDRAW = 2; - public const int COLOR_BACKGROUND = 1; - public const int COLOR_WINDOW = 5; - public const int IDC_ARROW = 32512; - public const int IDC_IBEAM = 32513; - public const int IDC_WAIT = 32514; - public const int IDC_CROSS = 32515; - public const int IDC_UPARROW = 32516; - - public const int BS_PUSHLIKE = 0x00001000; - public const int BN_CLICKED = 0; - - [DllImport("User32.dll", SetLastError = true)] - public static extern IntPtr CreateWindowEx(int dwExStyle, string lpClassName, string lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hWndParent, IntPtr hMenu, IntPtr hInstance, IntPtr lpParam); - - [DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] - public static extern IntPtr GetModuleHandle(string modName); - - - public LegacyTransparentWindow() - { - this.InitializeComponent(); - - // WinUIDesktopWin32WindowClass - // Microsoft.UI.Content.ContentWindowSiteBridge - // DRAG_BAR_WINDOW_CLASS - hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this); - WindowId myWndId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hWnd); - _apw = AppWindow.GetFromWindowId(myWndId); - - hWndChild = FindWindowEx(hWnd, IntPtr.Zero, "Microsoft.UI.Content.ContentWindowSiteBridge", null); - - //SetWindowPos(hWndChild, new IntPtr(-1), 0, 0, 800, 800, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOREDRAW); - - //ShowWindow(hWndChild, SW_HIDE); - - _apw.Title = "Test WindowsAppSDK"; - _apw.Resize(new Windows.Graphics.SizeInt32(320, 200)); - - Grid grid1 = (Grid)this.Content; - grid1.PointerPressed += Grid1_PointerPressed; - //grid1.PointerReleased += Grid1_PointerReleased; - - _presenter = _apw.Presenter as OverlappedPresenter; - _presenter.IsResizable = false; - _presenter.IsMinimizable = false; - _presenter.IsAlwaysOnTop = true; - _presenter.SetBorderAndTitleBar(false, false); - - SubClassDelegate = new SUBCLASSPROC(WindowSubClass); - bool bRet = SetWindowSubclass(hWnd, SubClassDelegate, 0, 0); - - //SetParent(hWndChild, IntPtr.Zero); - //long nStyleChild = GetWindowLong(hWndChild, GWL_STYLE); - ////nStyleChild = (nStyleChild | WS_POPUP) & (~WS_CHILD); - //nStyleChild = (nStyleChild) & (~WS_CHILD); - //SetWindowLong(hWndChild, GWL_STYLE, (IntPtr)(nStyleChild)); - - ////SetWindowPos(hWnd, (IntPtr)(-1), 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); - //SetWindowPos(hWndChild, (IntPtr)(-1), 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); - - //long nExStyleChild = GetWindowLong(hWndChild, GWL_EXSTYLE); - //SetWindowLong(hWndChild, GWL_EXSTYLE, (IntPtr)(nExStyleChild | WS_EX_TOPMOST)); - - - long nExStyle = GetWindowLong(hWnd, GWL_EXSTYLE); - if ((nExStyle & WS_EX_LAYERED) == 0) - { - SetWindowLong(hWnd, GWL_EXSTYLE, (IntPtr)(nExStyle | WS_EX_LAYERED)); - //nExStyle = GetWindowLong(hWnd, GWL_EXSTYLE); - //SetWindowLong(hWnd, GWL_EXSTYLE, (IntPtr)(nExStyle | WS_EX_TRANSPARENT)); - SetLayeredWindowAttributes(hWnd, (uint)0, (byte)(255 * nOpacity / 100), LWA_ALPHA); - - //SetLayeredWindowAttributes(hWnd, (uint)MakeArgb(0, 0, 0, 0), (byte)(255 * nOpacity / 100), LWA_COLORKEY); - //SetLayeredWindowAttributes(hWnd, (uint)MakeArgb(0, 0, 0, 0), 255, LWA_ALPHA | LWA_COLORKEY); - - } - nExStyle = GetWindowLong(hWnd, GWL_EXSTYLE); - SetWindowLong(hWnd, GWL_EXSTYLE, (IntPtr)(nExStyle | WS_EX_NOACTIVATE)); - - //nExStyle = GetWindowLong(hWnd, GWL_EXSTYLE); - //SetWindowLong(hWnd, GWL_EXSTYLE, (IntPtr)(nExStyle | WS_EX_NOREDIRECTIONBITMAP)); - - int nX = (int)(_apw.Size.Width - myButton.ActualOffset.X - myButton.Width); - int nY = (int)myButton.ActualOffset.Y; - ////IntPtr HoleRgn = CreateRectRgn((int)myButton.ActualOffset.X, (int)myButton.ActualOffset.Y, (int)(myButton.ActualOffset.X + myButton.Width), (int)(myButton.ActualOffset.Y + myButton.Height)); - //IntPtr HoleRgn = CreateRectRgn(nX, nY, (int)(nX + myButton.Width), (int)(nY + myButton.Height)); - //CombineRgn(WindowRgn, WindowRgn, HoleRgn, RGN_DIFF); - //SetWindowRgn(hWndChild, WindowRgn, true); - //DeleteObject(HoleRgn); - - IntPtr WindowRgn = CreateRectRgn(0, 0, _apw.Size.Width, _apw.Size.Height); - IntPtr HoleRgn = CreateRectRgn(nX, nY, (int)(nX + myButton.Width), (int)(nY + myButton.Height)); - - IntPtr HoleRgn2 = CreateRectRgn(0, 0, _apw.Size.Width, 20); - IntPtr WindowRgn2 = CreateRectRgn(0, 0, 0, 0); - int nRet = CombineRgn(WindowRgn2, HoleRgn2, HoleRgn, RGN_OR); - - - //CombineRgn(WindowRgn, WindowRgn, HoleRgn, RGN_DIFF); - CombineRgn(WindowRgn, HoleRgn, WindowRgn, RGN_MIN); - //CombineRgn(WindowRgn, WindowRgn2, WindowRgn, RGN_MIN); - - //SetWindowRgn(hWndChild, WindowRgn, true); - DeleteObject(HoleRgn); - - //nExStyle = GetWindowLong(hWnd, GWL_EXSTYLE); - //SetWindowLong(hWnd, GWL_EXSTYLE, (IntPtr)(nExStyle | WS_EX_TRANSPARENT)); - //SetWindowRgn(hWnd, IntPtr.Zero, true); - - return; - } - - private AppWindow _apw; - private OverlappedPresenter _presenter; - private CompactOverlayPresenter _compact; - - private SUBCLASSPROC SubClassDelegate; - - private IntPtr hWnd = IntPtr.Zero; - private IntPtr hWndChild = IntPtr.Zero; - - - private void Grid1_PointerReleased(object sender, PointerRoutedEventArgs e) - { - Console.Beep(6000, 10); - //SetWindowPos(hWnd, hWndChild, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_HIDEWINDOW); - RECT rc; - GetWindowRect(hWnd, out rc); - //SetWindowPos(hWnd, hWndChild, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_HIDEWINDOW); - SetWindowPos(hWnd, (IntPtr)(-1), 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); - SetWindowPos(hWndChild, (IntPtr)(-2), rc.left, rc.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW | SWP_FRAMECHANGED | SWP_ASYNCWINDOWPOS); - - } - - private void Grid1_PointerPressed(object sender, PointerRoutedEventArgs e) - { - var properties = e.GetCurrentPoint((Grid)sender).Properties; - if (properties.IsLeftButtonPressed) - { - long nExStyle = GetWindowLong(hWndChild, GWL_EXSTYLE); - if ((nExStyle & WS_EX_LAYERED) == 0) - { - SetWindowLong(hWndChild, GWL_EXSTYLE, (IntPtr)(nExStyle | WS_EX_LAYERED)); - nExStyle = GetWindowLong(hWndChild, GWL_EXSTYLE); - // break events/UI - SetWindowLong(hWndChild, GWL_EXSTYLE, (IntPtr)(nExStyle | WS_EX_TRANSPARENT)); - //Console.Beep(6000, 10); - - //SetLayeredWindowAttributes(hWndChild, (uint)MakeArgb(0, 0, 0, 0), 100, LWA_ALPHA); - } - INPUT[] mi = new INPUT[2]; - mi[0].type = INPUT_MOUSE; - mi[0].inputUnion.mi.dwFlags = MOUSEEVENTF_LEFTUP; - mi[1].inputUnion.mi.dwFlags = MOUSEEVENTF_LEFTDOWN; - SendInput(2, mi, Marshal.SizeOf(mi[0])); - } - else if (properties.IsRightButtonPressed) - { - System.Threading.Thread.Sleep(200); - Application.Current.Exit(); - } - e.Handled = true; - } - - int nOpacity = 80; - private async void myButton_Click(object sender, RoutedEventArgs e) - { - { - delegateWndProc = Win32WndProc; - WNDCLASSEX wcex = new WNDCLASSEX(); - wcex.cbSize = Marshal.SizeOf(typeof(WNDCLASSEX)); - wcex.style = (CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS); - wcex.hbrBackground = (IntPtr)COLOR_BACKGROUND + 1; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = 0; - wcex.hInstance = Marshal.GetHINSTANCE(this.GetType().Module); // Process.GetCurrentProcess().Handle; - wcex.hIcon = IntPtr.Zero; - wcex.hCursor = LoadCursor(IntPtr.Zero, (int)IDC_ARROW); - wcex.lpszMenuName = null; - wcex.lpszClassName = "Win32Class"; - //wind_class.lpfnWndProc = Marshal.GetFunctionPointerForDelegate(delegWndProc); - wcex.lpfnWndProc = delegateWndProc; - wcex.hIconSm = IntPtr.Zero; - short nRet = RegisterClassEx(ref wcex); - if (nRet == 0) - { - int nError = Marshal.GetLastWin32Error(); - if (nError != 1410) //0x582 ERROR_CLASS_ALREADY_EXISTS - return; - } - string sClassName = wcex.lpszClassName; - IntPtr hWnd2 = CreateWindowEx(0, sClassName, "Win32 window", WS_OVERLAPPEDWINDOW | WS_VISIBLE, _apw.Position.X, _apw.Position.Y, 270, 270, hWnd, IntPtr.Zero, wcex.hInstance, IntPtr.Zero); - } - return; - - // 0x8001010E (RPC_E_WRONG_THREAD))' - //var thread = new System.Threading.Thread(() => - //{ - // Window window = new Window(); - // window.Content = new TextBlock() { Text = "Hello" }; - // window.Activate(); - // //window.Closed += (_, __) => w.DispatcherQueue.InvokeShutdown(); - - // var syncContext = new Microsoft.UI.Dispatching.DispatcherQueueSynchronizationContext(Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread()); - // System.Threading.SynchronizationContext.SetSynchronizationContext(syncContext); - - // //this.ProcessEvents(); // Message pump - //}); - - //thread.SetApartmentState(System.Threading.ApartmentState.STA); - //thread.Start(); - //return; - - // MessageBox(hWnd, "Button clicked !", "Information", 0); - - // 0xc000027b - //Window window = new Window(); - //window.Content = new TextBlock() { Text = "Hello" }; - //window.Activate(); - //return; - - //IntPtr WindowRgn = CreateRectRgn(0, 0, _apw.Size.Width / 2, _apw.Size.Height); - //SetWindowRgn(hWnd, WindowRgn, true); - - TeachingTip.IsOpen = true; - TeachingTip.XamlRoot = this.Content.XamlRoot; - return; - - myButton.Content = "Clicked"; - var cd = new ContentDialog - { - Title = "Information", - Content = "You clicked the button !", - CloseButtonText = "Ok" - }; - - cd.XamlRoot = this.Content.XamlRoot; - var result = await cd.ShowAsync(); - } - - int n = 0; - private int WindowSubClass(IntPtr hWnd, uint uMsg, IntPtr wParam, IntPtr lParam, IntPtr uIdSubclass, uint dwRefData) - { - System.Diagnostics.Debug.WriteLine(String.Format("uMsg({0}) = {1:x}", n, uMsg)); - n++; - switch (uMsg) - { - //case WM_MOVE: - // { - // RECT rc; - // GetWindowRect(hWnd, out rc); - // //SetWindowPos(hWndChild, hWnd, rc.left, rc.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW | SWP_FRAMECHANGED ); - // //SetWindowPos(hWnd, hWndChild, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW); - // SetWindowPos(hWndChild, (IntPtr)(-1), rc.left, rc.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW | SWP_FRAMECHANGED); - // return 0; - // } - // break; - - // case WM_POINTERDOWN: - // case WM_NCLBUTTONDOWN: - // { - // Console.Beep(1000, 10); - // //SetWindowPos(hWnd, hWndChild, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_HIDEWINDOW); - - // //SetWindowPos(hWnd, hWndChild, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_HIDEWINDOW); - // SetWindowPos(hWnd, (IntPtr)(-2), 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); - // SetWindowPos(hWndChild, (IntPtr)(-1), 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW | SWP_FRAMECHANGED); - // //return 0; - // } - // break; - //case WM_NCPOINTERUP: - //case WM_LBUTTONUP: - //case WM_POINTERUP: - ////case WM_POINTERUPDATE: - // { - // Console.Beep(6000, 10); - // //SetWindowPos(hWnd, hWndChild, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_HIDEWINDOW); - // RECT rc; - // GetWindowRect(hWnd, out rc); - // //SetWindowPos(hWnd, hWndChild, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_HIDEWINDOW); - // SetWindowPos(hWnd, (IntPtr)(-1), 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); - // SetWindowPos(hWndChild, (IntPtr)(-2), rc.left, rc.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW | SWP_FRAMECHANGED | SWP_ASYNCWINDOWPOS); - // //return 0; - // } - // break; - //case WM_NCHITTEST: - // { - // //SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, lParam); - // //bool bLeftButton = (GetAsyncKeyState((int)VK_LBUTTON) & 0x8000) == 0x8000; - // //if (GetCapture() == IntPtr.Zero) - // //{ - // // Console.Beep(6000, 10); - // // return HTCAPTION; - // //} - // //if (bLeftButton) - // { - // return HTCAPTION; - // } - // } - // break; - case WM_NCHITTEST: - { - POINT pt = new POINT(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); - ScreenToClient(hWnd, ref pt); - int nWidth = 0; - int nCaptionSize = 0; - RECT rc = new RECT((int)myButton.ActualOffset.X + nWidth, (int)myButton.ActualOffset.Y + nCaptionSize, (int)(myButton.ActualOffset.X + nWidth + myButton.Width), (int)(myButton.ActualOffset.Y + nCaptionSize + myButton.Height)); - bool bRet = PtInRect(ref rc, pt); - bool bRightButton = (GetAsyncKeyState((int)VK_RBUTTON) & 0x8000) == 0x8000; - bool bLeftButton = (GetAsyncKeyState((int)VK_LBUTTON) & 0x8000) == 0x8000; - if (!bLeftButton) - { - long nExStyle = GetWindowLong(hWndChild, GWL_EXSTYLE); - if ((nExStyle & WS_EX_LAYERED) == WS_EX_LAYERED) - { - SetWindowLong(hWndChild, GWL_EXSTYLE, (IntPtr)(nExStyle & ~(WS_EX_LAYERED | WS_EX_TRANSPARENT))); - } - break; - } - - int nRet = DefWindowProc(hWnd, WM_NCHITTEST, 0, lParam); - //System.Diagnostics.Debug.WriteLine(String.Format("WM_NCHITTEST = {0}", nRet)); - switch (nRet) - { - case HTLEFT: - case HTTOP: - case HTBOTTOM: - case HTRIGHT: - case HTBOTTOMLEFT: - case HTBOTTOMRIGHT: - case HTTOPLEFT: - case HTTOPRIGHT: - return nRet; - - } - return HTCAPTION; - } - break; - } - return DefSubclassProc(hWnd, uMsg, wParam, lParam); - } - private const int IDC_BUTTON = 10; - private WNDPROC delegateWndProc; - private int Win32WndProc(IntPtr hwnd, uint msg, int wParam, IntPtr lParam) - { - int wmId, wmEvent; - switch (msg) - { - case WM_CREATE: - { - IntPtr hWndButton = CreateWindowEx(0, "Button", "Click", WS_CHILD | WS_VISIBLE | BS_PUSHLIKE, 100, 92, 60, 32, hwnd, (IntPtr)IDC_BUTTON, GetModuleHandle(null), IntPtr.Zero); - } - break; - case WM_COMMAND: - { - wmId = LOWORD(wParam); - wmEvent = HIWORD(wParam); - switch (wmId) - { - case IDC_BUTTON: - { - if (wmEvent == BN_CLICKED) - { - nOpacity -= 10; - SetLayeredWindowAttributes(hWnd, 0, (byte)(255 * nOpacity / 100), LWA_ALPHA); - } - } - break; - default: - return DefWindowProc(hwnd, msg, wParam, lParam); - } - } - break; - //case WM_PAINT: - // break; - - //case WM_LBUTTONDBLCLK: - // Console.Beep(5000, 10); - // //System.Windows.Forms.MessageBox.Show("Doubleclick"); - // break; - - //case WM_DESTROY: - // DestroyWindow(hWnd); - // //PostQuitMessage(0); - // break; - - default: - break; - } - return DefWindowProc(hwnd, msg, wParam, lParam); - } -} diff --git a/dev/Riverside.Toolkit.Flyouts/Widgets/TestWidget.xaml b/dev/Riverside.Toolkit.Flyouts/Widgets/TestWidget.xaml deleted file mode 100644 index 82e8b1e..0000000 --- a/dev/Riverside.Toolkit.Flyouts/Widgets/TestWidget.xaml +++ /dev/null @@ -1,17 +0,0 @@ - - - eck - - diff --git a/dev/Riverside.Toolkit.Flyouts/Widgets/TestWidget.xaml.cs b/dev/Riverside.Toolkit.Flyouts/Widgets/TestWidget.xaml.cs deleted file mode 100644 index fce2497..0000000 --- a/dev/Riverside.Toolkit.Flyouts/Widgets/TestWidget.xaml.cs +++ /dev/null @@ -1,303 +0,0 @@ -using Microsoft.UI.Xaml; -using System.Runtime.InteropServices; -using System.Text; -using WinUIEx; - -// To learn more about WinUI, the WinUI project structure, -// and more about our project templates, see: http://aka.ms/winui-project-info. - -namespace FluentFlyouts3.Flyouts; - -/// -/// An empty window that can be used on its own or navigated to within a Frame. -/// -public sealed partial class TestWidget : WindowEx -{ - public Rect MonitorRect { get; private set; } - public TestWidget() - { - this.InitializeComponent(); - } - - private void Grid_Loaded(object sender, RoutedEventArgs e) - { - var rect = new Rect(); - var handle = this.GetWindowHandle(); - SendMessageToProgman(); - EnableExToolWindow(handle, true); - var workerWHandle = GetWorkerW(handle); - SetWindowPos(handle, (IntPtr)1, MonitorRect.Left, MonitorRect.Top, MonitorRect.Width, MonitorRect.Height, 0 | 0x0010); - MapWindowPoints(handle, workerWHandle, ref rect, 2); - - SetParent(handle, workerWHandle); - - SetWindowPos(handle, (IntPtr)1, rect.Left, rect.Top, MonitorRect.Width, MonitorRect.Height, 0 | 0x0010); - RefreshDesktop(); - } - public static void EnableExToolWindow(IntPtr hwnd, bool enable) - { - var exStyle = GetWindowLong(hwnd, GWL_EXSTYLE); - if (enable) - { - exStyle |= WS_EX_TOOLWINDOW; - } - else - { - exStyle &= ~WS_EX_TOOLWINDOW; - } - SetWindowLong(hwnd, GWL_EXSTYLE, exStyle); - } - public static void SendMessageToProgman() - { - var progmanHandle = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Progman", null); - SendMessageTimeout(progmanHandle, 0x052C, 0, 0, SendMessageTimeoutFlags.SMTO_NORMAL, 1000, out var result); - //SendMessage(progmanHandle, 0x052C, 0, 0); - //SendMessage(progmanHandle, 0x052C, 0x0000000D, 0); - //SendMessage(progmanHandle, 0x052C, 0x0000000D, 1); - } - public static void RefreshDesktop() - { - SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, null, SPIF_UPDATEINIFILE); - } - public static IntPtr GetWorkerW(IntPtr hwnd) - { - var workerWHandle = IntPtr.Zero; - EnumWindows(new EnumWindowsProc((topHandle, topParamHandle) => - { - var shellHandle = FindWindowEx(topHandle, IntPtr.Zero, "SHELLDLL_DefView", null); - if (shellHandle != IntPtr.Zero) - { - workerWHandle = FindWindowEx(IntPtr.Zero, topHandle, "WorkerW", null); - } - return true; - }), IntPtr.Zero); - return workerWHandle; - } - public const int GWL_EXSTYLE = -20; - public const int WS_EX_NOACTIVATE = 0x8000000; - public const int WS_EX_TOOLWINDOW = 0x00000080; - public const int HWND_TOP = 0; - public const int HWND_BOTTOM = 1; - public const int SWP_NOMOVE = 2; - public const int SWP_NOSIZE = 1; - public const int SWP_NOACTIVATE = 0x10; - public const int SWP_NOZORDER = 4; - public const int WM_WINDOWPOSCHANGING = 0x46; - public const int WM_DPICHANGED = 0x02E0; - public const uint SPI_SETDESKWALLPAPER = 20; - public const uint SPIF_UPDATEINIFILE = 0x1; - public const uint SPI_SETCLIENTAREAANIMATION = 0x1043; - public const int SRCCOPY = 0x00CC0020; - public const int WM_GETTEXT = 0x000D; - public const int WM_GETTEXTLENGTH = 0x000E; - public const int WM_CLOSE = 0x0010; - - // MonitorFromWindow - public const uint MONITOR_DEFAULTTONULL = 0; - public const uint MONITOR_DEFAULTTOPRIMARY = 1; - public const uint MONITOR_DEFAULTTONEAREST = 2; - public delegate bool EnumMonitorProc(IntPtr hMonitor, IntPtr hdcMonitor, ref Rect rcMonitor, IntPtr data); - - public delegate bool EnumWindowsProc(IntPtr hwnd, IntPtr lParam); - - public delegate void WinEventDelegate(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime); - - [DllImport("user32")] - public static extern IntPtr SetWindowPos(IntPtr hWnd, IntPtr hWndAfter, int x, int y, int dx, int cy, uint flags); - - [DllImport("user32.dll")] - public static extern bool MoveWindow(IntPtr handle, int x, int y, int nWidth, int nHeight, bool bRepaint); - - [DllImport("user32")] - public static extern bool EnumDisplayMonitors(IntPtr hDC, IntPtr clipRect, EnumMonitorProc proc, IntPtr data); - - [DllImport("user32")] - public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); - - [DllImport("user32.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool IsWindow(IntPtr hWnd); - - [DllImport("user32")] - public static extern int SetWindowLong(IntPtr hWnd, int index, int value); - - [DllImport("user32")] - public static extern int GetWindowLong(IntPtr hWnd, int index); - - [DllImport("user32.dll", SetLastError = true)] - public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out int lpdwProcessId); - - [DllImport("user32.dll", SetLastError = true)] - public static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr processId); - - [DllImport("user32")] - public static extern IntPtr GetDesktopWindow(); - - [DllImport("user32")] - public static extern IntPtr GetShellWindow(); - - [DllImport("user32")] - public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); - - [DllImport("user32")] - public static extern IntPtr FindWindowEx(IntPtr hWndParent, IntPtr hWndChildAfter, string lpWindowClass, string lpWindowName); - - [DllImport("user32")] - public static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam); - - [DllImport("user32")] - public static extern IntPtr SetWinEventHook(uint eventMin, uint eventMax, IntPtr hmodWinEventProc, WinEventDelegate lpfnWinEventProc, uint idProcess, uint idThread, uint dwFlags); - - [DllImport("user32")] - public static extern bool UnhookWinEvent(IntPtr hWinEventHook); - - [DllImport("user32")] - public static extern int GetClassName(IntPtr hwnd, StringBuilder name, int count); - - [DllImport("user32")] - public static extern int SendMessage(IntPtr hWnd, int wMsg, int wParam, int lParam); - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - public static extern bool SendMessage(IntPtr hWnd, uint Msg, int wParam, StringBuilder lParam); - - [DllImport("user32.dll")] - public static extern int SendMessageTimeout(IntPtr hWnd, int wMsg, int wParam, int lParam, SendMessageTimeoutFlags fuFlags, uint uTimeout, out int lpdwResult); - - [DllImport("user32")] - public static extern int PostMessage(IntPtr hWnd, int wMsg, int wParam, int lParam); - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - public static extern int SystemParametersInfo(uint uiAction, uint uiParam, string pvParam, uint fWinIni); - - [DllImport("user32.dll")] - public static extern int GetWindowRect(IntPtr hwnd, out Rect rect); - - [DllImport("user32.dll")] - public static extern bool SetLayeredWindowAttributes(IntPtr hwnd, uint crKey, byte bAlpha, uint dwFlags); - - [DllImport("user32")] - public static extern int MapWindowPoints(IntPtr hWndFrom, IntPtr hWndTo, [In, Out] ref Rect rect, [MarshalAs(UnmanagedType.U4)] int cPoints); - - [DllImport("user32")] - public static extern int MapWindowPoints(IntPtr hWndFrom, IntPtr hWndTo, [In, Out] ref System.Drawing.Point pt, [MarshalAs(UnmanagedType.U4)] int cPoints); - - [DllImport("gdi32.dll")] - public static extern bool BitBlt(IntPtr hObject, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hObjectSource, int nXSrc, int nYSrc, int dwRop); - - [DllImport("gdi32.dll")] - public static extern IntPtr CreateCompatibleBitmap(IntPtr hDC, int nWidth, int nHeight); - - [DllImport("gdi32.dll")] - public static extern IntPtr CreateCompatibleDC(IntPtr hDC); - - [DllImport("gdi32.dll")] - public static extern bool DeleteDC(IntPtr hDC); - - [DllImport("gdi32.dll")] - public static extern bool DeleteObject(IntPtr hObject); - - [DllImport("gdi32.dll")] - public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObject); - - [DllImport("user32.dll")] - public static extern IntPtr GetWindowDC(IntPtr hWnd); - - [DllImport("user32.dll")] - public static extern IntPtr ReleaseDC(IntPtr hWnd, IntPtr hDC); - - [DllImport("user32.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool PrintWindow(IntPtr hWnd, IntPtr hdc, int nFlags); - - [DllImport("user32.dll")] - public static extern IntPtr SetCursor(IntPtr hWnd); - - [DllImport("user32.dll")] - public static extern IntPtr WindowFromPoint(System.Drawing.Point p); - - [DllImport("user32.dll")] - public static extern IntPtr GetParent(IntPtr hWnd); - - [DllImport("user32.dll")] - public static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags); - - [StructLayout(LayoutKind.Sequential)] - public struct PerformanceInformation - { - public int cb; - public IntPtr CommitTotal; - public IntPtr CommitLimit; - public IntPtr CommitPeak; - public IntPtr PhysicalTotal; - public IntPtr PhysicalAvailable; - public IntPtr SystemCache; - public IntPtr KernelTotal; - public IntPtr KernelPaged; - public IntPtr KernelNonpaged; - public IntPtr PageSize; - public uint HandleCount; - public uint ProcessCount; - public uint ThreadCount; - } - - [StructLayout(LayoutKind.Sequential)] - public struct OSVersionInfoEx - { - public int dwOSVersionInfoSize; - public uint dwMajorVersion; - public uint dwMinorVersion; - public uint dwBuildNumber; - public uint dwPlatformId; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string szCSDVersion; - public ushort wServicePackMajor; - public ushort wServicePackMinor; - public ushort wSuiteMask; - public byte wProductType; - public byte wReserved; - } - - [StructLayout(LayoutKind.Sequential)] - public struct WindowPos - { - public IntPtr hwnd; - public IntPtr hwndInsertAfter; - public int x; - public int y; - public int cx; - public int cy; - public uint flags; - } - - [StructLayout(LayoutKind.Sequential)] - public struct Rect - { - public int Left, Top, Right, Bottom; - - public int Width => Right - Left; - public int Height => Bottom - Top; - } - - [StructLayout(LayoutKind.Sequential)] - public struct MonitorInfo - { - public uint cbSize; - public Rect rcMonitor; - public Rect rcWork; - public uint dwFlags; - - public void Init() - { - cbSize = (uint)Marshal.SizeOf(this); - } - } - - [Flags] - public enum SendMessageTimeoutFlags : uint - { - SMTO_NORMAL = 0x0, - SMTO_BLOCK = 0x1, - SMTO_ABORTIFHUNG = 0x2, - SMTO_NOTIMEOUTIFNOTHUNG = 0x8, - SMTO_ERRORONEXIT = 0x20 - } -}