0

I know, someone asked here but rules here don't allow me to ask questions in comments, so I make second topic to ask if someone changed? Anyone know anything about that?

Now.

  1. Installed Visual Studio 2017.
  2. Created new WPF project.
  3. Installed the Mvvm Light 5.3.0 package.
  4. Tried to compile and: Error list

I can choose it (!):

List

So, I've tried:

  • First link - it didn't work, tried both of them, still same error.
  • Second link - it didn't work too, I don't have app on network use. I checked also all of namespace names and rebuilded and rebooted pc and reopened visual studio
  • Third link - this link doesn't matter, becouse I can't compile solution.
  • Fourth link - also opened with admin rights.
  • Fifth link - changing platform didn't take effect.
  • Sixth link - all fields etc. were checked.

For additional information, I downloaded some of free MVVM light examples from google and NONE of them worked.

Code (I post it here only because last time I asked this question it was the problem with no source code included):

ViewModelLocator.cs basic for Mvvm light

using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Ioc;
using Microsoft.Practices.ServiceLocation;

namespace MLXI.ViewModel
{
    public class ViewModelLocator
    {
        public ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            SimpleIoc.Default.Register<MainViewModel>();
        }

        public MainViewModel Main
        {
            get
            {
                return ServiceLocator.Current.GetInstance<MainViewModel>();
            }
        }

        public static void Cleanup()
        {
            // TODO Clear the ViewModels
        }
    }
}

And MainViewModel.cs basic for MvvmLight

using GalaSoft.MvvmLight;

namespace MLXI.ViewModel
{
    public class MainViewModel : ViewModelBase
    {
        public MainViewModel()
        {

        }
    }
}

MainWindow.xaml

<Window x:Class="MLXI.MainWindow"
        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:local="clr-namespace:MLXI"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Grid>

    </Grid>
</Window>

I really just wanted to make simple app in WPF. Anyone has any idea?

Yelhigh
  • 45
  • 7
  • 1
    "I really just wanted to make simple app in WPF". You don't need MvvmLight for that purpose. Just write your own ViewModelBase class that implements the INotifyPropertyChanged interface and provides a NotifyPropertyChanged method. – Clemens Jul 06 '17 at 08:40
  • it seems you've not declared namespace `vm` – Lei Yang Jul 06 '17 at 08:44
  • You have the MLXI namespace declared as `local` (xmlns:local="clr-namespace:MLXI"), not `vm` – Grant Thomas Jul 06 '17 at 08:46

0 Answers0