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.

Hi,

I tried to add TabView to my solution. Everything is fine as long as I add the TabView from my code as shown in the sample.

But when I add it like this to my XAML: <tvs:TabViewControl HeaderTabTextFontSize="Default"> <tvs:TabViewControl.ItemSource> <tvs:TabItem HeaderText="First Tab"> <Button Text="Go back to main page from first page"/> </tvs:TabItem> <tvs:TabItem HeaderText="Second Tab"> <Button Text="Go back to main page from second page"/> </tvs:TabItem> <tvs:TabItem HeaderText="Third Tab"> <Button Text="Go back to main page from third page" /> </tvs:TabItem> </tvs:TabViewControl.ItemSource> </tvs:TabViewControl>

I get the following exception: System.MissingMethodException: Default constructor not found for type Xam.Plugin.TabView.TabItem as soon as the page loads.

I also added CarouselViewRenderer.Init(); to the Android project.

Did I forget a step to get it working.

Thank you for your help.

Thomas

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
eiadxpcommented, Oct 19, 2018

I know that I’m a little late but just today I’ve used this library and I got the same problem… Nuget package version now is 1.0.3 which is older than the current code on GitHub… The nuget code does not include any parameterless constructors for TabView and for TabItem classes.

To solve this problem you can build the current code from GitHub and use it in your project (They already added parameterless constructors for TabView and for TabItem classes.).

Or you can do what I did in my project… Create to classes that inherits from TabView and TabItem, and add parameterless constructors like this:

    [ContentProperty(nameof(ItemSource))]
    public class TabView : Xam.Plugin.TabView.TabViewControl
    {
        public TabView() : base(new List<Xam.Plugin.TabView.TabItem>(), -1)
        {

        }
    }
    [ContentProperty(nameof(Content))]
    public class TabItem : Xam.Plugin.TabView.TabItem
    {
        public TabItem() : base("", new ContentView())
        {

        }
    }

Now you can use it normally in your XAML files:

    <ctr:TabView>
        <ctr:TabItem HeaderText="Commands"/>
        <ctr:TabItem HeaderText="Tools"/>
    </ctr:TabView>

Please tell me if it is working…

2reactions
eiadxpcommented, Oct 23, 2018

Happy it worked for you @AmorimRob ….

Read more comments on GitHub >

github_iconTop Results From Across the Web

TabView Class (Microsoft.UI.Xaml.Controls) - WinUI
The TabView control is a way to display a set of tabs and their respective content. Tab controls are useful for displaying several...
Read more >
Microsoft.UI.Xaml.Controls.TabView
Public contributions for the Windows User Interface library - winui-api/microsoft.ui.xaml.controls/tabview.md at docs · MicrosoftDocs/winui-api.
Read more >
Displaying DataGrid Row Details in a TabView in WinUI 3
We also implemented 'Tab Tear-off' – inspired by this WinUI Gallery sample. ... You need to reserve a XAML space on top yourself...
Read more >
Using the WPF TabControl
Tab controls are commonly used in Windows applications and even within Windows' own interfaces, like the properties dialog for files/folders etc. Just like...
Read more >
TabView Class | Mobile UI Controls
This example demonstrates how to customize appearance and behavior of the Tab View: Xaml. <dxn:TabView HeaderPanelBackgroundColor="#1e88e5" ...
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