sourcechord / FluentWPF

Fluent Design System for WPF.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WindowStyle None + Enable Transparency true= Exception

TMS-Namespace opened this issue · comments

commented

After upgrading to stable, started getting the exception that above two properties should be on together, although they are indeed both on:

System.InvalidOperationException: 'WindowStyle.None is the only valid value for WindowStyle when AllowsTransparency is true.'

This happens in AcrylicWindow.cs at line:

else if (msg == WM_SIZE && wParam == (IntPtr)SizeEvents.SIZE_RESTORED) { var win = (Window)HwndSource.FromHwnd(hwnd).RootVisual; if (win != null && _internalStateTable.TryGetValue(win, out var internalState)) { win.ClearValue(WindowStyleProperty);

Reverting back only this file to alpha version, removes the exception again.
This happens with .Net core 3.1, Win10.

Thanks for the feedback.
I can reproduce it. But, I think that AllowsTransparency is unnecessary in AcrylicWindow.
What's the porpose of using AllowsTransparency="True"?

yeah,I think AllowsTransparency="True" is very necessary when I hide current window

commented

@sourcechord I was trying to make rounded corners window… then allow transparency is needed.

I see 😃
You mean about the comments of following issue?
#111 (comment)
I recognized it, and trying to fix it.
But there is some known issues; acrylic effect is applied to whole window region.

commented

@sourcechord yes I am aware of that issue with rounded corners..

Another note/use case, not sure if it is feasible, opacity dose not work with acrylic, so it is not possible to apply storyboard animation that manipulates it unfortunately…