enisn / UraniumUI

Uranium is a Free & Open-Source UI Kit for MAUI.
Apache License 2.0
1.17k stars 142 forks source link

tabView error #250

Open t3377806 opened 1 year ago

t3377806 commented 1 year ago

Hello,

I am writing to report an error that I encountered while trying to use the demo test application in the "test" folder. Specifically, I downloaded the application and I am using it in a Windows environment. Every time I click on a tab to switch pages, I receive four error messages that read as follows:

"Binding: 'IsSelected' property not found on 'UraniumUI.Material.Controls.TabItem', target property: 'Microsoft.Maui.Controls.Grid.Bound'"

I am not sure how to resolve this issue, and I would greatly appreciate any guidance or assistance that you can provide. Thank you for your help.

enisn commented 1 year ago

Possibly the same error with https://github.com/enisn/UraniumUI/issues/302#issuecomment-1537167082

There should be x:DataType when Compiled Bindings feature is used.

garyvlc commented 1 year ago

Hi @t3377806 , may i know whether you have resolved the issue? I am hitting the same error.

@enisn Sorry, i am not really understand

daredloco commented 1 year ago

Possibly the same error with #302 (comment)

There should be x:DataType when Compiled Bindings feature is used.

The solution showed in the other post does not solve the problem and it's also a different error, as this happens without adding any custom binding or such. The error happens, even if you use the first example in "Usage" here: https://enisn-projects.io/docs/en/uranium/latest/themes/material/components/TabView

<material:TabView>
    <material:TabItem Title="Tab One">
        <material:TabItem.ContentTemplate>
            <DataTemplate>
                    <Label Text="First Tab" />
            </DataTemplate>
        </material:TabItem.ContentTemplate>
    </material:TabItem>

    <material:TabItem Title="Tab Two">
        <material:TabItem.ContentTemplate>
            <DataTemplate>
                    <Label Text="Second Tab" />
            </DataTemplate>
        </material:TabItem.ContentTemplate>
    </material:TabItem>

    <material:TabItem Title="Tab Three">
        <material:TabItem.ContentTemplate>
            <DataTemplate>
                    <Label Text="Third Tab" />
            </DataTemplate>
        </material:TabItem.ContentTemplate>
    </material:TabItem>
</material:TabView>
babenkovitaliy commented 1 year ago

I am currently having the same issue. I am also seeing a performance drop when trying to click on each individual tab. The small catch with my setup is that I am using MacCatalyst and .NET 8.0, which is still in the preview stage (I decided to use the .NET 8.0 instead of the finalized .NET 7.0, because all of the .NET 7.0 bug fixes were being pushed to .NET 8.0 ONLY).

enisn commented 1 year ago

It seeems similar problem with https://github.com/enisn/UraniumUI/issues/141#issuecomment-1401547853

You can try using xmlns:material="clr-namespace:UraniumUI.Material.Resources;assembly=UraniumUI.Material" namespace instead

babenkovitaliy commented 1 year ago

Nope. Doesn't work. I tried using the suggestion above and then I tried to use the built-in autocomplete feature to populate the xmlns declaration and both returned the error below.

image

babenkovitaliy commented 1 year ago

I think I found the source of the error. At the time of this writing, on line number 492, 'IsSelected' is not a property - it is a field/variable.

You'd need to change it to something like this (written manually, not tested): public bool IsSelected { get => TabView.SelectedTab == this || (TabView.CurrentItem != null && TabView.CurrentItem == Data); }

A few notes about this suggestion: