I am building a WPF application. I have two projects in my solution folder. One project is a WPF application which has a view, viewmodel and model class. 2nd project is a class library which has a view, vm and model class. I have added a reference of Project 2(class library) in project 1(wpf app) and I am able to access the contents of class.
But when I want to access the contents of class which belongs to Project 1(wpf app) in my project 2(class library) ViewModel, it throws me an error “A type or namespace”xxxxx” could not be found”
I want to access the member of all 3 classes(view,vm and model). Please help!!!!
If understand well the question, it seems to me that you want to make circular reference, which is not possible. One approach should be referencing from A to B direct, and reflection from B to A. But the is a smarter choice, extract all common classes into a shared assembly which is referenced by both projects.
Check this link out . But reflection is time consuming and slow, you should check the second approach, its more elegant.