Illegal Qualified Name Character Error

May 6, 2013 at 5:20 PM
Creating a Windows 8 application using your library. It gives me familiarity with Windows.Interactions since I've done a ton Silverlight development and I wish to continue using MVVM.

Whenever I use your library, it causes the entire control to containing the following statement to become highlighted in blue with this error, "Illegal qualified name character."
<common:LayoutAwarePage ...
                        xmlns:i="using:WinRT.Triggers">
<Button Content="Submit">
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Click">
            <i:InvokeCommandAction Command="{Binding InvokeCommand}"
                                   CommandParameter="{Binding}" />
        </i:EventTrigger>
    </i:Interaction.Triggers>
</Button>
I've seen this before in Silverlight and the way I fixed it was to paste the code into Notepad and see if there are invisible characters anywhere. This is not the case, I can replicate it 100% of the time.

The issue seems to stem from "EventName." I cannot tell what the issue is and I've peeked at the source code and it looks good. If I comment out the "EventName" and "InvokeCommandAction" then the issue goes away.

This is a problem because controls stop to render and I cannot preview the controls using the supplied design data.

Windows 8 Application
Visual Studio 2012

(Thoughts or Workarounds?)
Coordinator
May 6, 2013 at 5:38 PM
Hi there - thanks for reporting this.

I'm still not 100% sure, but I think the designer is misreporting an error - where I've seen this reported before, everything works at runtime, it's just broken at design time. Is this the case for you?

This blog post describes what you seem to be seeing - is moving the triggered parts of your page into a separate user control an option?

Mike
May 6, 2013 at 7:15 PM
Ah! That blog post EXACTLY describes the issue!

I've tried moving the offending code to a DataTemplate but that doesn't work. The only solution would be moving the code to a user control but that would substantially inflate the code. I don't prefer this method because I am using this pattern is many different places.

I'll continue to try to find a workaround. Thanks for the speedy reply.
Coordinator
May 6, 2013 at 7:34 PM
Let me know how you get on, because it really is a pain... (I'll look into it again if I can grab some time!)

Thanks
Mike
May 6, 2013 at 7:40 PM
Also as another note, the user control isn't a viable option because the template references a view model which is out of scope of the data template. Because of this it makes it very hard to use content controls unless I want to deal with passing the View Model from content control to content control. And I agree, this really is a pain. It works, just lack of support from the designer.

Thanks for the speediness and I'll update this if I find a workaround.