Hi, I'm having trouble implementing a tabbed view inside a ContentPage. The reason I'm not using the TabbedPage is that I need a header with an image above the tab bar. I have a Grid which contains both a Grid and a ListView, both set to the same row and column, and I want to only make one visible at a time, depending on the ViewModel's Tab property, which is changed with SetTabCommand.
I have verified that SetTabCommand changes the value of Tab, that the converters are called and that they return the correct values. However, neither of the views who're supposed to toggle between visible and invisible change in any way. I've tried commenting out both the inner Grid and the ListView individually, and their visibility doesn't change when I press the navigation buttons. If I don't uncomment either I only see the ListView.
Here's the layout of my xaml:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage>
<ContentPage.Resources>
<ResourceDictionary>
<converters:PropertyMatchToBoolConverter x:Key="TabToVisibilityConverter" />
</ResourceDictionary>
</ContentPage.Resources>
<Grid>
<Grid>
<Image>
</Image>
<Grid>
<Label>
</Label>
<Button Command="{Binding SetTabCommand}" CommandParameter="0">
</Button>
<Button Command="{Binding SetTabCommand}" CommandParameter="1">
</Button>
</Grid>
</Grid>
<ListView
IsVisible="{Binding Tab, Converter={StaticResource TabToVisibilityConverter}, ConverterParameter=0}"
>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Grid
IsVisible="{Binding Tab, Converter={StaticResource TabToVisibilityConverter}, ConverterParameter=1}"
>
</Grid>
</Grid
</ContentPage>
I omitted row/column definition and a bunch of other irrelevant properties; if you feel like anything's missing I could add that back in or post the real xaml, though it is 150 lines.
Does anyone know what I'm doing wrong? I read about bugs concerning IsVisible, but they were supposed to have been fixed.