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

Detect invalid Reference bindings #502

Open
mrlacey opened this issue Dec 23, 2021 · 0 comments
Open

Detect invalid Reference bindings #502

mrlacey opened this issue Dec 23, 2021 · 0 comments
Labels
Xamain.Forms Relates to XAML in Xamarin.Forms projects XAML-Analysis Relates to XAML Analysis functionality
Milestone

Comments

@mrlacey
Copy link
Owner

mrlacey commented Dec 23, 2021

Consider the following in a Xamarin.Forms project:

    <shrp:MaterialFrame
         x:Name="Blurer"
         Padding="0"
         AndroidBlurRadius="10"
         AndroidBlurRootElement="{Binding Source={x:Reference GridContainer}}"
         CornerRadius="0"
         IsClippedToBounds="False"
         MaterialBlurStyle="Dark"
         MaterialTheme="AcrylicBlur"
         StyleId="5555" />

If GridContainer does not exist, the code will build and run fine but will result in a vague, unhelpful, runtime error when navigating to the page with this content:

System.Reflection.TargetInvocationException
Message=Exception has been thrown by the target of an invocation.

There is no more information provided. It's just down to the developer to work out what went wrong.
Adding detection for this can save lots of wasted time.

Note. This may not apply to just XF projects.

@mrlacey mrlacey added XAML-Analysis Relates to XAML Analysis functionality Xamain.Forms Relates to XAML in Xamarin.Forms projects labels Dec 23, 2021
@mrlacey mrlacey added this to the Backlog milestone Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Xamain.Forms Relates to XAML in Xamarin.Forms projects XAML-Analysis Relates to XAML Analysis functionality
Projects
None yet
Development

No branches or pull requests

1 participant