Attached Property Errors #10652
Labels
area-xaml
XAML, CSS, Triggers, Behaviors
platform/android 🤖
platform/windows 🪟
s/needs-info
Issue needs more info from the author
t/bug
Something isn't working
Description
I wanted to migrate a StackPanel containing a CollectionView from Xamarin to MAUI, unfortunately the two are quite different and you have to use a Grid instead of a StackPanel in MAUI. I suggested it would be nice to have a cleaner alternative a (see #10224) and @hartez was kind enough to point me to some sample code that did what I needed, experimenting with this revealed that Attached properties in XAML don't seem to work. It's possible I've missed something, since I've never tried to define an attached property before, but I'm pretty sure I followed the instructions.
Steps to Reproduce
Open up MainPage.xaml in Visual Studio, the page content is:
Uncomment the "Line 1" label and intellisense will show an error:
Compile the code and you will see the error:
On the face of it these would seem to be spurious errors, ColumnLayout.cs begins with:
Link to public reproduction project repository
https://github.com/david-maw/MauiAttached.git
Version with bug
6.0.486 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows
Affected platform versions
Android 11, Windows 10
Did you find any workaround?
Not for XAML, but the same thing can be done in code as the example demonstrates.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: