Git Product home page Git Product logo

forms.bottomsheet's Introduction

Forms.BottomSheet

Native BottomSheets in Xamarin.Forms!

Getting Started

No initialization neccessary! Install the package and you are good to go!

XAML usage

In order to make use of the sheet within XAML you can use this namespace:

'xmlns:bottomSheet="clr-namespace:Forms.BottomSheet;assembly=Forms.BottomSheet"'

Bottom Sheet Control

The BottomSheet is basically a ContentView, so can set the content of your view directly.

<StackLayout>
    <bottomSheet:BottomSheet>
        <Label Text="Main Content"/>
    </bottomSheet:BottomSheet>
</StackLayout>

The sheet content is a DataTemplate which will be inflated on the first opening of the sheet.

<bottomSheet:BottomSheet.BottomSheetContentDataTemplate>
    <DataTemplate>
        <Label Text="I'm a bottom sheet"/>
    </DataTemplate>
</bottomSheet:BottomSheet.BottomSheetContentDataTemplate>

IsOpen will open or close the sheet. If the user closes the sheet by swiping down the property will be set accordingly.

IsModal indicates if the sheet should be presented modal. If the sheet is modal no interaction with the main content is possible.

Cancelableindicates if the sheet is cancelable.

Titlecreates a title at the top of the sheet.

BottomSheetState sets the states of the bottom sheet.

  • Unknown => The sheet can be any state.

  • Medium => The sheet size will be 50% of the screen size and the sheet isn't expandable.

  • Lage => The sheet be full screen and not collapsable.

  • MediumAndLarge => initially opens in Medium state but can be expanded to Large state.

Example

<StackLayout>
    <bottomSheet:BottomSheet IsOpen="True" BottomSheetState="MediumAndLarge" Title="I'm a bottom sheet!">
        <StackLayout>
            <Label Text="Main Content" HorizontalOptions="Center"/>
            <Switch/>
        </StackLayout>
        <bottomSheet:BottomSheet.BottomSheetContentDataTemplate>
            <DataTemplate>
                <CollectionView ItemsSource="{Binding Items}" SelectionMode="Single" SelectedItem="{Binding Item}" SelectionChangedCommand="{Binding SelectionChanged}"/>
            </DataTemplate>
        </bottomSheet:BottomSheet.BottomSheetContentDataTemplate>
    </bottomSheet:BottomSheet>
</StackLayout>

Example

forms.bottomsheet's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

colinkl

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.