Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Type xct:EventToCommandBehavior not found in xmlns http://xamarin.com/schemas/2020/toolkit #1974

Open
sharmawaiaman opened this issue Jun 15, 2023 · 0 comments
Labels
bug Something isn't working. Breaky break.

Comments

@sharmawaiaman
Copy link

sharmawaiaman commented Jun 15, 2023

Hello, I am getting the following exception

InnerException {Xamarin.Forms.Xaml.XamlParseException: Position 157:14. Type xct:EventToCommandBehavior not found in xmlns http://xamarin.com/schemas/2020/toolkit at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, Xamarin.Forms.Xaml.INode …} Xamarin.Forms.Xaml.XamlParseException

<ContentPage.Behaviors> <xct:EventToCommandBehavior EventName="Appearing" Command="{Binding PageAppearingCommand}" /> </ContentPage.Behaviors>

above code is what gives the error if i remove this then there is no error

Here is the full code:

`

<ContentPage.ToolbarItems>
    <controls:HideableToolbarItem 
        Order="Primary" 
        Text="{extensions:Translate ChangeTenant}"  
        Command="{Binding ChangeTenantCommand}" 
        IsVisible="{Binding IsMultiTenancyEnabled}"
        ParentPage="{x:Reference LoginPage}" />
</ContentPage.ToolbarItems>

<ContentPage.Content>
    <ScrollView>
        <Grid 
              RowSpacing="0"
              ColumnSpacing="0">

            <Grid.RowDefinitions>
                <RowDefinition Height="0.10*"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="0.20*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Image  Grid.Row="1"   
                Grid.Column="1"
                Aspect="AspectFit"
                Source="{extensions:ImageSource 'IMS.UI.Assets.Images.AppLogo.png'}">
            </Image>

            <Frame Grid.Row="2"
               Grid.Column="1" 
               IsVisible="{Binding IsMultiTenancyEnabled}"
               Style="{StaticResource RoundedFrame}">

                <Grid Padding="0" ColumnSpacing="5" RowSpacing="0" HorizontalOptions="Center">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.5*"/>
                        <ColumnDefinition Width="0.5*"/>
                    </Grid.ColumnDefinitions>

                    <Label Grid.Row="0"
                    Grid.Column="0"
                    LineBreakMode="WordWrap"
                    Text="{extensions:Translate CurrentTenant}"  />

                    <Label Grid.Row="0"
                    Grid.Column="1"
                    LineBreakMode="WordWrap"
                    Text="{Binding CurrentTenancyNameOrDefault}"  
                    Style="{StaticResource ActiveLabel}"/>

                </Grid>

            </Frame>

            <Frame  Grid.Row="3"
                Grid.Column="1"
                Style="{StaticResource RoundedFrame}">

                <StackLayout VerticalOptions="StartAndExpand" Spacing="0">

                    <Label Text="{extensions:Translate UserNameOrEmail}"  />
                    <Entry Text="{Binding UserName, Mode=TwoWay}"  
                       Keyboard="{StaticResource NoCapitalizationKeyboard}"
                       x:Name="UsernameEntry"/>

                    <Label Text="{extensions:Translate Password}" Margin="0,10,0,0"/>
                    <Entry IsPassword="True" 
                       Text="{Binding Password, Mode=TwoWay}" 
                       Keyboard="{StaticResource NoCapitalizationKeyboard}"
                       x:Name="PasswordEntry"/>

                    <Button Text="{extensions:Translate LogIn}"  
                            Command="{Binding LoginUserCommand}" 
                            Margin="0,10,0,0"
                            Style="{StaticResource ActionButton}"
                            IsEnabled="{Binding IsLoginEnabled}"
                            x:Name="LoginButton"/>

                    <Label Text="{extensions:Translate ForgotPassword}" 
                           HorizontalOptions="StartAndExpand" 
                           TextColor="{StaticResource PrimaryColor}"
                           Margin="0,10,0,0">
                        <Label.GestureRecognizers>
                            <TapGestureRecognizer Command="{Binding ForgotPasswordCommand}" />
                        </Label.GestureRecognizers>
                    </Label>

                    <Label Text="{extensions:Translate EmailActivation}" 
                           HorizontalOptions="StartAndExpand" 
                           TextColor="{StaticResource PrimaryColor}"
                           Margin="0,10,0,0">
                        <Label.GestureRecognizers>
                            <TapGestureRecognizer Command="{Binding EmailActivationCommand}" />
                        </Label.GestureRecognizers>
                    </Label>

                    <Picker Title="{extensions:Translate Languages}" 
                            Margin="0,10,0,0"
                            ItemsSource="{Binding Languages}" 
                            ItemDisplayBinding="{Binding DisplayName}"
                            SelectedItem="{Binding SelectedLanguage}"/>

                </StackLayout>
            </Frame>

        </Grid>
    </ScrollView>
</ContentPage.Content>

<ContentPage.Behaviors>
    <xct:EventToCommandBehavior
    EventName="Appearing"
    Command="{Binding PageAppearingCommand}" />
</ContentPage.Behaviors>

`

Version
xamrin forms = 5.0.0.2401
.net 7
Xamarin.CommunityToolkit = 2.0.2

@sharmawaiaman sharmawaiaman added the bug Something isn't working. Breaky break. label Jun 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working. Breaky break.
Projects
None yet
Development

No branches or pull requests

1 participant