Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to setup bindingcontext in xaml?

Hello,

I usualy setup the binding in the view in this way:

_viewModel = new UserPageViewModel(mgr);
BindingContext = _viewModel;

What is the same command in the xaml?

The following is not working:

Can someone help?

Tagged:

Best Answer

Answers

  • russferns22russferns22 Member ✭✭
    edited September 2018

    @chris00r add the following lines of code to your views xaml and carry out your binding

    <ContentPage.BindingContext>
        <ViewModel:className/>
    </ContentPage.BindingContext>
    
Sign In or Register to comment.