C#C
C#4y ago
SirDigby

WinUI3 - Button always disabled [Answered]

I'm writing a desktop app using .Net 6.0 and WinUI3. I initially created the project using Template Studio for WinUI.

I've run into an issue where some buttons (Microsoft.UI.Xaml.Controls.Button) are getting disabled for no apparent reason. There is nothing in the xaml or code-behind that changes the IsEnabled property, and even if I do set it explicitly to true they stay disabled. By watching the IsEnabledChanged event I can see something is setting the value to
false
but the callstack just has methods from the WinUI library.

Any ideas for how to fix this or how to better diagnose what may be the cause would be appreciated. Thanks!
unknown.png
Was this page helpful?