Giter Club home page Giter Club logo

Comments (4)

karen-yu-ysk avatar karen-yu-ysk commented on June 16, 2024

Sample code like this:

 <expandable:ExpandableView HorizontalOptions="FillAndExpand"
                                   TouchHandlerView="{x:Reference ExpandableListArrow}"
                                   ExpandAnimationLength="0"
                                   CollapseAnimationLength="0">

            <expandable:ExpandableView.PrimaryView>
                <StackLayout Orientation="Horizontal"
                             Spacing="0"
                             HorizontalOptions="FillAndExpand">
                    <Label Text="Expandable View"
                           FontAttributes="Bold"/>
                    <Image x:Name="ExpandableListArrow"
                           Source="icon_arrow_down"
                           HorizontalOptions="EndAndExpand"
                           VerticalOptions="Start" />
                </StackLayout>
            </expandable:ExpandableView.PrimaryView>

             <expandable:ExpandableView.SecondaryViewTemplate>
                <DataTemplate>
                    <StackLayout Orientation="Vertical"
                                 Spacing="0"
                                 HorizontalOptions="FillAndExpand">
                        <Label Text="View Name"
                               HorizontalOptions="Start"/>

                        <StackLayout Orientation="Vertical"
                                     Spacing="0"
                                     HorizontalOptions="FillAndExpand"
                                     VerticalOptions="FillAndExpand"
                                     BindableLayout.ItemsSource="{Binding SampleList}">
                            <BindableLayout.ItemTemplate>
                                <DataTemplate>
                                    <Grid HorizontalOptions="FillAndExpand"
                                          ColumnSpacing="18"
                                          RowSpacing="25"
                                          Margin="0,0,0,35">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        <StackLayout Spacing="0"
                                                     Grid.Row="0"
                                                     Grid.ColumnSpan="4"
                                                     Orientation="Vertical"
                                                     HorizontalOptions="FillAndExpand">
                                        </StackLayout>
                                    <Label Grid.Row="1"
                                                Grid.ColumnSpan="2"
                                                Text="Label 1"/>
                                     <Label Grid.Row="1"
                                                Grid.Column="2"
                                                Text="Label 2"/>
                                     <Label Grid.Row="1"
                                                Grid.Column="3"
                                                Text="Label 3"/>
                                 </Grid>
                                </DataTemplate>
                            </BindableLayout.ItemTemplate>
                        </StackLayout>
                     <Button Text="Button" 
                                   VerticalOptions="EndAndExpand"/>
                  </StackLayout>
                </DataTemplate>
            </expandable:ExpandableView.SecondaryViewTemplate>. 
</expandable:ExpandableView>

from expandableview.

AndreiMisiukevich avatar AndreiMisiukevich commented on June 16, 2024

Hi @karen-yu-ysk have your already tried Expander from Xamarin.Forms? We merged this control there

from expandableview.

karen-yu-ysk avatar karen-yu-ysk commented on June 16, 2024

@AndreiMisiukevich I have tried Expander from Xamain.Forms. But if showing the empty view in
the list, will throw NaN is not valid for height in IOS.

   <Expander HorizontalOptions="FillAndExpand"
                 ExpandAnimationLength="0"
                 CollapseAnimationLength="0">
        <Expander.Header>
            <StackLayout Orientation="Horizontal"
                         Spacing="0"
                         HorizontalOptions="FillAndExpand">
                <Label Text="Expandable View"
                       FontAttributes="Bold"/>
                <Image x:Name="ExpandableListArrow"
                           Source="icon_arrow_down"
                           HorizontalOptions="EndAndExpand"
                           VerticalOptions="Start">
                        <Image.Triggers>
                            <DataTrigger TargetType="Image"
                                         Binding="{Binding Source={RelativeSource AncestorType={x:Type Expander}}, Path=IsExpanded}"
                                         Value="True">
                                <Setter Property="Source"
                                        Value="icon_arrow_up" />
                            </DataTrigger>
                        </Image.Triggers>
                    </Image>
            </StackLayout>
        </Expander.Header>

         <Expander.ContentTemplate>
            <DataTemplate>
                <StackLayout Orientation="Vertical"
                             Spacing="0"
                             HorizontalOptions="FillAndExpand">
                    <Label Text="View Name"
                           HorizontalOptions="Start"/>

                    <StackLayout Orientation="Vertical"
                                 Spacing="0"
                                 HorizontalOptions="FillAndExpand"
                                 VerticalOptions="FillAndExpand"
                                 BindableLayout.ItemsSource="{Binding SampleList}">
                         <BindableLayout.EmptyView>
                                <Label Text="Empty View"
                                           Margin="0,24,0,0"/>
                         </BindableLayout.EmptyView>
                        <BindableLayout.ItemTemplate>
                            <DataTemplate>
                                <Grid HorizontalOptions="FillAndExpand"
                                      ColumnSpacing="18"
                                      RowSpacing="25"
                                      Margin="0,0,0,35">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <StackLayout Spacing="0"
                                                 Grid.Row="0"
                                                 Grid.ColumnSpan="4"
                                                 Orientation="Vertical"
                                                 HorizontalOptions="FillAndExpand">
                                    </StackLayout>
                                <Label Grid.Row="1"
                                            Grid.ColumnSpan="2"
                                            Text="Label 1"/>
                                 <Label Grid.Row="1"
                                            Grid.Column="2"
                                            Text="Label 2"/>
                                 <Label Grid.Row="1"
                                            Grid.Column="3"
                                            Text="Label 3"/>
                             </Grid>
                            </DataTemplate>
                        </BindableLayout.ItemTemplate>
                    </StackLayout>
                 <Button Text="Button" 
                               VerticalOptions="EndAndExpand"/>
              </StackLayout>
            </DataTemplate>
        </Expander.ContentTemplate>
  </Expander>

