From d2b311d192a9b520349f2e07124e6283c4867b11 Mon Sep 17 00:00:00 2001 From: michaelpduda Date: Fri, 7 Jun 2024 18:46:36 -0700 Subject: [PATCH 1/5] Fixes fullscreen window styling --- source/UpbeatUI/View/UpbeatMainWindow.xaml | 25 ---------------------- 1 file changed, 25 deletions(-) diff --git a/source/UpbeatUI/View/UpbeatMainWindow.xaml b/source/UpbeatUI/View/UpbeatMainWindow.xaml index a79e0eb..c4cbed9 100644 --- a/source/UpbeatUI/View/UpbeatMainWindow.xaml +++ b/source/UpbeatUI/View/UpbeatMainWindow.xaml @@ -14,31 +14,6 @@ d:DesignHeight="500" d:DesignWidth="500"> - - - From 71f28941dd0a84e5fe6abef5e4fc1bf7530ca756 Mon Sep 17 00:00:00 2001 From: michaelpduda Date: Fri, 7 Jun 2024 18:47:05 -0700 Subject: [PATCH 2/5] Adds convenience DependencyProperty for Fullscreen to UpbeatMainWindow --- source/UpbeatUI/View/UpbeatMainWindow.xaml.cs | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/source/UpbeatUI/View/UpbeatMainWindow.xaml.cs b/source/UpbeatUI/View/UpbeatMainWindow.xaml.cs index b1ee655..5bc3a01 100644 --- a/source/UpbeatUI/View/UpbeatMainWindow.xaml.cs +++ b/source/UpbeatUI/View/UpbeatMainWindow.xaml.cs @@ -13,6 +13,16 @@ namespace UpbeatUI.View /// public partial class UpbeatMainWindow : Window { + /// + /// Identifies the . + /// + public readonly static DependencyProperty FullscreenProperty = + DependencyProperty.Register( + "Fullscreen", + typeof(bool), + typeof(UpbeatMainWindow), + new FrameworkPropertyMetadata(false, HandleFullscreenPropertyChanged)); + /// /// Identifies the . /// @@ -35,6 +45,15 @@ public partial class UpbeatMainWindow : Window public UpbeatMainWindow() => InitializeComponent(); + /// + /// Gets or sets whether the is in fullscreen mode or not. + /// + public bool Fullscreen + { + get => (bool)GetValue(FullscreenProperty); + set => SetValue(FullscreenProperty, value); + } + /// /// Gets or sets a that the will show underneath the top (active) Element. /// @@ -52,5 +71,24 @@ public BlurEffect ModalBlurEffect get => (BlurEffect)GetValue(ModalBlurEffectProprety); set => SetValue(ModalBlurEffectProprety, value); } + + private static void HandleFullscreenPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (d is UpbeatMainWindow upbeatMainWindow) + { + if (upbeatMainWindow.Fullscreen) + { + upbeatMainWindow.ResizeMode = ResizeMode.NoResize; + upbeatMainWindow.WindowStyle = WindowStyle.None; + upbeatMainWindow.WindowState = WindowState.Maximized; + } + else + { + upbeatMainWindow.WindowState = WindowState.Normal; + upbeatMainWindow.WindowStyle = WindowStyle.SingleBorderWindow; + upbeatMainWindow.ResizeMode = ResizeMode.CanResize; + } + } + } } } From e4bc6ddb471273c15fd391f7cee6c3b6ac539945 Mon Sep 17 00:00:00 2001 From: michaelpduda Date: Fri, 7 Jun 2024 18:47:13 -0700 Subject: [PATCH 3/5] Adds fullscreen toggle to samples --- samples/HostedUpbeatUISample/View/MenuTemplate.xaml | 3 +++ samples/ManualUpbeatUISample/View/MenuTemplate.xaml | 3 +++ samples/ServiceProvidedUpbeatUISample/View/MenuTemplate.xaml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/samples/HostedUpbeatUISample/View/MenuTemplate.xaml b/samples/HostedUpbeatUISample/View/MenuTemplate.xaml index 9ec24c2..9fe4c7a 100644 --- a/samples/HostedUpbeatUISample/View/MenuTemplate.xaml +++ b/samples/HostedUpbeatUISample/View/MenuTemplate.xaml @@ -44,6 +44,9 @@ + Fullscreen Shared List + Fullscreen Shared List + Fullscreen Date: Sat, 8 Jun 2024 10:22:56 -0700 Subject: [PATCH 4/5] Adds property to control content margin when fullscreen --- source/UpbeatUI/View/UpbeatMainWindow.xaml | 14 +++++++++++++ source/UpbeatUI/View/UpbeatMainWindow.xaml.cs | 21 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/source/UpbeatUI/View/UpbeatMainWindow.xaml b/source/UpbeatUI/View/UpbeatMainWindow.xaml index c4cbed9..31a7347 100644 --- a/source/UpbeatUI/View/UpbeatMainWindow.xaml +++ b/source/UpbeatUI/View/UpbeatMainWindow.xaml @@ -14,6 +14,20 @@ d:DesignHeight="500" d:DesignWidth="500"> + + + diff --git a/source/UpbeatUI/View/UpbeatMainWindow.xaml.cs b/source/UpbeatUI/View/UpbeatMainWindow.xaml.cs index 5bc3a01..be22ca3 100644 --- a/source/UpbeatUI/View/UpbeatMainWindow.xaml.cs +++ b/source/UpbeatUI/View/UpbeatMainWindow.xaml.cs @@ -23,6 +23,16 @@ public partial class UpbeatMainWindow : Window typeof(UpbeatMainWindow), new FrameworkPropertyMetadata(false, HandleFullscreenPropertyChanged)); + /// + /// Identifies the . + /// + public readonly static DependencyProperty FullscreenContentMarginProperty = + DependencyProperty.Register( + "FullscreenContentMargin", + typeof(Thickness), + typeof(UpbeatMainWindow), + new FrameworkPropertyMetadata(new Thickness(0))); + /// /// Identifies the . /// @@ -54,6 +64,17 @@ public bool Fullscreen set => SetValue(FullscreenProperty, value); } + /// + /// Gets or sets the 's content margin when in fullscreen mode. + /// Under certain styling conditions and when in fullscreen mode, the content might be rendered outside the visible area of the screen. This property allows you to counteract that behavior by adding margin to the content to shrink its rendered size (or subtracting margin to increase the rendered size). + /// This property has no effect when in windowed (non-fullscreen) mode. + /// + public Thickness FullscreenContentMargin + { + get => (Thickness)GetValue(FullscreenContentMarginProperty); + set => SetValue(FullscreenContentMarginProperty, value); + } + /// /// Gets or sets a that the will show underneath the top (active) Element. /// From b8a3198691830a7a69da7b110016d2ad83504eef Mon Sep 17 00:00:00 2001 From: michaelpduda Date: Sat, 8 Jun 2024 10:25:33 -0700 Subject: [PATCH 5/5] Updates versions for release candidate --- .../UpbeatUI.Extensions.DependencyInjection.csproj | 2 +- .../UpbeatUI.Extensions.Hosting.csproj | 2 +- source/UpbeatUI/UpbeatUI.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/UpbeatUI.Extensions.DependencyInjection/UpbeatUI.Extensions.DependencyInjection.csproj b/source/UpbeatUI.Extensions.DependencyInjection/UpbeatUI.Extensions.DependencyInjection.csproj index 88c13b8..3f6431c 100644 --- a/source/UpbeatUI.Extensions.DependencyInjection/UpbeatUI.Extensions.DependencyInjection.csproj +++ b/source/UpbeatUI.Extensions.DependencyInjection/UpbeatUI.Extensions.DependencyInjection.csproj @@ -22,7 +22,7 @@ © Michael P. Duda 2020-2024 MIT - 2.2.0-rc1 + 2.2.0-rc2 2.1.0 diff --git a/source/UpbeatUI.Extensions.Hosting/UpbeatUI.Extensions.Hosting.csproj b/source/UpbeatUI.Extensions.Hosting/UpbeatUI.Extensions.Hosting.csproj index 67bee0a..0e828d3 100644 --- a/source/UpbeatUI.Extensions.Hosting/UpbeatUI.Extensions.Hosting.csproj +++ b/source/UpbeatUI.Extensions.Hosting/UpbeatUI.Extensions.Hosting.csproj @@ -22,7 +22,7 @@ © Michael P. Duda 2020-2024 MIT - 4.2.0-rc1 + 4.2.0-rc2 4.1.0 diff --git a/source/UpbeatUI/UpbeatUI.csproj b/source/UpbeatUI/UpbeatUI.csproj index 83fa869..bf4fc67 100644 --- a/source/UpbeatUI/UpbeatUI.csproj +++ b/source/UpbeatUI/UpbeatUI.csproj @@ -23,7 +23,7 @@ © Michael P. Duda 2020-2024 MIT - 5.2.0-rc1 + 5.2.0-rc2 5.1.0