Button IsEnabled property in Windows Platform
See original GitHub issueDescription
When I set up the Button’s “IsEnabled” property, programmatically. The expected behavior is working in all platforms. However, the formatting of the button in the Windows Platform gets lost after a couple of changes. In the Android platform it works as expected.
Steps to Reproduce
- Create a new Maui App
- Add a Grid and a StackLayout with two buttons
- Disable of the buttons by setting IsEnabled=“False”
- Add code to programmatically change the is enabled property.
<Grid BackgroundColor="Black">
<StackLayout Orientation="Horizontal" HorizontalOptions="Center">
<Button x:Name="btn1" Text="Start" WidthRequest="100" Background="Green" Clicked="btn1_Clicked"></Button>
<Button x:Name="btn2" Text="Stop" WidthRequest="100" Background="Green" Clicked="btn2_Clicked" IsEnabled="False"></Button>
</StackLayout>
</Grid>
private void btn1_Clicked(object sender, EventArgs e)
{
btn1.IsEnabled = false;
btn2.IsEnabled = true;
}
private void btn2_Clicked(object sender, EventArgs e)
{
btn1.IsEnabled = true;
btn2.IsEnabled = false;
}
5.Click on the buttons a couple of times to enable and disable them. After the first cycle both buttons will look disabled. the functionality will still be working but it is confusing for the user. This only happens in windows, not in Android or IOS.
Version with bug
Release Candidate 3 (current)
Last version that worked well
Release Candidate 3 (current)
Affected platforms
Windows
Affected platform versions
Windows 11
Did you find any workaround?
No
Relevant log output
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:30 (7 by maintainers)
Top Results From Across the Web
Control.IsEnabled Property (Windows.UI.Xaml.Controls)
Gets or sets a value indicating whether the user can interact with the control.
Read more >UIElement.IsEnabled Property (System.Windows)
Gets or sets a value indicating whether this element is enabled in the user interface (UI). This is a dependency property.
Read more >VisualElement.IsEnabled Property (Microsoft.Maui.Controls)
Definition. Gets or sets a value indicating whether this element is enabled in the user interface. This is a bindable property.
Read more >Control.IsEnabled Property (System.Windows.Controls)
When IsEnabled is false, a control cannot have focus or receive input events, such as MouseLeftButtonDown. A control inherits the IsEnabled ...
Read more >VisualElement.IsEnabled Property (Xamarin.Forms)
Gets or sets a value indicating whether this element is enabled in the user interface. This is a bindable property.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
When is this issue going to be addressed? This issue is now 5 months, is a major piece of broken functionality on Windows, no known workaround, no official response, and sits unassigned and with no milestone. For all practical purposes this is looks like a WNF, the silence is speaking volumes.
Need fix the issue asap, it also affects Android platform