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!3 Replies
Do you use Commands?
Yeah. I actually just figured it out. The bound function takes a parameter and I hadn't defined the CommandParameter for them. Kind of annoying there isn't any feedback for that being the cause, though
✅ This post has been marked as answered!