behaviors icon indicating copy to clipboard operation
behaviors copied to clipboard

Fix issues #22 and #25 (duplicates)

Open sdarveau opened this issue 4 years ago • 5 comments

Use an ObservableCollection instead of custom BindableObjectCollection. Since we need to specify a template parameter, VS is enable to resolve it correctly.

  • update version number to 1.4.1

sdarveau avatar Apr 02 '20 15:04 sdarveau

Thank you very much sdarveau, your fix is very useful and working perfectly for a long time. It looks like davidbritch is very busy and doesn't have time to check new issues, so we have no choice but to solve them on our own.

I recently updated VS 2019 to version 16.7.1 (because of apple account login issues, now it works) and got the following xaml error:

A value of type 'InvokeCommandAction' cannot be added to a collection or dictionary of type 'ObservableCollection`1'.

2020-08-14 10_01_40 devenv i9Y02MBcA4

Everything is compiling and working just fine with your fix, but this new xaml error is annoying. I am quite new to Xamarin and currently don't know how to fix this by myself. Can you give me some advice? Or just point me in the right direction, how I can solve this issue. Thanks.

gresolio avatar Aug 14 '20 08:08 gresolio

Hi @gresolio, I'm working on VS for mac (version 8.7.3) so I can't relate. Have you imported the Behaviors project into your solution so you can modify the code and see the effect instantly? Don't forget to add a reference to this project.

sdarveau avatar Aug 24 '20 19:08 sdarveau

Yes, I'm using Behaviours source files in my solution, with your fix on top ActionCollection => ObservableCollection<IAction>, not a NuGet package.

Strangely enough, after "Build/Clean Solution" and manually deleting all temporary project files, this xml syntax error disappears for a while, but then appears again.

Functionally nothing broke, the project compiles and works as before, it's just an annoying syntax error in the xaml editor.

Thanks for the answer. Hopefully, I will find some solution.

gresolio avatar Aug 25 '20 14:08 gresolio

Yeah this will solve the problem.

이미지 2

BOBx5 avatar Mar 09 '21 02:03 BOBx5

Thanks @BOBx5, it looks like returnType: typeof(ObservableCollection<IAction>) does the trick :)

But I took a different path and completely got rid of the XAML: I gradually rewrote the entire UI to C# Markup. Only positive impressions, I can recommend it 👍

gresolio avatar Mar 09 '21 09:03 gresolio