Closed twopienka closed 5 years ago
The same for me. Any solution for that?
I did not find a solution for this. We now use Telerik controls - anyway I would still be interested in a solution for this.
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.....
Thanks @eiadxp it works for me !
Happy it worked for you @AmorimRob ….
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.....
I ended up writing the UI in c#. I will try your solution later. Thanks for answer.
Thank you @eiadxp - your solution to this works just fine.
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: `