0

As the title says, I moved my Xamarin Forms Views (XAML) to its own Project (Project.Forms.UI) so that I could keep the Project.Core clean and not have a dependency on the Xamarin.Forms nuget. The other reason is to that I can have multiple UI clients, which won't necessarily be Forms based, and also to asisst in white labeling the project.

Doing this has broken Intellisense in the XAML files for Visual Studio for Mac.

It works in Visual Studio 2017 for Windows, but obviously I'm on Mac.

Any ideas how to solve this?

RogerW
  • 476
  • 7
  • 9
  • 1
    I'd suggest to give a look on the forum for Visual Studio on Mac, I don't think that stackoverflow is a good place for this question – papafe Apr 11 '18 at 14:13
  • Thanks @markusian, I did actually, but nobody responded, so StackOverflow was my next option. I actually stumbled on the solution a moment ago and posted the solution below. I'll go back to the Xamarin Forums and do the same. – RogerW Apr 11 '18 at 18:26

2 Answers2

1

Found the problem. Now that my ViewModels and Views don't share the same assembly, you have to explicitly set there the ViewModels are found. That must have been what broke Intellisense for Visual Studio for Mac. In other words. changed the line:

xmlns:viewModels="clr-namespace:MyProject.Core.ViewModels;assembly=MyProject.Core"

<Mvx:MvxContentPage x:TypeArguments="viewModels:MyViewModel" 
xmlns:Mvx="clr-namespace:MvvmCross.Forms.Views;assembly=MvvmCross.Forms"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:viewModels="clr-namespace:MyProject.Core.ViewModels;assembly=MyProject.Core"
x:Class="MyProject.MyView">
<ContentPage.Content>
</ContentPage.Content>

RogerW
  • 476
  • 7
  • 9
0

Xamarin pretty often demonstrates "magic" I have experienced once something like what you describe. What I did back then is I've

  • excluded the files I moved from the project and physically moved them to another folder
  • manually added new Views with same names to the project
  • copy-pasted my content from old files to new ones

Have you tried something like that?

Sergey Ivanov
  • 109
  • 1
  • 4
  • It is not only about Xamarin but about the IDE as well. Sometimes a simple close / open of the IDE solves those kind of problems. – EvZ Apr 11 '18 at 14:51