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.

Cannot assign property "Actions"

See original GitHub issue

Hi,

I’ve been using Behaviors without a problem until Xamarin.Forms v3.0. When I updated to Xamarin Forms v3.0, I got the below exception

Cannot assign property “Actions”: Property does not exist, or is not assignable, or mismatching type between value and property

MyView.xaml

  <ContentPage.Behaviors>
        <behaviors:EventHandlerBehavior EventName="Appearing">
            <behaviors:InvokeCommandAction Command="{Binding PageAppearingCommand}" />
        </behaviors:EventHandlerBehavior>
    </ContentPage.Behaviors>

MyViewModel.cs

public ICommand PageAppearingCommand => new Command(async () =>
{
    await PageAppearingAsync();
});

image

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
davidbritchcommented, May 14, 2018

A temporary fix, to unblock people, is to explicitly declare an ActionCollection around the actions:

<ListView x:Name="listView" ItemsSource="{Binding People}">
    <ListView.Behaviors>
        <behaviors:EventHandlerBehavior EventName="ItemSelected">
            <behaviors:ActionCollection>
                <behaviors:InvokeCommandAction Command="{Binding ItemSelectedCommand}" Converter="{StaticResource SelectedItemConverter}" />
                <behaviors:InvokeCommandAction Command="{Binding OutputAgeCommand}" Converter="{StaticResource SelectedItemConverter}" />
            </behaviors:ActionCollection>
        </behaviors:EventHandlerBehavior>
    </ListView.Behaviors>
</ListView>

In the meantime, I’ll work on fixing this.

4reactions
davidbritchcommented, May 14, 2018

This is now fixed, but I’m taking the opportunity to add a couple of extra bits of new functionality, so it’ll be the end of the week before updated source code/NuGet is pushed live.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot assign to property: 'actions' is a get-only property
I am making my first app and here is my biggest problem. I would like to make a notification in which i can...
Read more >
TypeError: can't assign to property "x" on "y": not an object
The JavaScript strict mode exception "can't assign to property" occurs when attempting to create a property on primitive value such as a symbol ......
Read more >
Cannot assign to property: "Example" is a get-only property
I'm working on an exercise app and have been running into the error "Cannot assign to property: "weightArray" is a get-only property".
Read more >
SOLVED: Cannot assign to property because the value ...
In the code snippet below I am trying to assign a value from the array activityDays to a variable and then use that...
Read more >
How to fix “Cannot assign to property: 'self' is immutable”
SwiftUI's views should be structs, which means they are immutable by default. If this were our own code we could mark methods using...
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