0

I downloaded prism5.exe from Microsoft and expanded it which left a variety of quick start projects. I simply opened the 'stock' BasicMVVMQuickstart_Desktop solution.

At first I received a 'couldn't find name in the namespace error' (on the same line as noted below, BTW), but after closing and reopening Visual Studio per one stack overflow post, I am now receiving this error:

Your views must implement IView

This is the XAML code and the line with the error:

enter image description here

I have referenced other stack overflow questions but still cannot resolve this.

One post suggested upgrading to Prism 6. I performed the only upgrade available in NuGet which updated Microsoft.Practices.Prism.Mvvvm to v 1.1.1.0.

I don't see Prism.Core anywhere in my project, so I'm guessing that's something about Visual Studio and packages that I don't quite understand. Anyway, I uninstalled Prism.Core 4.0 and then Installed Prism.Core 6.2, but since I don't see Prism.Core anywhere in Visual Studio I don't know if anything was changed.

So in addition to trying to understand how to remedy the error above, I'd also like to understand how I use Prism 6 instead of Prism 5. It's a little confusing to me.

Alan
  • 1,587
  • 3
  • 23
  • 43

2 Answers2

1

You are using an older version of Prism. I would (highly) recommend starting over with the latest bits from the Prism team. You can get that from the link below. There are plenty of samples to choose from, too. The documentation is up to date, which is always nice. This will be much easier than trying to upgrade the code you downloaded from Microsoft. There are plenty of breaking changes between that version and the latest.

Prism Library

Prism WPF Samples

You can get Prism from NuGet, too. Get one of the packages that have the IOC container already included, like Unity (Prism.Unity), or MEF (Prism.Mef). Just getting the Core package will leave much to be desired.

The packages with an IOC contain include all the dependencies (Prism.Core, Prism.Wpf, etc.) needed to get started. I am assuming you are doing a WFP application. I use the Unity version, and I would recommend that over the MEF version, because I found MEF to be interesting to troubleshoot. Go with what you like, though.

Good luck!

R. Richards
  • 24,603
  • 10
  • 64
  • 64
  • Good links. To make sure I understand, if I NuGet install prism.unity or.mef I will have everything I need to implement the prism framework for a given project. I was a little confused reading various places that called for different NuGet packages with different features - there are a lot of Prism packages in NuGet; it seemed piecemeal. >>> Also, I've had some difficulty reading the documentation. I downloaded a few different md file editors, but none seem to show the images. Do you have a suggested link for a good .md viewer/editor? – Alan Nov 25 '16 at 21:54
  • That is correct, the packages with an IOC include all the other packages you need; you can begin using the library without needing anything else afterward. As far as viewing the documentation, I just use my browser, nothing special. It would be nice to get the documentation in PDF or something like that. – R. Richards Nov 25 '16 at 22:03
  • Thx. Re documentation, I can open the files in IE/Chrome, but the images don't show. I see some kind of reference in the file, but it doesn't cause the image to import. I was hoping to find the right tool to open the pages with the embedded images. And yes, I agree, pdf is much nicer. The v5 doc is very useful. – Alan Nov 27 '16 at 22:33
  • Found at least one option for viewing downloaded prism 6 .md doc files and images; thought I'd wrap up this post. MarkdownPad.com has a freeware version that works OK for reading. The full purchase is very economical to get full features for editing. On Win 8 and up there is also a required upgrade SDK available at http://markdownpad.com/faq.html#livepreview-directx. – Alan Nov 28 '16 at 01:27
  • Thanks for the updates. I will check that out. Happy programming! – R. Richards Nov 28 '16 at 02:39
0

If you are using Prism 5 then just go to your view.xaml.cs and implement the interface IView. Like

public class MainWindow: Window, IView 
{...}

With Prism 6 (Prism.Wpf) nuget package, you don't need the IView implementation on your views

Jinish
  • 1,983
  • 1
  • 17
  • 22
  • That is so weird, because that's exactly what the MainWindow.xaml.cs already has in it, and I didn't put it there. – Alan Nov 24 '16 at 00:07