[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

WPF - The Design view cannot display correctly because some custom elements have not yet been built.

Posted on 2015-02-03
7
Medium Priority
?
997 Views
Last Modified: 2015-02-13
Hi Experts,
I've got a working WPF application that has this error from my xaml file.  

I have one warning in the xaml that I think is the cause:
DataType="{x:Type local:MyGroupViewModel}"

The namespace I imported at the top is the following:
xmlns:local="clr-namespace:MyApplication.ViewModels"

MyGroupViewModel most definitely is part of the MyApplication.ViewModels (otherwise the app wouldn't work).  This class has a default constructor, however, it's default constructor does have a base-class initializer like so:
public MyGroupViewModel () : base(null, true) { }

Is the problem potentially the call to base?  What else could I be missing?

Thank you,
Mike
0
Comment
Question by:thready
  • 4
  • 2
7 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40588784
Does that class have a default constructor?

public MyGroupViewModel()
{
}
0
 
LVL 25

Expert Comment

by:apeter
ID: 40590104
Syntax wise it looks okie but why u want to pass null,true always. Instead you have avoid this and hard code null and true in your base class.

for testing wise..if you remove the base initialization, is the application working ?

what exactly is your error message ?
0
 
LVL 1

Author Comment

by:thready
ID: 40590264
It does have a default constructor - wouldn't the following be considered a default constructor?
public MyGroupViewModel () : base(null, true) { }

In any case - I removed the need to call the base constructor and now it's just public MyGroupViewModel() {}

The warning I'm getting the the xaml file is:
"The name "MyGroupViewModel" does not exist in the namespace "clr-namespace:MyApplication.ViewModels"

But it does.  Or it wouldn't work right?

Mike
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 25

Expert Comment

by:apeter
ID: 40592465
is the view model coming from a referenced dll ? then you need to specify the assembly name.

And hope there is no duplicate class you have.
0
 
LVL 1

Author Comment

by:thready
ID: 40592483
Nope, it's part of the wpf project.  No duplicate class either... :-(
0
 
LVL 1

Accepted Solution

by:
thready earned 0 total points
ID: 40597327
I was finally able to fix this by changing

this:
DataType="{x:Type local:MyGroupViewModel}"

to this:
DataType="local:MyGroupViewModel"
0
 
LVL 1

Author Closing Comment

by:thready
ID: 40607525
This was the only thing that worked for me
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question