question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Button IsEnabled property in Windows Platform

See original GitHub issue

Description

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

  1. Create a new Maui App
  2. Add a Grid and a StackLayout with two buttons
  3. Disable of the buttons by setting IsEnabled=“False”
  4. 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:closed
  • Created a year ago
  • Reactions:4
  • Comments:30 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
ascmtcommented, Oct 12, 2022

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.

4reactions
LuoyeAncommented, Sep 7, 2022

Need fix the issue asap, it also affects Android platform

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found