How to bind a ContentView content at run time to dynamically assign views.

Say I've built a component as follows:

<ContentView x:Class="MyView">
        <Grid >

and a few others similar....
I'd like to define a page with some dynamic content in a stack layout

            <ContentView Content= "{Binding TestNavVM.CurrentView}"/>

and then in VM code....

public View CurrentView
    get{return view;}
    set{view = value;OnPropertyChanged();}
CurrentView = new MyView();

Of course, it doesn't work, but as this question here suggests it's possible.

So - what am I doing wrong?


  • sonny_ppgsonny_ppg USMember, University ✭✭

    Did you set the binding? I don't see where you set the binding.

Sign In or Register to comment.