chaosifier / TabView

TabView control for Xamarin.Forms.
MIT License
124 stars 32 forks source link

How to add TabViewControl directly to xaml file? #14

Closed rraallvv closed 5 years ago

rraallvv commented 6 years ago

I'm trying to add the TabViewControl directly to the xaml file like so:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:CustomRenderer"
             xmlns:tv="clr-namespace:Xam.Plugin.TabView;assembly=Xam.Plugin.TabView"
             x:Class="CustomRenderer.TabViewPage">

but I'm getting this error:

/Users/user/Desktop/CustomRenderer/TabViewPage.xaml: Error: The given key 'Xamarin.Forms.Xaml.ElementNode' was not present in the dictionary. (CustomRenderer)
rjantz3 commented 6 years ago

I am currently working on upgrades to the xaml side. I will try to update the samples as well.

rjantz3 commented 6 years ago

@rraallvv I've pushed these commits to my fork. They are included in PR #7 as well. Hopefully @chaosifier will review this shortly.

rraallvv commented 6 years ago

@rjantz3 Thanks, that fixes some issues when trying to set bindable properties from XAML. Also, there is this other issue, when I try to set the font size for the header with values like "Small", "Large", etc. I'm getting some error. Any idea what cold be the problem? Again, thanks for the PR.

cc: @chaosifier

rjantz3 commented 6 years ago

@rraallvv I've updated my code to work for this scenario.

rraallvv commented 6 years ago

@rjantz3 wow! thanks, it works beautifully.

pacomaral commented 6 years ago

Hello @rraallvv or @rjantz3 ,

Could you please explain how did you implement that?

I can't get to use the control directly in the XAML file even using the code of the example rjant shared. I'm adding the nuget package but the XAML doesnt recognise the control.

rjantz3 commented 6 years ago

@pacomaral Until @chaosifier provides an updated nuget package does it work to take the Xam.Plugin.TabView.cs file from my fork and include it in your project?

stivenbr commented 5 years ago

Hello @rraallvv @rjantz3

Please update the change at https://www.nuget.org/packages/Xam.Plugin.TabView/

chaosifier commented 5 years ago

@stivenbr , @rjantz3 Sorry for the delay. I've updated the nuget package.

chaosifier commented 5 years ago

The issue has been fixed in the new version of the package.