New to MVVM from scratch, and I am hitting the frustrating error of:
The name "MainWindowViewModel" does not exist in the namespace "clr-namespace:Data_version_3.ViewModels.MainWindowViewModel".
But the project builds, and works, I just cannot see the window to be able to make amendments to the design, as it advises there is an error.
The salient XAML is:
<Window x:Class="Data_version_3.MainWindow"
WindowStartupLocation="CenterScreen"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
dx:ThemeManager.Theme="Office2010Black"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Data_version_3.ViewModels.MainWindowViewModel"
mc:Ignorable="d"
Title="GG Data import tool"
WindowState ="Maximized"
Icon="./Images/GG.ico"
KeyDown="OnButtonKeyDown">
<Window.DataContext>
<vm:MainWindowViewModel/>
</Window.DataContext>
And my view model:
namespace Data_version_3.ViewModels.MainWindowViewModel
{
public class MainWindowViewModel:RelayCommand
{
Web w = null;
public Excel ex = null;
public Report rp = null;
public Helpers he = null;
SQLThings.Data da = null;
public Logging lg = new Logging();
public MainWindowViewModel()
{
he = new Helpers(this);
w = new Web(this);
ex = new Excel(this);
da = new SQLThings.Data(this);
rp = new Report(this);
}
Have seen a number of posts about this, including:
The name does not exist in the namespace error in XAML
But unfortunately this has not worked. Have tried cleans and rebuilds, closing and opening etc. All the IT favourites, to no avail, so I am guessing it is something I am missing. Any help appreciated.
Edit - Just in case it has any relevance, I am using VS 2015