Forum Xamarin.Forms

I've added XamlCompilation annotation but invalid XAML isn't being flagged by compiler

DevologyDevology GBMember ✭✭✭
edited June 2016 in Xamarin.Forms

I've added the annotation in each of my xaml code-behind files, i.e.

[XamlCompilation (XamlCompilationOptions.Compile)]

I was expecting any bindings that were invalid to cause a build error, but it doesn't...

<Label Text="{Binding WelcomeTextWobble}" Style="{StaticResource HeadingStyle}" />

However the binding 'WelcomeText' exists, but 'WelcomeTextWobble' doesn't and I get no build errors.

Here's How I've added the compilation annotation...

using System;
using System.Collections.Generic;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Apollo1.Presentation
{
    [XamlCompilation (XamlCompilationOptions.Compile)]
    public partial class WelcomePage : BasePage
{
        public WelcomePage ()
    {
        InitializeComponent ();
    }
}
}

What am I missing to cause the XAML compilation to detect invalid bindings?

Best Answer

Answers

  • DevologyDevology GBMember ✭✭✭

    No it doesn't, it's a feature :smile:

    Damn, that would be so much more useful if it did! ;-)

  • NMackayNMackay GBInsider, University mod

    @Devology

    Yeah, takes a bit of getting used to if you've not come from a WPF/Silverlight background.

Sign In or Register to comment.