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.

[ToolbarItem] IsEnabled property false not working

See original GitHub issue

Description

The button bar is not disable when set IsEnable to false

Steps to Reproduce

<app:BasePage.ToolbarItems>
        <ToolbarItem
            Command="{x:Binding OpenUrlCommand}"
            CommandParameter="{x:Binding ControlGroup.MicrosoftStoreLink}"
            IconImageSource="{x:StaticResource MicrosoftStoreIcon}"
            IsEnabled="False"
            Text="Source code" />
        <ToolbarItem
            Command="{x:Binding OpenUrlCommand}"
            CommandParameter="{x:Binding ControlGroup.ProviderUrl}"
            IconImageSource="{x:StaticResource InfoIcon}"
            Text="Original Document" />
    </app:BasePage.ToolbarItems>

Link to public reproduction project repository

https://github.com/Strypper/mauisland

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, Windows

Affected platform versions

Windows 11 - Android 12

Did you find any workaround?

No

Relevant log output

None

Issue Analytics

  • State:open
  • Created 7 months ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
SF-Simoncommented, Mar 11, 2023

System.InvalidOperationException:“The BindableProperty "IsEnabled" is readonly.”

        <MenuBarItem Text="Locations">
            <MenuFlyoutItem
                Command="{Binding AddLocationCommand}"
                IsEnabled="false"
                Text="Add Location" />
        </MenuBarItem>

image

Direct crash, read only? However, the document and code both display {get; set;}.

Is MAUI a toy? Can’t complete any complicated work. The response to the problem and the update speed are extremely slow, which is really frustrating.

0reactions
SF-Simoncommented, Mar 11, 2023

System.InvalidOperationException:“The BindableProperty "IsEnabled" is readonly.”


        <MenuBarItem Text="Locations">

            <MenuFlyoutItem

                Command="{Binding AddLocationCommand}"

                IsEnabled="false"

                Text="Add Location" />

        </MenuBarItem>

image Direct crash, read only? However, the document and code both display {get; set;}. Is MAUI a toy? Can’t complete any complicated work. The response to the problem and the update speed are extremely slow, which is really frustrating.

Are you getting a crash when it’s set to False? For me it just stays enabled but doesn’t crash

If I start the project without debugging mode, I will exit directly. (This is collapse, right?) If I use debug mode, I will give a more detailed error, which is the error mentioned above.

I didn’t actually release the project. I originally wanted to transplant my software from MacOS. After studying for about 7 days, I found a lot of unpleasant places. And no matter how you ask people, it’s like talking to a tree hole

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin Forms ToolbarItem doesn't change IsEnabled ...
If you just set IsEnabled property of a toolbar item in your XAML to false or true, you will get the following exception...
Read more >
ToolbarItem - Want to display based on certain conditions
The quickest way I have found for achieving this is by using ToolbarItems.RemoveAt(0) to not display it and ToolbarItems.Add(ToolbarText) to ...
Read more >
ToolbarItems - Want to be able to Display/Not ...
ToolbarItem isEnabled property is available in xaml, not code. I have a form where a user can enter some data and save it...
Read more >
Xamarin Forms ToolbarItem doesn't ... - appsloveworld.com
If you just set IsEnabled property of a toolbar item in your XAML to false or true, you will get the following exception...
Read more >
Custom toolbar item enable property not working
In Creator V2 you will need to create action and set it enabled property to true/false. JavaScript. var action = new ActionBarItem({}); action....
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