Basic
Basic

Reputation: 26766

Unable to reference a design-time ViewModel in Xaml

I've done this before, but not for some time and clearly I'm missing something.

In short, I've got a design-time model that inherits from my real view model and sets some properties in the constructor.

I'm importing the namespace in Xaml and IntelliSense is suggesting the desired class name, which leads me to believe my naming is error-free.

Even after a clean/build, I'm getting an error saying that the referenced model doesn't exist.

I can refer to the model from a .cs using Aurora.UI.ViewModels.SecurityViewModel_DesignTime without issue.

(In case it matters, this project has a target of x64. This is due to a dependency on an bit-dependent library. It's the only real difference I can point to when comparing to previous implementations).

The name "SecurityViewModel_DesignTime" does not exist in the namespace "clr-namespace:Aurora.UI.ViewModels"

Screenshot showing xaml, project structure and exception

And the model itself:

namespace Aurora.UI.ViewModels {
    public class SecurityViewModel_DesignTime : SecurityViewModel {
        public SecurityViewModel_DesignTime() {
            this.Sensor = new Peripherals.Kinect();
            this.PrimaryFeed = Kinect.Feed.Infrared;
            Feeds = new List<Kinect.Feed> {Kinect.Feed.Infrared};
            this.LookDirections = 
                Peripherals.Kinect.DirectionsRequired.Front | 
                Peripherals.Kinect.DirectionsRequired.Left | 
                Peripherals.Kinect.DirectionsRequired.Right | 
                Peripherals.Kinect.DirectionsRequired.Top;

        }
    }
}

(The class it's inheriting from is the 'real' viewModel and is a simple POCO)

What am I missing?

Upvotes: 0

Views: 250

Answers (1)

Clint
Clint

Reputation: 6220

As per the comment, here's an answer:

Do a solution clean, and restart visual studio. Goodness knows why it works. The designer is janky at the best of times.

Upvotes: 3

Related Questions