You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current Microsoft.UI.Xaml.Window class in WinUI lacks convenience APIs such as Width, Height, and other essential properties that developers commonly use in XAML-based applications. Additionally, Window does not inherit from DependencyObject or UIElement, preventing developers from adding DependencyProperty to it. While simple or full properties can be added, they do not function as expected in XAML at runtime and only work once when the application launches. Given that these limitations have persisted for years, it is crucial to support for DependencyProperty to allow more flexibility in windowing scenarios.
After a few years, the convenience api for window were finally unveiled in v1.7-exp3, but everyone was disappointed. Because access to it was allowed through the AppWindow.
Therefore, it is better to provide a way for creating dependency property. So that developers can easily meet their own needs and not wait months for Disappointing features from Microsoft.
The text was updated successfully, but these errors were encountered:
My personal opinion on this is that this will never happen.
Logically, Microsoft.UI.Xaml.Window, which mirrors what is in Windows.UI.Xaml.Window, represents the window that contains the Xaml content. Because of this, Microsoft.UI.Xaml.Window is not a UIElement, it is the container for the root UIElement. I won't say much about DependencyObject, but considering that Window contains the XamlRoot then I am wondering if it could ever work.
Consider adding attached dependency properties. Create a static class WindowServices or something similar to that.
Since I originally come from a WPF world, I agree that this seems silly that Window does not derive from UIElement, but nobody asked me when they designed UWP's XAML.
Consider adding attached dependency properties. Create a static class WindowServices or something similar to that.
Since I originally come from a WPF world, I agree that this seems silly that Window does not derive from UIElement, but nobody asked me when they designed UWP's XAML.
you cant even use a AttachedProperty! If you use it you will encounter the following error:
Exception thrown: 'System.InvalidOperationException' in App17.dll
Exception thrown: 'Microsoft.UI.Xaml.Markup.XamlParseException' in WinRT.Runtime.dll
The text associated with this error code could not be found.
Failed to assign to property 'App17.FileName.IsTop'. [Line: 8 Position: 9]
The current Microsoft.UI.Xaml.Window class in WinUI lacks convenience APIs such as Width, Height, and other essential properties that developers commonly use in XAML-based applications. Additionally, Window does not inherit from DependencyObject or UIElement, preventing developers from adding DependencyProperty to it. While simple or full properties can be added, they do not function as expected in XAML at runtime and only work once when the application launches. Given that these limitations have persisted for years, it is crucial to support for DependencyProperty to allow more flexibility in windowing scenarios.
After a few years, the convenience api for window were finally unveiled in v1.7-exp3, but everyone was disappointed. Because access to it was allowed through the AppWindow.
Therefore, it is better to provide a way for creating dependency property. So that developers can easily meet their own needs and not wait months for Disappointing features from Microsoft.
The text was updated successfully, but these errors were encountered: