Hi @TS44
You have to set this in your App.xaml.cs
using Xamarin.Forms.Xaml;
...
[assembly: XamlCompilation (XamlCompilationOptions.Compile)]
namespace mynamespace
{
...
}
then you have to Use the x:DataType attribute to provide the data type of the binding context of a VisualElement.
for example:
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:viewmodels="clr-namespace:mynamespace"
x:Class="mynamespace.MainPage"
x:DataType="{x:Type viewmodels:MyPageViewModel}">
<ContentPage.BindingContext>
<viewmodels:MyPageViewModel />
</ContentPage.BindingContext>
<Label Text="{Binding MyValue}" />
</ContentPage>