MvvmCross and navigation between ContentView

CaseCase USMember ✭✭✭

I'm new to MvvmCross and am having trouble implementing navigation between ContentViews (not pages) using ViewModel first navigation.
I am using Xamarin.Forms, not native.

Consider the following ContentPage

<ContentPage.Content>

    <Grid>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <StackLayout Grid.Column="0">
            <Button Text="Content 1" Command="{Binding GotoContent1}"/>
            <Button Text="Content 2" Command="{Binding GotoContent2}"/>
            <Button Text="Content 3" Command="{Binding GotoContent3}"/>
            <Button Text="Content 4" Command="{Binding GotoContent4}"/>
        </StackLayout>

        <ContentView x:Name="ContentContainer" Grid.Column="1"
                     HorizontalOptions="Fill"
                     VerticalOptions="Fill"/>

    </Grid>

</ContentPage.Content>

I'd like to be able to navigate between different MvxContentViews in the "ContentContainer" ContentView.

I can't find any documentation whatsoever regarding using the MvxContentView let alone navigating with it.

Answers

  • Sandman9Sandman9 Member ✭✭

    You can't directly implement ContentView in ContentPage.

    Firstly, you have to create your ContentView in another folder and then you can create your Design in this ContentView.

    And then you can call your ContentView referance from your ContentPage(like use Plugins in your ContentPage).

Sign In or Register to comment.