Why do I get these errors after upgrading to Xamarin Forms 4.0.0.425677 or above?

BillyMartinBillyMartin ✭✭✭USMember ✭✭✭
edited August 13 in Xamarin.Forms

No property, bindable property, or event found for 'Style', or mismatching type between value and property.

No property, bindable property, or event found for 'ItemsSource', or mismatching type between value and property.

in VS2019:
3.6.0.539721 works great, but the minute I upgrade, I get these errors.

in VS2017:
I get a bunch of Resource.designer.cs issues even with 3.6.0.539721

Best Answers

Answers

  • Jack_HuaJack_Hua ✭✭ Member ✭✭

    Can you please share a simple sample about this problem? Any code about Style and ItemsSource?

  • BillyMartinBillyMartin ✭✭✭ USMember ✭✭✭

    Sure!

    In App.xaml:

      <Style x:Key="transparentButtonStyle" TargetType="Button">
                    <Setter Property="BackgroundColor" Value="Transparent" />
                    <Setter Property="TextColor" Value="White" />
                    <Setter Property="FontSize" Value="Large" />
                    <Setter Property="HorizontalOptions" Value="Start" />
                </Style>
    

    In About.xaml:

       <Button
                            x:Name="WebsiteButton"
                            Margin="0"
                            BackgroundColor="Transparent"
                            Clicked="GoToWebsiteAsync"
                            FontSize="Large"
                            Style="StaticResource transparentButtonStyle"
                            Text="Visit Our Website"
                            TextColor="Yellow" />
    
  • BillyMartinBillyMartin ✭✭✭ USMember ✭✭✭
    edited August 14

    When I commented them out, I started getting multiple errors about Colos.xml, Tabbar.xml, Style.xml, etc

    What changed in Xamarin 4? Something to do with Material Theme, maybe?

  • BillyMartinBillyMartin ✭✭✭ USMember ✭✭✭

    Hmmm. It's been running fine in production for over a year, but I'll change it and let you know!

  • BillyMartinBillyMartin ✭✭✭ USMember ✭✭✭

    Wow! That did it. It's the little things, isn't it? LOL

    Thanks so much!

  • batmacibatmaci ✭✭✭✭✭ DEMember ✭✭✭✭✭

    your style wasnt applied probably in 3.6 but you didnt get also any error because xamarin didnt verify your xaml until 4.0. finally they enhanced XamlC to provide better build errors and you got the error, I assume.

Sign In or Register to comment.