Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to use Xamarin-Forms-Labs ViewModel with a MasterDetailPage?

$
0
0

I tried some MVVM implementation for my Xamarin.Forms project and the XLabs' ViewModel looked the best for me. But I do not really know how to make a, for example, MasterDetail XAML page with it. My TestPage is derived from the ViewBase class. So my first approach was something like this:

<?xml version="1.0" encoding="UTF-8" ?>
<toolkit:BaseView xmlns="http://xamarin.com/schemas/2014/forms"
                  xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                  xmlns:toolkit="clr-namespace:XLabs.Forms.Mvvm;assembly=XLabs.Forms"
                  x:Class="XLabs.Sample.Pages.Mvvm.MvvmSamplePage"
                  Title="MVVM">
 <toolkit:BaseView.Content>
        <StackLayout>
            <Button Text="{Binding NavigateToViewModelButtonText}" Command="{Binding NavigateToViewModel}" />
        </StackLayout>
    </toolkit:BaseView.Content>
</toolkit:BaseView>

But inside the BaseView.Content element I can't put another Page. So how to use a MasterDetailPage or a TabbedPage within it?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>