I made a winui 3 Window class that's done right #11536
HO-COOH
started this conversation in
Show and tell
Replies: 3 comments 5 replies
|
Window is not a DependencyObject, which makes it unsuitable for use in conjunction with XAML. Currently, if anyone want to avoid these issues, the best approach is to |
0 replies
|
Absolutely amazing I love it, the I think we need to mention Jesse Collins (@JesseCol) since he is one of the engineers responsibile for WinUI window class, his feedback would be appreciated |
5 replies
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The WinUI 3's
Windowclass not being aDependencyObjecthas been long argued for bringing all sort of deficiencies.VisualStatesorx:Loadon any child, has to be transferred to aPageas root.ActualThemeproperty, meaning it need all sort of awkward workarounds for getting both the caption button color and backdrop theme in sync with the content themeExtendsContentIntoTitleBaronly settable in code-behindConverterunderWindow, see Can't use x:Bind with Converter in Window #4966Just to name a few that I am constantly bump into when I am developing winui3 apps. Other rationales include: #7305, #10358
I made a
WindowExclass that addressed most of these issues, by inheriting not fromWindowbutContentControl(that is in turn a DependencyObject if someone not aware), and store aWindowinstance as a member. All originalWindowmethod are routed to the memberWindowand allDependencyPropertyChangedcallbacks are handled as necessary. Confirmed running right now. Features documented here. You are welcomed to try it out and give any suggestions. Hoping the official team can address this one day.All reactions