Closed DineshSolanki closed 1 year ago
report in original repo
for anyone else stumbling on this, you can fix #117 it by creating a custom window that extends HandyControl.Controls.Window and explicitly maps the default style key property to HandyControl.Controls.Window. Here's how the updated HandyWindow class looks:
namespace FoliCon.Modules;
public class HandyWindow : HandyControl.Controls.Window, IDialogWindow
{
static HandyWindow()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(HandyWindow),
new FrameworkPropertyMetadata(typeof(HandyControl.Controls.Window)));
}
public HandyWindow()
{
ShowTitle = true;
InitializeProperties();
Background = (System.Windows.Media.Brush)FindResource("RegionBrush");
}
public IDialogResult Result { get; set; }
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
InitializeProperties();
}
private void InitializeProperties()
{
if (DataContext is IDialogAware dialogAware)
{
Title = dialogAware.Title;
}
}
}
Describe the bug
I'm trying to show window/GlowWindow as PrismDialog parent in WPF, I followed this https://prismlibrary.com/docs/wpf/dialog-service.html#register-a-custom-dialog-window guide, and was able to make dialogService use hc:Window
however when I try to set window width, height or any property using (https://prismlibrary.com/docs/wpf/dialog-service.html#register-a-custom-dialog-window)
the titlebar disappears from window
this works with normal window, but not with hc:window/glowWindow
Steps to reproduce the bug
Create a class to register hc:window with prism dialog service
Expected behavior
The title bar should have displayed as is the case with normal window
Screenshots
with
without it
NuGet package version
None
IDE
Visual Studio 2022
Framework type
.Net 5.0
Windows version
Windows 11 (22000)
Additional context
No response