AvaloniaMauiHybrid icon indicating copy to clipboard operation
AvaloniaMauiHybrid copied to clipboard

Using MAUI control causes build error: Error AVLN:0004 Avalonia: Unable to resolve suitable regular or attached property Name on type ZXing.Net.MAUI.Controls

Open gentledepp opened this issue 1 month ago • 2 comments

I am creating a POC and tried to:

  • use ZXIng.NET.MAUI as barcode reader on Android and IOS
  • and try to implement it somehow differently on Windows.

However, I cannot even get it to compile - once I add the MAUI control, I get a build error. Note: This does nothappen, if I use a built-in MAUI control such as "<mauiControls:Button />"

Am I doing anything wrong here?

Repro is available here: https://github.com/gentledepp/POC_AvaloniaMauiApp01/tree/repro/mauicontrol

Just try to compile, and you will get: image

gentledepp avatar May 03 '24 08:05 gentledepp

You can't have a x:Name on non-Avalonia controls. That's expected for now.

As a workaround, you can add x:Name on a host control, and get child from it in c# code.

maxkatz6 avatar May 03 '24 20:05 maxkatz6

oops... did I overread something? Or shall I add a PR to get this into the docs?

Also: I am working on an extended DI sample - which I could share as a PR with the Avalonia UI general docs (as there is a doc for DI already, but it is too basic for some cases)

And I am working on a sample on how to run MauiHybrid with iOS and Windows side-by-side. (i.e. having Maui controls for iOS and Android, but using Avalonia-only controls for Windows)

Should I share that here or in the AvaloniaUI docs?

gentledepp avatar May 06 '24 06:05 gentledepp