Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error XFC0000: Cannot resolve type "tabs:TabHostView" #5

Open
roubachof opened this issue Oct 29, 2020 · 11 comments
Open

Error XFC0000: Cannot resolve type "tabs:TabHostView" #5

roubachof opened this issue Oct 29, 2020 · 11 comments

Comments

@roubachof
Copy link
Owner

If you end up with this error, it means you forgot to call the Sharpnado.Tabs.Initializer.Initialize() in your App.xaml.cs.
Have a look here: https://github.com/roubachof/Sharpnado.Tabs#installation

@roubachof roubachof pinned this issue Oct 29, 2020
@brentpbc
Copy link

brentpbc commented Nov 2, 2020

hi @roubachof,
I am getting error XFC0000 any time I make a change to my xaml file. But it does not stop the app from compiling or running as expected though. Note I am running VS for Mac

/TestTabControlPage.xaml: Error: : XamlC error XFC0000 : Cannot resolve type "TabHostView".

I have added the initialiser statement to my App.xaml.cs
image

Errors in error window when ever I change the xaml file,Note if I quit VS and reopen the solution the errors go away until I modify the file :
image

Nuget packages installed:
image

What am I missing?

Thanks,
Brent

@roubachof
Copy link
Owner Author

My bet would be a vs mac issue since like you said its still compiling and running fine

@brentpbc
Copy link

brentpbc commented Nov 3, 2020

I think your right, it must be a bug with VS for Mac, it seems to have a problem with x:name, removing references to x:name removes the error for me:

<tabs:TabHostView
   Grid.Row="1"
   Margin="-16,0"
   BackgroundColor="{StaticResource SecondaryUltraLight}"
   SelectedIndex="{Binding SelectedViewModelIndex, Mode=TwoWay}">
  <tabs:TabHostView.Tabs>
       <tabs:UnderlinedTabItem Style="{StaticResource TabStyle}" Label="Details"/>
       <tabs:UnderlinedTabItem Style="{StaticResource TabStyle}" Label="ETS" />
       <tabs:UnderlinedTabItem Style="{StaticResource TabStyle}" Label="Items" />
    </tabs:TabHostView.Tabs>
</tabs:TabHostView>

<ScrollView Grid.Row="2" Padding="{StaticResource PaddingSmall}">
     <tabs:ViewSwitcher 
        Animate="True"
        SelectedIndex="{Binding SelectedViewModelIndex, Mode=TwoWay}">
            <controls:TestTabDetailView Animate="False" BindingContext="{Binding Details}" />
            <controls:TestTabView Animate="False" BindingContext="{Binding Ets}" />
            <controls:TestTabView Animate="False" BindingContext="{Binding Items}" />
    </tabs:ViewSwitcher>
</ScrollView>

@dylix
Copy link

dylix commented Nov 7, 2020

i have this issue as well. on pc. initialized as follow in app.xaml.cs

        Sharpnado.Shades.Initializer.Initialize(false);
        Sharpnado.Tabs.Initializer.Initialize(true, true);

have tried different combinations, no luck

@roubachof
Copy link
Owner Author

Yup, you can fill a bug with the visual studio team.

@roubachof
Copy link
Owner Author

For all reading this issue.
If you see those errors but your project compiles and runs fine, this is a cosmetic VS issue.

@roubachof
Copy link
Owner Author

Also, there is specific versions of Xamarin.Forms that cause this issue (4.7):

xamarin/Xamarin.Forms#11101

@jocontacter
Copy link

jocontacter commented Mar 16, 2021

For all reading this issue.
If you see those errors but your project compiles and runs fine, this is a cosmetic VS issue.

Not certainly in that way. Because of this error, the Intellisence does not work for me. Also, not work hot reload, but I'm not sure what for this reason(XF 4.8.0.1687)

@cmoore-cygnus
Copy link

Definitely not a mac issue. I have the same issue in VS on windows.

@skattegard
Copy link

I did have success with using the explicit xmlns for Tabs-controls. The compile error disappeared and Hot Reload started working again.

xmlns:tab="clr-namespace:Sharpnado.Tabs;assembly=Sharpnado.Tabs"

@bbenetskyy
Copy link

I did have success with using the explicit xmlns for Tabs-controls. The compile error disappeared and Hot Reload started working again.

xmlns:tab="clr-namespace:Sharpnado.Tabs;assembly=Sharpnado.Tabs"

Eh, unfortunately I still getting error in .Net 8.0

1>OrdersPage.xaml: Error  XamlC: Failed to resolve assembly: 'Sharpnado.Tabs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

image

For that I was used same solution:

Using:
xmlns:tabs="clr-namespace:Sharpnado.Tabs;assembly=Sharpnado.Tabs"

Styles:
 <Style x:Key="SegmentedTabStyle" TargetType="tabs:SegmentedTabItem">
                <Setter Property="SelectedTabColor" Value="{StaticResource LightBackgroundColor}" />
                <Setter Property="LabelSize" Value="14" />
                <Setter Property="SelectedLabelColor" Value="{StaticResource AccentColor}" />
                <Setter Property="UnselectedLabelColor" Value="{StaticResource PrimaryColor}" />
            </Style>
            <Style x:Key="TabHostStyle" TargetType="tabs:TabHostView">
                <Setter Property="IsSegmented" Value="True" />
                <Setter Property="TabType" Value="Fixed" />
                <Setter Property="CornerRadius" Value="10" />
                <Setter Property="HeightRequest" Value="40" />
                <Setter Property="BackgroundColor" Value="{StaticResource SegmentBackgroundColor}" />
            </Style>

Usage of Control:
 <tabs:TabHostView
                SelectedIndex="{Binding SelectedTabIndex, Mode=TwoWay}"
                Style="{StaticResource TabHostStyle}"
                VerticalOptions="Center">
                <tabs:TabHostView.Tabs>
                    <tabs:SegmentedTabItem Label="{translate:Translate AllOrders}" Style="{StaticResource SegmentedTabStyle}" />
                    <tabs:SegmentedTabItem Label="{translate:Translate AwaitingOrders}" Style="{StaticResource SegmentedTabStyle}" />
                    <tabs:SegmentedTabItem Label="{translate:Translate DeliveredOrders}" Style="{StaticResource SegmentedTabStyle}" />
                </tabs:TabHostView.Tabs>
            </tabs:TabHostView>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants