Giter Club home page Giter Club logo

Comments (12)

egvijayanand avatar egvijayanand commented on August 27, 2024 1

All my custom ContentPage inherited XAML definitions are resulting in XAMLC errors.

When I surround the XAML with the ContentPage's Content node, it compiles. In that case, all my customization is not working.

Understand it's a Preview release but the basic scenario itself is failing. UT needs to be strengthened further.

from maui.

github-actions avatar github-actions commented on August 27, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

from maui.

simonrozsival avatar simonrozsival commented on August 27, 2024

From what I can tell we're failing to compare type references because for some reason one of them is imported in the MPowerKit module:
image

from maui.

Redth avatar Redth commented on August 27, 2024

Something is odd here that it's showing DataTemplate for the baseClass coming from the MPowerKit.VirtualizeListView module. Looking at that assembly, I do not see any duplicated types, so what would be causing it to appear as though it's imported from that module?

from maui.

kevinxufei avatar kevinxufei commented on August 27, 2024

Verified this issue on VS Code 1.90.0 (9.0.0-preview.5.24307.10). Can repro it with sample project.

from maui.

Redth avatar Redth commented on August 27, 2024

It seems this may be due to a change in the runtime. We are currently investigating this and have some ideas of how we can at least mitigate it in the short term.

from maui.

RobbiewOnline avatar RobbiewOnline commented on August 27, 2024

I also experienced this issue, it propagated as a compiler error for the MAUI community toolkit, whilst compiling.

XC0009 No property, BindableProperty, or event found for "Content", or mismatching type between value and property.

<?xml version="1.0" encoding="utf-8" ?>
<toolkit:Popup xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
               xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
               xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
               x:Class="MyTeamSafe.Views.ProgressPopup">
    <VerticalStackLayout HorizontalOptions="Center" VerticalOptions="Center" BackgroundColor="Purple">
        <ActivityIndicator IsRunning="True" />
        <Label Text="{Binding Message}" />
    </VerticalStackLayout>

</toolkit:Popup>

My temporary workaround was to switch the TargetFramework from

<TargetFrameworks>net9.0-android</TargetFrameworks>

to

<TargetFrameworks>net8.0-android</TargetFrameworks>

But I'm now installing dotnet SDK 9 preview 4 and referencing that from my global.json file to force my project to use preview 4 instead of preview 5

{
  "sdk": {
    "INFO": "From command line type  `dotnet --list-sdks` to get the list of installed dotnet SDKs",
    "version": "9.0.100-preview.4.24267.66"
  }
}

from maui.

egvijayanand avatar egvijayanand commented on August 27, 2024

XC0009 No property, BindableProperty, or event found for "Content", or mismatching type between value and property.

Could you try enclosing the VerticalStackLayout with an explicit Content property tag, which might work?

<toolkit:Popup.Content>
<!-- Everything in-betwen -->
</toolkit:Popup.Content>

from maui.

RobbiewOnline avatar RobbiewOnline commented on August 27, 2024

Could you try enclosing the VerticalStackLayout with an explicit Content property tag, which might work?

I'm sorry, but this doesn't fix it.

from maui.

egvijayanand avatar egvijayanand commented on August 27, 2024

This crude method works.

Define an intermediate base class and modify your Popups to inherit from it.

public class MauiPopup : Popup
{
    public override View? Content
    {
        get => base.Content;
        set => base.Content = value;
    }
}

from maui.

davidortinau avatar davidortinau commented on August 27, 2024

Another example of this:

https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/views/expander

<mct:Expander>
    <mct:Expander.Header>
        <Label Text="Baboon"
               FontAttributes="Bold"
               FontSize="Medium" />
    </mct:Expander.Header>
    <HorizontalStackLayout Padding="10">
        <Image Source="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Papio_anubis_%28Serengeti%2C_2009%29.jpg/200px-Papio_anubis_%28Serengeti%2C_2009%29.jpg"
               Aspect="AspectFill"
               HeightRequest="120"
               WidthRequest="120" />
        <Label Text="Baboons are African and Arabian Old World monkeys belonging to the genus Papio, part of the subfamily Cercopithecinae."
               FontAttributes="Italic" />
    </HorizontalStackLayout>
</mct:Expander>

from maui.

davidortinau avatar davidortinau commented on August 27, 2024

Tested 8.0.70-ci.net8.24320.1 and I'm no longer seeing the error. A result of #23031 being merged?

Nightly 9.0.0-preview.5.24307.10 still generates the error. In both cases building with net9.0-ios.

from maui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.