Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error in MAUI app when using x:Bind with the Vapolia.MauiGesture library #27

Closed
tranb3r opened this issue May 10, 2023 · 2 comments

Comments

@tranb3r
Copy link

tranb3r commented May 10, 2023

Hi,

In a MAUI app, I've managed to use x:Bind pretty much everywhere I need it.
Except when the binding is for a LongPressCommand (from the https://github.com/vapolia/MauiGestures lib).

Here is a link to a simple repro project: repro

Here is the code that triggers a build error:

<?xml version="1.0" encoding="utf-8" ?>
<Button
    x:Class="MauiAppTestCompiledBindings.MyButton"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:MauiAppTestCompiledBindings"
    xmlns:mauiGestures="clr-namespace:MauiGestures;assembly=MauiGestures"
    mauiGestures:Gesture.LongPressCommand="{x:Bind ClickCommand}"
    x:DataType="local:MainViewModel"
    Text="Click me" />

Here is the build error message:

error CS1503: Argument 1: cannot convert from 'MauiAppTestCompiledBindings.MyButton.MyButton_Bindings_this' to 'Microsoft.Maui.Controls.BindableObject'

Could you please take a look and tell me if you think this is something that can be fixed, either in my code, or in the CompiledBindings library, or in the MauiGesture library?

Thank you!

@levitali
Copy link
Owner

levitali commented May 11, 2023

Unfortunately, it’s a bug in the CompiledBindings library.

I’ve uploaded a new Version of the MAUI nuget. So far as beta. The problem should be solved.

You should restart Visual Studio after upgrading the nuget. At least on my computer still the old version is used.

Thank you for reporting the issue!

@tranb3r
Copy link
Author

tranb3r commented May 11, 2023

Wow! That was fast...
Thanks a lot :)

@tranb3r tranb3r closed this as completed May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants