question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

View not displayed on tabbedpage

See original GitHub issue

I’m creating application based on features example. I copied conductor view and view model and tab page view and view model to my application. Title is displayed but content no. InitializeComponent from tab page is called (twice per tab?!). I changed datatemplate to using ContetnView but this not helps at all. I’m using caliburn micro v3.0.3 with Xamarin Forms v2.3.4.231. Any sugestion why content of tabpage is not displaying?

Even this is not working (strange) <Grid> <ContentView cal:View.Model="{Binding Payments}"></ContentView> </Grid>

PaymentsView is not inserted as content. I see only blank page.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nigel-sampsoncommented, May 8, 2017

Thanks for the repository, managed to track the issue down.

TabView is inheriting from ContentPage which unlike the other xaml platforms doesn’t inherit from ContentView so can’t used interchangeably like Page and UserControl can be in say UWP.

Switching TabView to ContentView in both the .xaml and .xaml.cs has it load correctly.

0reactions
nigel-sampsoncommented, Jul 25, 2018

Whenever you see something like the xaml below you can imagine that Caliburn.Micro is examining the type of the Payments property on the view model and determining the correct view for that view model.

<ContentView cal:View.Model="{Binding Payments}" />

For examples sake we’ll say the type of Payments is PaymentsListViewModel, the view by convention would be PaymentsListView.

Caliburn.Micro is then going to instantiate an instance of that view, bind it to the Payments property and insert this new view into the ContentView above.

Now if you look at the Content property on ContentView you’ll see it’s of the type Xamarin.Forms.View. This means trying to insert a view that doesn’t indirectly inherit from Xamarin.Forms.View will result in an error.

What you’ll notice is that all the *Page types in Xamarin.Forms inherit from Page and not View (XF is special here, in the other xaml stacks you’ll see Page typeically inherit View so the can often be used interchangably).

What this means that if your ProductsListView is a Page and not a View you won’t see the view. Switching the root element in the xaml corrects the issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TabbedPage and Content pages are not showing
I have 2 tabbedpage children (Home and Add Location) I want the Home page to be the default page, although even the TabbedPage...
Read more >
NavigationBar not visible on TabbedPage · Issue #670
Hi. I am trying to follow the docs on Multi-page applications and Navigation in order to implement the same view as the C#...
Read more >
TabbedPage is not working for me - Microsoft Q&A
Hi, I am following a tutorial where I create a tabbed page: <TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" ...
Read more >
Working with TabbedPages
When navigating to a TabbedPage, by default the selected tab displayed will always be the first Tab defined for the TabbedPage. In Prism,...
Read more >
Automatic tracking of in-page links not working with tabbed ...
I recently discovered that Webflow can track 'current' secondary navigation to in-page links via href and anchor tags automatically, but, it ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found