WJM
WJM

Reputation: 1191

Xaml Parsing Failed when subclassing ListView/GridView/ListBox

I am subclassing ListView in a Windows Universal App Project. I create a new UserControl in Visual Studio 2015 RC and then change the UserControl type to ListView in both XAML and codebehind.

When I insert the control and run the application I get a 'Xaml Parsing Failed' exception without any further information.

Upon researching I came across the issue where the project name contains a dot, but my project name does not contain such characters.

Any Idea how to research this further?

EDIT: I also tried subclassing ListView, GridView, ListBox and Itemscontrol. Itemscontrol does not generate the error but all others do.

EDIT 2:

  1. Created a new Universal App Project in VS2015 RC

  2. Add -> UserControl

  3. Changed Base Class into:

    public sealed partial class ListViewEx : ListView { public ListViewEx() { this.InitializeComponent(); } }

  4. Changed XAML UserControl tag into ListView

Upvotes: 0

Views: 377

Answers (1)

Der_Meister
Der_Meister

Reputation: 5007

The answer from MSDN forums: use themed control (custom control) for this case.

However, this approach works in WPF, it surprises me.

Upvotes: 1

Related Questions