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

A problem when I want to use an entry in Carousel View #56

Open
AliKarimiENT opened this issue Feb 19, 2021 · 2 comments
Open

A problem when I want to use an entry in Carousel View #56

AliKarimiENT opened this issue Feb 19, 2021 · 2 comments

Comments

@AliKarimiENT
Copy link

When I click on entry it moves to the last slide and doesn't allow me to enter number.


<ContentPage.BindingContext>
<viewmodel:FacilityQuestionsViewModel x:Name="ViewModel"/>
</ContentPage.BindingContext>
<ContentPage.Resources>




<buttons:SfRadioGroup BindableLayout.ItemsSource="{Binding OptionsCollection}"
FlowDirection="RightToLeft"
HorizontalOptions="StartAndExpand">
<BindableLayout.ItemTemplate>

<buttons:SfRadioButton HorizontalOptions="StartAndExpand"
TextColor="Black" Text="{Binding .}"
FontFamily="{StaticResource ShabnamFontFamily}"/>

</BindableLayout.ItemTemplate>
</buttons:SfRadioGroup>

        </StackLayout>
    </DataTemplate>
    <DataTemplate x:Key="YesNoQuestionTemplate">
        <StackLayout Orientation="Vertical">
            <Label Text="{Binding Title}"/>
            <buttons:SfRadioGroup>
                <buttons:SfRadioButton Text="بله"/>
                <buttons:SfRadioButton Text="خیر"/>
            </buttons:SfRadioGroup>
        </StackLayout>
    </DataTemplate>
    <DataTemplate x:Key="HistoricalQuestionTemplate">
        <StackLayout Orientation="Vertical">
            <Label Text="{Binding Title}" 
                   FontFamily="{StaticResource ShabnamBoldFontFamily}"
                   TextColor="Black"
                   VerticalOptions="Center"
                   HorizontalOptions="Center"
                   HorizontalTextAlignment="Center"
                   VerticalTextAlignment="Center"/>
            <Label Text="تاریخ مورد نظر را انتخاب کنید"
                   FontFamily="{StaticResource ShabnamFontFamily}"
                   TextColor="Black"
                   VerticalOptions="Center"
                   HorizontalOptions="Center"
                   HorizontalTextAlignment="Center"
                   VerticalTextAlignment="Center"/>
        </StackLayout>
    </DataTemplate>
    <DataTemplate x:Key="NumericalQuestionTemplate">
        <StackLayout Orientation="Vertical">
            <Label Text="{Binding Title}" 
                   FontFamily="{StaticResource ShabnamBoldFontFamily}"
                   TextColor="Black"
                   VerticalOptions="Center"
                   HorizontalOptions="Center"
                   HorizontalTextAlignment="Center"
                   VerticalTextAlignment="Center"/>
            **<xforms:SfNumericTextBox FormatString="###,##0"
                   Margin="50,20"
                   VerticalOptions="CenterAndExpand"
                    HorizontalOptions="CenterAndExpand"
                   AllowNull="True" 
                   Watermark = "Enter Value"
                   IsEnabled="True" ParserMode="Decimal"
                    ValueChangeMode="OnLostFocus"
                   />**
            <!--<Entry IsPassword="False"
                   IsSpellCheckEnabled="True"/>
            </StackLayout>
    </DataTemplate>

    <customcontrols:FacilityQuestionTemplateSelecor 
        x:Key="QuestionSelector"
        OptionalQuestionTemplate="{StaticResource OptionalQuestionTemplate}"
        YesNoQuestionTemplate="{StaticResource YesNoQuestionTemplate}"
        HistoricalQuestionTemplate="{StaticResource HistoricalQuestionTemplate}"
        NumericalQuestionTemplate="{StaticResource NumericalQuestionTemplate}"/>
    
</ContentPage.Resources>
<ContentPage.Content>
    <Grid RowDefinitions="50,Auto,30,40">
        <CarouselView ItemsSource="{Binding FacilityQuestions}" Grid.Row="1"
                      BackgroundColor="Transparent"
                      IndicatorView="Indicators"
                      Loop="False"
                      IsBounceEnabled="True"
                      IsTabStop="False"
                      IsScrollAnimated="True"
                      IsSwipeEnabled="True"
                      x:Name="carouselView"
                      PositionChanged="CarouselView_PositionChanged"
                      ItemTemplate="{StaticResource QuestionSelector}">
            <CarouselView.ItemsLayout>
                <LinearItemsLayout Orientation="Horizontal"
                                   SnapPointsType="MandatorySingle"
                                   SnapPointsAlignment="Center"

/>
</CarouselView.ItemsLayout>

        <IndicatorView **x:Name="Indicators"**
                       Grid.Row="2" 
                       SelectedIndicatorColor="#14B541" 
                       IndicatorColor="SlateGray"
                       IndicatorSize="5"/>
    </Grid>
</ContentPage.Content>
@jsuarezruiz
Copy link

Seeing that you use IndicatorView I suspect that you use the new CarouselView and that this issue should be in https://github.com/xamarin/Xamarin.Forms/issues

@AliKarimiENT
Copy link
Author

Please send me a link to see new carousel view. Because I couldn't find that issue on the link you send below

Seeing that you use IndicatorView I suspect that you use the new CarouselView and that this issue should be in https://github.com/xamarin/Xamarin.Forms/issues

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants