I am making a Xamarin Forms app, the solution is called RESTTest
, my shared project is called RestApp
.
In my shared project I have a folder called ViewModels
, which contains a class called MainViewModel.cs
I have a page called MainPage.xaml
which has a code-behind called MainPage.xaml.cs
. In my XAML I am trying to include my Viewmodels folder like this:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:RestApp"
x:Class="RestApp.MainPage"
xmlns:ViewModels="clr-namespace:RestApp.ViewModels;assembly=RestApp">
But when I add binding to my page like this:
<ContentPage.BindingContext>
<ViewModels:MainViewModel />
</ContentPage.BindingContext>
I am getting an unhandled exception:
Type ViewModels:MainViewModel not found in xmlns clr-namespace:RestApp.ViewModels;assembly=RestApp
What am I missing?