Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
7.5 kB
2
Indexable
Never
<StackLayout BackgroundColor="#6B240C">
    <Label
        FontAttributes="Bold"
        FontFamily="Sans-Serif"
        FontSize="30"
        HorizontalOptions="Center"
        
        Text="Students" />

    <CollectionView
        x:Name="ListStudents"
        Grid.Row="3"
        Margin="0"
        BackgroundColor="#F5CCA0">

        <CollectionView.ItemsLayout>
            <GridItemsLayout Orientation="Horizontal" Span="1" />
        </CollectionView.ItemsLayout>
        <CollectionView.ItemTemplate>
            <DataTemplate>
                <ContentView Padding="2">
                    <Border
                        Margin="20,3,20,6"
                        Padding="0"
                        BackgroundColor="#994D1C"
                        HeightRequest="160"
                        Opacity=".80"
                        Stroke="white"
                        StrokeShape="RoundRectangle 20"
                        StrokeThickness="1">
                        <Grid ColumnDefinitions="Auto, *">
                            <Line Grid.Column="0" WidthRequest="5" />
                            <StackLayout
                                Grid.Column="1"
                                Margin="15"
                                BackgroundColor="Transparent"
                                HorizontalOptions="Fill"
                                Orientation="Horizontal">
                                <ScrollView>
                                    <Grid
                                        ColumnDefinitions="Auto,30, *"
                                        RowDefinitions="Auto, Auto, Auto,Auto,Auto,Auto "
                                        RowSpacing="0">

                                        <Label
                                            Grid.Row="0"
                                            Grid.Column="0"
                                            FontSize="15"
                                            HorizontalOptions="Start"
                                            LineBreakMode="TailTruncation"
                                            Text="Student ID:"
                                            VerticalOptions="Center" />
                                        <Label
                                            Grid.Row="0"
                                            Grid.Column="2"
                                            FontAttributes="Bold"
                                            FontSize="15"
                                            LineBreakMode="TailTruncation"
                                            Text="{Binding ID}" />

                                        <Label
                                            Grid.Row="1"
                                            Grid.Column="0"
                                            FontSize="15"
                                            HorizontalOptions="Start"
                                            Text="First Name:"
                                            VerticalOptions="CenterAndExpand" />
                                        <Label
                                            Grid.Row="1"
                                            Grid.Column="2"
                                            FontAttributes="Bold"
                                            FontSize="15"
                                            LineBreakMode="TailTruncation"
                                            Text="{Binding FirstName}" />
                                        <Label
                                            Grid.Row="2"
                                            Grid.Column="0"
                                            FontSize="15"
                                            HorizontalOptions="Start"
                                            Text=" Lastname:"
                                            VerticalOptions="CenterAndExpand" />
                                        <Label
                                            Grid.Row="2"
                                            Grid.Column="2"
                                            FontAttributes="Bold"
                                            FontSize="15"
                                            LineBreakMode="TailTruncation"
                                            Text="{Binding LastName}" />
                                        <Label
                                            Grid.Row="3"
                                            Grid.Column="0"
                                            FontSize="15"
                                            HorizontalOptions="Start"
                                            Text=" Gender:"
                                            VerticalOptions="CenterAndExpand" />
                                        <Label
                                            Grid.Row="3"
                                            Grid.Column="2"
                                            FontAttributes="Bold"
                                            FontSize="15"
                                            LineBreakMode="TailTruncation"
                                            Text="{Binding Gender}" />

                                        <Label
                                            Grid.Row="4"
                                            Grid.Column="0"
                                            FontSize="15"
                                            HorizontalOptions="Start"
                                            Text=" Address:"
                                            VerticalOptions="CenterAndExpand" />
                                        <Label
                                            Grid.Row="4"
                                            Grid.Column="2"
                                            FontAttributes="Bold"
                                            FontSize="15"
                                            LineBreakMode="TailTruncation"
                                            Text="{Binding Address}" />

                                        <Label
                                            Grid.Row="5"
                                            Grid.Column="0"
                                            FontSize="15"
                                            HorizontalOptions="Start"
                                            Text=" Contact Number:"
                                            VerticalOptions="CenterAndExpand" />
                                        <Label
                                            Grid.Row="5"
                                            Grid.Column="2"
                                            FontAttributes="Bold"
                                            FontSize="15"
                                            LineBreakMode="TailTruncation"
                                            Text="{Binding ContactNumber}" />

                                    </Grid>
                                </ScrollView>
                            </StackLayout>
                        </Grid>
                    </Border>
                </ContentView>
            </DataTemplate>
        </CollectionView.ItemTemplate>
    </CollectionView>
</StackLayout>
Leave a Comment