from expandableview.

AndreiMisiukevich avatar AndreiMisiukevich commented on June 16, 2024

@AndreiMisiukevich I have tried Expander from Xamain.Forms. But if showing the empty view in
the list, will throw NaN is not valid for height in IOS.

        <Expander.Header>
            <StackLayout Orientation="Horizontal"
                         Spacing="0"
                         HorizontalOptions="FillAndExpand">
                <Label Text="Expandable View"
                       FontAttributes="Bold"/>
                <Image x:Name="ExpandableListArrow"
                           Source="icon_arrow_down"
                           HorizontalOptions="EndAndExpand"
                           VerticalOptions="Start">
                        <Image.Triggers>
                            <DataTrigger TargetType="Image"
                                         Binding="{Binding Source={RelativeSource AncestorType={x:Type Expander}}, Path=IsExpanded}"
                                         Value="True">
                                <Setter Property="Source"
                                        Value="icon_arrow_up" />
                            </DataTrigger>
                        </Image.Triggers>
                    </Image>
            </StackLayout>
        </Expander.Header>

         <Expander.ContentTemplate>
            <DataTemplate>
                <StackLayout Orientation="Vertical"
                             Spacing="0"
                             HorizontalOptions="FillAndExpand">
                    <Label Text="View Name"
                           HorizontalOptions="Start"/>

                    <StackLayout Orientation="Vertical"
                                 Spacing="0"
                                 HorizontalOptions="FillAndExpand"
                                 VerticalOptions="FillAndExpand"
                                 BindableLayout.ItemsSource="{Binding SampleList}">
                         <BindableLayout.EmptyView>
                                <Label Text="Empty View"
                                           Margin="0,24,0,0"/>
                         </BindableLayout.EmptyView>
                        <BindableLayout.ItemTemplate>
                            <DataTemplate>
                                <Grid HorizontalOptions="FillAndExpand"
                                      ColumnSpacing="18"
                                      RowSpacing="25"
                                      Margin="0,0,0,35">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <StackLayout Spacing="0"
                                                 Grid.Row="0"
                                                 Grid.ColumnSpan="4"
                                                 Orientation="Vertical"
                                                 HorizontalOptions="FillAndExpand">
                                    </StackLayout>
                                <Label Grid.Row="1"
                                            Grid.ColumnSpan="2"
                                            Text="Label 1"/>
                                 <Label Grid.Row="1"
                                            Grid.Column="2"
                                            Text="Label 2"/>
                                 <Label Grid.Row="1"
                                            Grid.Column="3"
                                            Text="Label 3"/>
                             </Grid>
                            </DataTemplate>
                        </BindableLayout.ItemTemplate>
                    </StackLayout>
                 <Button Text="Button" 
                               VerticalOptions="EndAndExpand"/>
              </StackLayout>
            </DataTemplate>
        </Expander.ContentTemplate>. 

Do you experience the same exceptions if you use Expander with StackLayout + ScrollView? (Probably there are some troubles with ListView+Expander)

from expandableview.

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.