We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to reveal a back layer based on a gesture in a Xamarin.Forms application

Platform: Xamarin.Forms |
Control: SfBackdropPage

This section explains how to programmatically open and close FrontLayer of SfBackdropPage in Xamarin.Forms.

Refer to this Getting Started documentation, to create a simple sample with BackDropPage control.

Consider the below use case of revealing back layer content of SfBackdropPage based on the button click event in a Xamarin.Forms application.

BackDropPage

This can be achieved by enabling IsBackLayerRevealed property of SfBackdropPage as shown in below code snippet

XAML

<backdrop:SfBackdropPage
             xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:backdrop="clr-        namespace:Syncfusion.XForms.Backdrop;assembly=Syncfusion.SfBackdrop.XForms"
             x:Class="BackDropPage.Drop"
             BackLayerRevealOption="Auto">
 
    <backdrop:SfBackdropPage.BackLayer>
        <backdrop:BackdropBackLayer >
                <ListView HeightRequest="250">
                <ListView.ItemsSource>
                    <x:Array Type="{x:Type x:String}">
                        <x:String>01 JAN : New Year</x:String>
                        <x:String>16 JAN : Release Day</x:String>
                        <x:String>10 APR : Good Friday</x:String>
                        <x:String>25 DEC : Christmas</x:String>
                    </x:Array>
                </ListView.ItemsSource>
            </ListView>
        </backdrop:BackdropBackLayer>
    </backdrop:SfBackdropPage.BackLayer>
 
    <backdrop:SfBackdropPage.FrontLayer>
        <backdrop:BackdropFrontLayer>
            <Grid >
                <Label Text="Upcoming Holidays"/>
                <Button Text="&#x1F5D3;" Grid.Column="1" HorizontalOptions="End"
                        Clicked="Button_Clicked" BackgroundColor="Transparent" />
            </Grid>
        </backdrop:BackdropFrontLayer>
 
    </backdrop:SfBackdropPage.FrontLayer>
    
</backdrop:SfBackdropPage>

C#

public partial class Drop : SfBackdropPage{  private void Button_Clicked(object sender, EventArgs e)
        {
            IsBackLayerRevealed = true;
        }}

 

Note:

By default, IsBackLayerRevealed property is set as false.


For more available options in Reveal and Conceal of back layer, Refer link.

Also Refer our feature tour page to know more about the features available in our back drop page.



2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile