Sharpnado.Tabs icon indicating copy to clipboard operation
Sharpnado.Tabs copied to clipboard

Error XFC0000: Cannot resolve type "tabs:TabHostView"

Open roubachof opened this issue 4 years ago • 11 comments

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 avatar Oct 29 '20 13:10 roubachof

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

brentpbc avatar Nov 02 '20 22:11 brentpbc

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

roubachof avatar Nov 02 '20 22:11 roubachof

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>

brentpbc avatar Nov 03 '20 01:11 brentpbc

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

dylix avatar Nov 07 '20 23:11 dylix

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

roubachof avatar Nov 07 '20 23:11 roubachof

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

roubachof avatar Nov 09 '20 10:11 roubachof

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

https://github.com/xamarin/Xamarin.Forms/issues/11101

roubachof avatar Nov 09 '20 10:11 roubachof

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)

jocontacter avatar Mar 16 '21 20:03 jocontacter

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

cmoore-cygnus avatar Jul 23 '21 00:07 cmoore-cygnus

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"

skattegard avatar Aug 10 '21 21:08 skattegard

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>

bbenetskyy avatar Jul 05 '24 12:07 bbenetskyy