Hello,
im strugglingto achive the following:
I want to have a tabbed page for my user detail because there is plenty of information to show about the clients.
Therefore i use the XCT-TabView and bind my ClientDetailPageModel to the Page. But i cant get the databinding to work inside the TabViewItems.
<ContentPage
x:Class="Pages.ClientDetailPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:model="clr-namespace:Models"
xmlns:viewmodels="clr-namespace:PageModels"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit">
<ContentPage.BindingContext>
<viewmodels:ClientDetailPageModel />
</ContentPage.BindingContext>
<xct:TabView
TabIndicatorColor="Black"
TabIndicatorPlacement="Bottom"
TabStripPlacement="Bottom">
<xct:TabViewItem FontAttributesSelected="Bold" Text="Dateien">
<ContentView BackgroundColor="{StaticResource VioletMain}">
<StackLayout>
<Grid RowDefinitions="Auto, *, Auto">
<StackLayout Grid.Row="0" Padding="20">
<Label Text="{Binding Client.Id, StringFormat='ID: {0}'}" />
<Label Text="{Binding Client.Name, StringFormat='Name: {0}'}" />
<Label Text="{Binding Client.Leistungsort, StringFormat='Leistungsort: {0}'}" />
</StackLayout>
<Frame
Grid.Row="1"
BackgroundColor="Transparent"
HeightRequest="500">
<ListView ItemsSource="{Binding ClientImages}">
<ListView.ItemTemplate>
<DataTemplate>
<ImageCell ImageSource="{Binding Path}" Text="{Binding Name}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Frame>
<Button
Grid.Row="2"
Command="{Binding CapturePhotoCommand}"
Text="Take Pictures" />
</Grid>
</StackLayout>
</ContentView>
</xct:TabViewItem>
<xct:TabViewItem FontAttributesSelected="Bold" Text="Überischt">
<xct:TabViewItem.Content>
<StackLayout Padding="20">
<Label Text="{Binding Client.Id, StringFormat='Name: {0}'}" />
<Label Text="{Binding Client.Name, StringFormat='Prize: {0}'}" />
<Label Text="{Binding Client.Leistungsort, StringFormat='Prize: {0}'}" />
</StackLayout>
</xct:TabViewItem.Content>
</xct:TabViewItem>
</xct:TabView>
</ContentPage>
Result:

However if i add a Stacklayout directly inside the ContentPage the binding works fine.
<ContentPage
x:Class="Pages.ClientDetailPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:model="clr-namespace:Models"
xmlns:viewmodels="clr-namespace:PageModels"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit">
<ContentPage.BindingContext>
<viewmodels:ClientDetailPageModel />
</ContentPage.BindingContext>
<StackLayout>
<Grid RowDefinitions="Auto, *, Auto">
<StackLayout Grid.Row="0" Padding="20">
<Label Text="{Binding Client.Id, StringFormat='ID: {0}'}" />
<Label Text="{Binding Client.Name, StringFormat='Name: {0}'}" />
<Label Text="{Binding Client.Leistungsort, StringFormat='Leistungsort: {0}'}" />
</StackLayout>
<Frame Grid.Row="1" HeightRequest="500">
<ListView ItemsSource="{Binding ClientImages}">
<ListView.ItemTemplate>
<DataTemplate>
<ImageCell ImageSource="{Binding Path}" Text="{Binding Name}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Frame>
<Button
Grid.Row="2"
Command="{Binding CapturePhotoCommand}"
Text="Take Pictures" />
</Grid>
</StackLayout>
</ContentPage>
Result:

What am i missing?
Would be great if someone can point me in the right direction.


